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

Apache新版配置虚拟主机的注意事项

2016-04-18 11:54 405 查看
原文链接:https://www.geek-share.com/detail/2671951642.html

1.关于没有默认索引文件(index.php或者index.html)时,列出目录:需要开启模块

LoadModule autoindex_module modules/mod_autoindex.so

且配合httpd-vhosts.conf的设置:

<Directory "E:/www/demo">
Options Indexes FollowSymLinks
# for rewrite
AllowOverride Indexes FileInfo
</Directory>

Indexes 即: 如果输入的网址对应服务器上的一个文件目录,而此目录中又没有DirectoryIndex指令(例如:DirectoryIndex index.html index.php),那么服务器会返回由mod_autoindex模块生成的一个格式化后的目录列表

 

2.关于权限变为:Require all granted

<VirtualHost *:8081>
ServerName www.smartmall.com
DocumentRoot "D:/website/www.smartmall.com/frontend/web"
<Directory "D:/website/www.smartmall.com/frontend/web">
Options Indexes FollowSymLinks
Require all granted
AllowOverride All
</Directory>
</VirtualHost>

其中:AllowOverride All 是支持rewrite重写,需要开启httpd.conf中的 LoadModule rewrite_module modules/mod_rewrite.so

 

转载于:https://www.cnblogs.com/intval/p/5403888.html

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: