【问题标题】:client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/服务器配置拒绝客户端:/opt/bitnami/apps/wordpress/htdocs/
【发布时间】:2015-04-04 21:34:36
【问题描述】:

我在 ec2 上有 word-press 网站,错误日志文件中有 bitnami 图像我收到以下 sn-p 错误。

我已经用我的.htaccess 文件覆盖了默认的htaccess.conf 文件

现在.htaccess 文件的路径是/opt/bitnami/apps/wordpress/htdocs/

client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/
client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/robots.txt
localhost:443:0 server certificate does NOT include an ID which matches the server name
Command line: '/opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER'
client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads/easy_team_manager/index.php, referer: http://www.example.com/team/

您可以在下面看到我的 conf 文件结构。

httpd-vhosts.conf 文件 sn-p

<VirtualHost *:80>
    ServerName mydomainname.com
    ServerAlias mydomainname.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
<Directory "/opt/bitnami/apps/wordpress/htdocs">
  Options All
  AllowOverride All
  Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
    ServerName mydomainname.com
    ServerAlias mydomainname.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apps/wordpress/conf/certs/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apps/wordpress/conf/certs/server.key"
    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

httpd-app.conf 文件 sn-p

<IfDefine USE_PHP_FPM>
    <Proxy "unix:/opt/bitnami/php/var/run/wordpress.sock|fcgi://wordpress-fpm" timeout=300>
    </Proxy>
</IfDefine>
<Directory "/opt/bitnami/apps/wordpress/htdocs">
    Options +MultiViews +FollowSymLinks
    AllowOverride All
    <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
        Require all granted
    </IfVersion>
    <IfDefine USE_PHP_FPM>
       <FilesMatch \.php$>
         SetHandler "proxy:fcgi://wordpress-fpm/"
       </FilesMatch>
    </IfDefine> 
    RewriteEngine On
    #RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [S=1]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
        Include "/opt/bitnami/apps/wordpress/conf/banner.conf"
</Directory>
#Include "/opt/bitnami/apps/wordpress/conf/htaccess.conf"

banner.conf 文件 sn-p

# Banner configuration
<IfDefine !DISABLE_BANNER>
    <If "%{REQUEST_URI} !~ m!^/+(index\.php)?/*$!i" >
       SetEnv  "DISABLE_BANNER" "YES"
    </If>
    Include "/opt/bitnami/apps/bitnami/banner/conf/banner-substitutions.conf"
</IfDefine>

【问题讨论】:

    标签: apache .htaccess virtualhost httpd.conf bitnami


    【解决方案1】:

    您可能正尝试通过 SSL 连接到本地设置,因为错误日志显示

    localhost:443:0 服务器证书不包含与服务器名称匹配的 ID

    但是,您的 SSL 证书文件

    SSLCertificateFile "/opt/bitnami/apps/wordpress/conf/certs/server.crt"

    可能已创建仅验证 example.com。因此,虽然此 SSL 设置可能在线工作,但通过 localhost 访问时会失败,因为浏览器知道本地服务器不是 example.com

    要解决此问题,您可以覆盖 example.com 的 DNS 查找请求,方法是将其映射到您的 /etc/hosts 文件中的 localhost

    127.0.0.1    example.com
    127.0.0.1    www.example.com
    

    这允许您连接到您的本地设置,同时仍然让您的浏览器相信它在example.com 上,但显然不是。 SSL 握手现在应该会成功,因为这次浏览器不会拒绝服务器证书。

    【讨论】:

    • 你的意思是我必须从 127.0.0.1 localhost 设置 127.0.0.1 mydomainname.com 的主机文件??
    • 我已经完成了更改,在此之前我已将 127.0.0.1 localhost 替换为 127.0.0.1 mydomainname.com,然后我删除了错误日志文件,似乎该文件是我未创建的错误日志,我希望是这个工作但需要每隔一小时观察一次以确认是否工作?
    • 无需删除 localhost 条目。重新添加它,否则它可能会干扰该机器上运行的任何其他网络软件。您只需要将这些新映射添加到文件中。多个域指向同一个地址也没关系。
    • 现在我已经添加了你所说的 127.0.0.1 localhost 127.0.0.1 mydomainname.org 127.0.0.1 www.mydomainname.org 但它在错误日志中再次显示错误:-localhost:443:0 服务器证书不包含与服务器名称匹配的 ID
    • 并再次收到此错误:- 客户端被服务器配置拒绝:/opt/bitnami/apps/wordpress/htdocs/my-food-diary
    猜你喜欢
    • 2012-01-14
    • 1970-01-01
    • 2019-12-10
    • 2012-05-08
    • 1970-01-01
    • 2013-08-25
    • 2011-04-10
    相关资源
    最近更新 更多