【 APACHE 】 Apache2.4.x版本虚拟主机配置

  今天准备使用apache搭建一个目录浏览的服务,折腾了一下。

 

apache2.4.x以后的版本:

Require all granted

代替了apache2.4.x以前版本:

    Order Allow, Deny  
    Allow from all  

这里要注意一下,2.4.x以前的版本<Directory> 可以不用写,但是在之后的版本里面,如果不写<Directory> 会报403错误。

具体配置如下:

listen *:8000
<VirtualHost *:8000>
    ServerName 192.168.118.150
    DocumentRoot /data
    <Directory "/data">
        Options Indexes
        Require all granted 
    </Directory>
</VirtualHost>

 

posted @ 2016-06-29 14:07  hukey  阅读(367)  评论(0编辑  收藏  举报