Sanjay Nakate
Sanjay Nakate

Reputation: 2088

client denied by server configuration: /opt/bitnami/apps/wordpress/htdocs/

I have word-press website on ec2 with bitnami image in error log file i am getting bellow snippet error.

I have overwrite default htaccess.conf file with my .htaccess file

now the the path for .htaccess file is /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/

You can see bellow my conf file structure.

httpd-vhosts.conf file snippet

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

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

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

Upvotes: 3

Views: 3747

Answers (1)

Ravi K Thapliyal
Ravi K Thapliyal

Reputation: 51711

You're probably trying to connect to your local setup over SSL because the error log says

localhost:443:0 server certificate does NOT include an ID which matches the server name

But, your SSL certificate file

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

has probably been created authenticating example.com only. So, while this SSL setup probably works online, it would fail when accessed over localhost because the browser knows that the local server isn't example.com.

To workaround this problem, you can override a DNS lookup request for example.com by mapping it to localhost in your /etc/hosts file.

127.0.0.1    example.com
127.0.0.1    www.example.com

This allows you to connect to your local setup while still making your browser believe it's on example.com when clearly it's not. The SSL handshake should succeed now as the browser would't reject the server certificate this time.

Upvotes: 3

Related Questions