ERR_CONNECTION_REFUSED error when accessing Lightsail Wordpress instance

Type: Bitnami Support Tool

Description:
Hi

Im getting the following when trying to view my website:

This site can’t be reachedbioskoop.co took too long to respond.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_TIMED_OUT

The Bitnami diagnostic tool stated the following:

[Connectivity]

Server ports 22, 80 and/or 443 are not publicly accessible. Please check the
following guide to open server ports for remote access:

https://docs.bitnami.com/general/faq/administration/use-firewall/

Yet the HTTP (80) and HTTPS (443) ports are open according to the Lightsail UX.

Could you please assist?

Bitnami ticket no: 21da380e-1947-890a-4d5f-301c925abd52

Hi @Bioskoop,

The Bitnami Diagnostic Tool showed you the real error of the application


The Apache configuration has errors:

httpd.bin: Syntax error on line 563 of /opt/bitnami/apache2/conf/httpd.conf: Syntax error on line 26 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf: Syntax error on line 2 of /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf: Syntax error on line 11 of /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf: Syntax error on line 42 of /opt/bitnami/apps/wordpress/conf/httpd-app.conf: Syntax error on line 48 of /opt/bitnami/apps/wordpress/conf/htaccess.conf: Expected </FilesMatch> but saw </IfModule>

Please fix that error in the htaccess.conf file and ensure Apache is running by running this command

sudo /opt/bitnami/ctlscript.sh status

Happy to help!


Was my answer helpful? Click on :heart:

Hi @jota Apache seems to not be running.

I got this result when running the above command:
php-fpm already running
apache not running
mysql already running

Thanks for helping.

I also tried this command:

sudo /opt/bitnami/ctlscript.sh start
/opt/bitnami/mysql/scripts/ctl.sh : mysql (pid 3411) already running
/opt/bitnami/php/scripts/ctl.sh : php-fpm (pid 3468) already running
httpd.bin: Syntax error on line 563 of /opt/bitnami/apache2/conf/httpd.conf: Syntax error o
n line 26 of /opt/bitnami/apache2/conf/bitnami/bitnami.conf: Syntax error on line 2 of /opt
/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf: Syntax error on line 11 of /opt/bit
nami/apps/wordpress/conf/httpd-prefix.conf: Syntax error on line 42 of /opt/bitnami/apps/wo
rdpress/conf/httpd-app.conf: Syntax error on line 48 of /opt/bitnami/apps/wordpress/conf/ht
access.conf: Expected but saw
apache config test fails, aborting

<Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/akismet">
# Only allow direct access to specific Web-available files.

# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>

<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>

# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>

<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
</Directory>

# BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.15]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL

<FilesMatch "\.(ttf|otf|eot|woff)$"> <IfModule mod_headers.c> Header set
Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

Hi @Bioskoop,

I think you simply need to split the “FilesMatch” line in multiple ones. Try with this code:

<FilesMatch "\.(ttf|otf|eot|woff)$"> 
<IfModule mod_headers.c> 
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Thanks a ton @jota
It worked.

1 Like

Great!! :tada:

Enjoy :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.