您的位置:首页 > 运维架构 > Apache

apache 配置虚拟目录

2011-09-20 16:04 429 查看
#添加我的虚拟目录myweb,需要重启
<IfModule dir_module>
DirectoryIndex index.html
Alias /myweb "C:/myweb"
<Directory C:/myweb>
order allow,deny
Allow from all
</Directory>
</IfModule>

注: order allow,deny 这行的逗号之间千万不要有空格,,,,不然会启动失败!!!

#配置自己的虚拟主机
<VirtualHost 127.0.0.1:80>
DocumentRoot "C:/myweb"
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
<Directory />
Options FollowSymLinks IncludesNOEXEC Indexes
AllowOverride None

Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

注:这个<Directory />为什么一定要直接用"/"闭合。。。。。不闭合apache还不能启动。。。。。不解。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: