我刚刚开始使用VPS,我对Apache和其他所有东西都很陌生。
所以我有一些网站启动并运行,但由于某种原因我无法使Multiviews工作。我在互联网上搜索了一个article来描述我的问题,但他们的解决方案不起作用。 stackoverflow上的this thread似乎也不适用于我。
我从/etc/apache2/sites-availlable
<VirtualHost *:80>
ServerName site.com
DocumentRoot /var/www/vhosts/site.com/webroot/
<Directory /var/www/vhosts/site.com/webroot/>
Options Indexes FollowSymLinks Multiviews
AllowOverride all
</Directory>
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>
现在,当我访问www.site.com/index.php时,它工作正常,但www.site.com/index给了我404和以下日志消息:
[Tue Feb 24 10:18:45 2015] [error] [client 213.125.184.74] Negotiation: discovered file(s) matching request: /var/www/vhosts/site.com/webroot/index (None could be negotiated).
所以我将site.conf
更改为以下内容:
<VirtualHost *:80>
ServerName site.com
DocumentRoot /var/www/vhosts/site.com/webroot/
<Directory /var/www/vhosts/site.com/webroot/>
Options Indexes +FollowSymLinks -Multiviews
AllowOverride all
</Directory>
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>
不幸的是,我的日志文件中仍然存在相同的错误,因此我禁用了协商模块(as mentioned),但这只是给了我这条消息:
[Tue Feb 24 10:21:02 2015] [error] [client 213.125.184.74] File does not exist: /var/www/vhosts/site.com/webroot/index
完成对site.conf
的所有修改后,我执行了service apache2 restart
和/或service apache2 reload
此时我不知道如何解决这个问题,所以我希望有人指出我正确的方向。
答案 0 :(得分:0)
我认为&#34;选项索引FollowSymLinks Multiviews&#34;是正确的配置。是的,你需要做&#34; apache reload&#34;修改配置后。 还要确保你接受&#34; php&#34;在内容谈判中。 (默认情况下可能不接受)