客户端被服务器configuration拒绝:/ opt / bitnami / apps / wordpress / htdocs /

我有错误日志文件中的bitnami图像ec2上的文字新闻网站,我越来越bellow片段错误。

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

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

  [Tue Feb 17 07:07:18.977511 2015] [ssl:warn] [pid 29411:tid 140429621905216] AH01909: justforhearts.org:443:0 server certificate does NOT include an ID which matches the server name [Tue Feb 17 07:07:18.977829 2015] [ssl:warn] [pid 29411:tid 140429621905216] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name [Tue Feb 17 07:07:18.977930 2015] [lbmethod_heartbeat:notice] [pid 29411:tid 140429621905216] AH02282: No slotmem from mod_heartmonitor [Tue Feb 17 07:07:18.992006 2015] [mpm_event:notice] [pid 29411:tid 140429621905216] AH00489: Apache/2.4.10 (Unix) OpenSSL/1.0.1j configured -- resuming normal operations [Tue Feb 17 07:07:18.992028 2015] [core:notice] [pid 29411:tid 140429621905216] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf -D DISABLE_BANNER' [Tue Feb 17 07:12:25.491605 2015] [access_compat:error] [pid 28267:tid 140429274093312] [client 199.59.148.209:32041] AH01797: client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/robots.txt [Tue Feb 17 07:12:25.697742 2015] [access_compat:error] [pid 28267:tid 140429265700608] [client 199.59.148.209:32041] AH01797: client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/2014 [Tue Feb 17 07:12:25.697742 2015] [access_compat:error] [pid 28267:tid 140429265700608] [client 199.59.148.209:32041] AH01797: client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/ 

你可以看到我的conf文件结构。

httpd-vhosts.conf文件片段

 <VirtualHost *:80> ServerName example.com ServerAlias www.example.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 example.com ServerAlias www.example.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文件片段

 <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文件片段

 # 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> 

.htaccess文件片段,文件权限664

 # BEGIN s2Member GZIP exclusions <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR] RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1 RewriteRule .* - [E=no-gzip:1] </IfModule> ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" </IfModule> ## EXPIRES CACHING ## # END s2Member GZIP exclusions # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible AddDefaultCharset UTF-8 RewriteCond %{REQUEST_URI} !^.*[^/]$ RewriteCond %{REQUEST_URI} !^.*//.*$ RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC] RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{HTTPS} on RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L] RewriteCond %{REQUEST_URI} !^.*[^/]$ RewriteCond %{REQUEST_URI} !^.*//.*$ RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC] RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteCond %{HTTPS} !on RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz" [L] RewriteCond %{REQUEST_URI} !^.*[^/]$ RewriteCond %{REQUEST_URI} !^.*//.*$ RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC] RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC] RewriteCond %{HTTPS} on RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L] RewriteCond %{REQUEST_URI} !^.*[^/]$ RewriteCond %{REQUEST_URI} !^.*//.*$ RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$ RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC] RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC] RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC] RewriteCond %{HTTPS} !on RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html" [L] </IfModule> # END WPSuperCache # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 

文件夹权限片段

 total 728 -rwxrwxr-x 1 bitnami daemon 1150 Jan 14 2012 favicon.ico -rwxrwxr-x 1 bitnami daemon 53 Feb 12 2013 google496df181d1f0e489.html -rwxrwxr-x 1 bitnami daemon 53 Jan 3 2013 googled446f1edcf45faf3.html -rwxrwxr-x 1 bitnami daemon 53 Dec 23 2013 googledc9356356aa4126c.html -rwxrwxr-x 1 bitnami daemon 418 Nov 1 2013 index.php -rwxrwxr-x 1 bitnami daemon 19930 Feb 19 02:09 license.txt -rwxrwxr-x 1 bitnami daemon 19 Dec 31 10:42 phpinfo.php -rwxrwxr-x 1 bitnami daemon 7195 Feb 19 02:09 readme.html -rwxrwxr-x 1 bitnami daemon 263 Jul 20 2014 robots.txt -rwxrwxr-x 1 bitnami daemon 466324 Feb 28 2014 sitemap.xml -rwxrwxr-x 1 bitnami daemon 18529 Jul 26 2012 timthumb.php -rwxrwxr-x 1 bitnami daemon 15 Apr 13 2013 verifyforzoho.html drwxrwxr-x 2 bitnami daemon 4096 Feb 11 18:56 wc-logs -rwxrwxr-x 1 bitnami daemon 4951 Sep 6 06:37 wp-activate.php drwxrwxr-x 10 bitnami daemon 4096 Feb 4 2014 wp-admin -rwxrwxr-x 1 bitnami daemon 226 Jan 12 2012 wp-atom.php drwxrwxr-x 2 bitnami daemon 4096 Nov 18 14:20 wp-backups -rwxrwxr-x 1 bitnami daemon 271 Nov 1 2013 wp-blog-header.php -rwxrwxr-x 1 bitnami daemon 5008 Dec 19 07:51 wp-comments-post.php -rwxrwxr-x 1 bitnami daemon 244 Jan 12 2012 wp-commentsrss2.php -rwxrwxr-x 1 bitnami daemon 4146 Jan 31 12:36 wp-config.php -rwxrwxr-x 1 bitnami daemon 2726 Dec 19 07:51 wp-config-sample.php drwxrwxr-x 17 bitnami daemon 4096 Feb 23 08:29 wp-content -rwxrwxr-x 1 bitnami daemon 2956 Sep 6 06:37 wp-cron.php -rwxrwxr-x 1 bitnami daemon 246 Jan 12 2012 wp-feed.php drwxrwxr-x 12 bitnami daemon 4096 Sep 6 06:37 wp-includes -rwxrwxr-x 1 bitnami daemon 2380 Nov 1 2013 wp-links-opml.php -rwxrwxr-x 1 bitnami daemon 2714 Sep 6 06:37 wp-load.php -rwxrwxr-x 1 bitnami daemon 33435 Dec 19 07:51 wp-login.php -rwxrwxr-x 1 bitnami daemon 8252 Sep 6 06:37 wp-mail.php -rwxrwxr-x 1 bitnami daemon 413 Jan 12 2012 wp-pass.php -rwxrwxr-x 1 bitnami daemon 224 Jan 12 2012 wp-rdf.php -rwxrwxr-x 1 bitnami daemon 334 Jan 12 2012 wp-register.php -rwxrwxr-x 1 bitnami daemon 226 Jan 12 2012 wp-rss2.php -rwxrwxr-x 1 bitnami daemon 224 Jan 12 2012 wp-rss.php -rwxrwxr-x 1 bitnami daemon 11115 Dec 31 11:07 wp-settings.php -rwxrwxr-x 1 bitnami daemon 25152 Dec 19 07:51 wp-signup.php -rwxrwxr-x 1 bitnami daemon 4035 Dec 19 07:51 wp-trackback.php -rwxrwxr-x 1 bitnami daemon 3032 Apr 17 2014 xmlrpc.php 

php-fpm-apache.conf片段

 <IfDefine USE_PHP_FPM> <Proxy "unix:/opt/bitnami/php/var/run/www.sock|fcgi://www-fpm" timeout=300> </Proxy> <FilesMatch \.php$> SetHandler "proxy:fcgi://www-fpm/" </FilesMatch> </IfDefine> 

如果文件的新path是“/ opt / bitnami / apps / wordpress / htdocs /”,为什么它包含在httpd-app中的#Include“/opt/bitnami/apps/wordpress/conf/htaccess.conf”? 此外,请注意,手动更改WP / WP主题的configurationpath很可能会导致它们无法正常工作,因为它们使用相对path。 如果您更改了主文件的path,则必须在所有其他直接指向该文件的文件中手动更改它。 所以最好使用先进的文本编辑器来检查你需要改变新文件的path。

这些403只是在HTTPS版本发生? 如果是这样,在httpd-vhosts.conf中,将整个<Directory...>部分复制到<VirtualHost *:443>部分。 如果没有,那么在.htaccess文件中可能会有一些限制,所以添加Satisfy Any (请参阅https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy

如果这些失败:

  • 是启用php5-fpm.conf?
  • Require all granted指令添加到您的<Proxy>部分。 (请参阅https://wiki.apache.org/httpd/ClientDeniedByServerConfiguration
  • 请发布您的.htaccess文件和path
  • 检查其文件权限。
  • 你能用Apache 2.2的.htaccess文件吗?
  • 显示在ls -l /opt/bitnami/apps/wordpress/htdocs post文件权限

尝试使用目录块的http-vhosts.conf文件来允许访问目录,将其放置在:80和:443 vhost文件中:

“`

  <Directory "/opt/bitnami/apps/wordpress/htdocs"> Options +SymLinksIfOwnerMatch AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,MultiViews Options Require all granted </Directory> 

“`