我不想使用.htaccess。我应该如何更改我的目录属性?
<VirtualHost *:80>
ServerName abc.com
DocumentRoot /usr/share/uploads
<Directory " /usr/share/uploads">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
发布于 2012-06-22 12:22:57
我真的在互联网上找不到直接的答案;甚至在apache文档中也找不到。最后,可以通过几次迭代找到解决方案;我们需要使用选项,并且值不应包含索引。
<Directory "/usr/share/uploads">
Options Includes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
发布于 2013-03-07 06:49:52
如果您使用的是Debian/Ubuntu,只需转到终端并输入
sudo a2dismod autoindex
sudo service apache2 restart
如果您使用的是Centos/Fedora,只需执行以下操作:
mv /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/autoindex.bkp
/etc/init.d/httpd restart
在其他操作系统或发行版中也是如此。
这应该会禁用apache模块,该模块会使那些花哨的(通常无用的和安全问题的)目录清单失效。此外,作为额外奖励,您还可以获得一些性能:-)
发布于 2017-06-06 13:46:46
上面都做完了,但是目录信息还没出来吗?如果您使用index.php而不是index.html,请检查以下各项:
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
https://stackoverflow.com/questions/11136913
复制相似问题