【问题标题】:Apache configuration for wordpress gives 403 Forbiddenwordpress 的 Apache 配置给出 403 Forbidden
【发布时间】:2014-07-20 13:49:52
【问题描述】:

尝试了几天来配置 Apache 以在全新的 Ubuntu 安装上运行 wordpress。 设置如下: - 我有一个包含两个子域的域 1-silex.mydomain.com 2- wp.mydomain.com - 在 apache 中,我必须让虚拟主机都使用端口 80,但使用 ServerName 来区分站点。 - silex.mydomain.com 适用于基于 silex php 的网站。 - wp.mydomain.com 总是给出 403 You don't have permission to access / on this server.

这里两个站点的配置文件几乎相同,只是服务器名、文档根目录等不同。其他一切都是一样的。这是silex.conf文件 顺便说一下,重写模式是打开的,为了测试,我给了整个 wordpress 目录的“myuser:www-data”所有权770权限,默认情况下没有.htaccess,我没有添加任何。

   <VirtualHost *:80>
        ServerAdmin webmaster@mydomain.com

        DocumentRoot /opt/test/wordpress
        ServerName wp.mydomain.com
        <Directory /opt/test/wordpress/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                FallbackResource /index.php
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>


</VirtualHost>

【问题讨论】:

  • AllowOverride 我也试过了,但没有帮助。

标签: wordpress apache .htaccess mod-rewrite ubuntu-13.10


【解决方案1】:

我将 Apache 日志更改为 Debug,但它抱怨在 /opt/test 中找不到 .htaccess。 现在已经解决了,我有一些需要整理的文件权限。 Wordpress 应该有一个脚本来处理这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-22
    • 1970-01-01
    • 2014-02-17
    • 2015-12-29
    • 2012-07-25
    • 1970-01-01
    • 2016-08-29
    相关资源
    最近更新 更多