我使用 apache2 来托管一个网站。我的目录中有index.html和index.php。
我打开/etc/apache2/apache2.conf
并添加一行:
DirectoryIndex index.php index.html index.htm
然后重新启动apache2。但当我打开localhost/~username
,它访问index.html。
我环顾四周,但找不到问题。我的 httpd.conf 是空的,并且没有 .htaccess 文件。
设置可以隐藏在哪里?
Edit: 修改后/etc/apache2/mods-availiable/dir.conf
,它找到index.php。
但为什么 apache2.conf 不能覆盖 dir.conf?!
I think mod_dir
未加载,请尝试命令sudo a2enmod dir
and service apache2 restart
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)