繁体   English   中英

VPS上的多视图给出了协商错误

[英]Multiviews on VPS gives me Negotiation error

我刚刚开始使用VPS,我对Apache和其他所有东西都很新。

所以我有一些网站启动并运行,但由于某种原因,我无法使Multiviews工作。 我在互联网上搜索并找到一篇描述我的问题的文章 ,但他们的解决方案不起作用。 此外,stackoverflow上的这个线程似乎对我不起作用。

我从/etc/apache2/sites-availlable的以下(site.conf)配置文件/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>

不幸的是,我的日志文件中仍然存在相同的错误,所以我禁用了协商模块( 如上所述 ),但这只是给了我这条消息:

[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

在这一点上,我不知道如何解决这个问题,所以我希望有人指出我正确的方向。

我认为“选项索引FollowSymLinks Multiviews”是正确的配置。 是的,修改配置后需要执行“apache reload”。 还要确保在内容谈判中接受“php”。 (默认情况下可能不接受)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM