今天准备使用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>