client negado pela configuração do servidor: / opt / bitnami / apps / wordpress / htdocs /

1

Eu tenho o site word-press no ec2 com a imagem bitnami no arquivo de log de erro que estou recebendo um erro de snippet abaixo.

Substitui o arquivo padrão htaccess.conf pelo meu .htaccess file

agora o caminho para o arquivo .htaccess é /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/

Você pode ver abaixo minha estrutura de arquivos conf.

link

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

link

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

snippet do arquivo 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>

trecho de arquivo .htaccess, permissão de arquivo 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

snippet de permissão de pasta

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

Snippet 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>
    
por Sanjay Nakate 06.02.2015 / 09:34

3 respostas

0

Se o novo caminho do arquivo for "/ opt / bitnami / apps / wordpress / htdocs /" por que é incluído como #Include "/opt/bitnami/apps/wordpress/conf/htaccess.conf" no httpd-app ? Além disso, observe que alterar manualmente os caminhos de configuração para os temas WP / WP provavelmente fará com que eles não funcionem corretamente, já que eles usam o caminho relativo. Se você alterou o caminho de um arquivo primário, terá que alterá-lo manualmente em todos os outros arquivos que apontarem diretamente para ele. Portanto, é melhor usar um editor de texto avançado para verificar onde mais você precisa alterar o caminho para o novo arquivo.

    
por 17.02.2015 / 10:42
0

Esses 403s estão acontecendo com a versão HTTPS? Nesse caso, no httpd-vhosts.conf, replique a seção <Directory...> inteira na seção <VirtualHost *:443> . Se não, pode haver algumas restrições no arquivo .htaccess, então adicione Satisfy Any (veja link )

Se esses falharem:

  • está habilitado para php5-fpm.conf?
  • Adicione a diretiva Require all granted à sua seção <Proxy> . (veja link )
  • por favor poste seu arquivo .htaccess e o caminho para ele
  • verifique suas permissões de arquivo.
  • você poderia estar usando um arquivo .htaccess para o Apache 2.2?
  • permissões de arquivo de postagem mostradas em ls -l /opt/bitnami/apps/wordpress/htdocs
por 21.02.2015 / 16:32
0

Tente usar o arquivo http-vhosts.conf para o bloco Diretório para permitir acesso ao diretório, coloque-o em: 80 e: 443 arquivo vhost:

'' '

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

'' '

    
por 22.02.2015 / 00:52