现在的位置: 首页 > 综合 > 正文

记录一下Apache virtual host配置以及虚拟路径配置

2013年09月19日 ⁄ 综合 ⁄ 共 496字 ⁄ 字号 评论关闭

Virtual Host配置:

<Directory "E:/code">

Options All
AllowOverride All
Order deny,allow
Allow from all

</Directory>

NameVirtualHost 192.168.76.188
<VirtualHost 192.168.76.188>
DocumentRoot "E:/code/ppt"
ServerName www.ppt.com
</VirtualHost>

以前总是会忘记,记录一下。

特别值得一提的是上面的那个 <Directory 一栏,这是一个出站规则,如果没有加上那句的话,别人通过修改host也是不能访问你的网页。

在此谢谢余常峰的帮助。

虚拟路径配置:

找到<IfModule alias_module>

在下面增加一句话:Alias /code "E:/code"

另外需要额外加上一点,也就是上面要求的那点一样:

<Directory "E:/code">

Options All
AllowOverride All
Order deny,allow
Allow from all

</Directory>

不然Apache默认是不能访问的。


就这样吧~

抱歉!评论已关闭.