Search code examples
wordpressamazon-web-servicesamazon-ec2amazon-vpcbitnami

Site Unavailable on EC2 Instance (Bitnami Image)


i've installed Bitnami image (for Wordpress) on top of EC2 instance.

After stopping and again starting an instance I am getting this error when I try to access the site over browser:

ec2-<IP_address>.eu-central-1.compute.amazonaws.com refused to connect.
ERR_CONNECTION_REFUSED

My setup looks like this:

  • 1 EC2 instance
  • There is 1 VPC
  • There is 1 route table (public hosting zone)
  • There is 1 network ACL
  • There is 1 elastic IP which seems to be connected to VPC and EC2
  • There are 4 security groups all connected to that 1 VPC (3/4 groups are bitnami, 1 is default)
  • 1 internet gateway
  • 1 DHCP option set

EC2 instance has 1 elastic IP and they are associated. The same IP is seen in routing table as A record. Instance details:

  • Platform: Debian, Linux/UNIX
  • AMI name: bitnami-wordpress-6.0.1-2-r02-linux-debian-11-x86_64-hvm-ebs-nami-7d426cb7-9522-4dd7-a56b-55dd8cc1c8d0
  • AMI location: aws-marketplace/bitnami-wordpress-6.0.1-2-r02-linux-debian-11-x86_64-hvm-ebs-nami-7d426cb7-9522-4dd7-a56b-55dd8cc1c8d0
  • Both status checks for instance are marked as "passed": System reachability check passed and Instance reachability check passed

This is how resource map looks on VPC: https://prnt.sc/BC3dSA5wSfca This is how routes are configured in route table: https://prnt.sc/Qw-r186QyIHL Security groups are configured like this:

Network ACL is configured like this: inbound (https://prnt.sc/w_JufGp-1a_i), outbound (https://prnt.sc/XvBnbes0t2uS)

Regarding Bitnami - if I run this command "sudo /opt/bitnami/bndiagnostic-tool" I get the following output (excerpt):

? Resources: Found possible issues
? Connectivity: Found possible issues
✓ Mariadb: No issues found
✓ Processes: No issues found
? Wordpress: Found possible issues
? Apache: Found possible issues
✓ Php: No issues found
...
**Apache**
[Apache]
Press [Enter] to continue:
Found recent error or warning messages in the Apache error log.
[Sun Feb 26 20:59:56.709925 2023] [proxy_fcgi:error] [pid 952:tid
140329768302336] (70007)The timeout specified has expired: [client
**ip_address**:32977] AH01075: Error dispatching request to : (polling),
referer:
https://www.<my-domain-name.com>/wp-admin/admin.php?page=w3tc_dashboard&_wpnonce=521586fa3b&
w3tc_note=flush_all
 [Sun Feb 26 20:59:43.844511 2023] [proxy_fcgi:error] [pid 952:tid
140330158352128] (70007)The timeout specified has expired: [client
**ip_address**:28814] AH01075: Error dispatching request to : (polling),
referer:
https://www.<my-domain-name.com>/wp-admin/admin.php?page=w3tc_dashboard&_wpnonce=521586fa3b
 [Sun Feb 26 21:00:29.519343 2023] [proxy_fcgi:error] [pid 689:tid
140329474819840] (70007)The timeout specified has expired: [client
**ip_address**:51737] AH01075: Error dispatching request to : (polling)
...
**[Wordpress]**
Found recent WordPress plugin related error messages in the Apache error log.

[Sun Feb 26 21:00:44.149415 2023] [proxy_fcgi:error] [pid 952:tid
140330003298048] (70007)The timeout specified has expired: [client
**ip_address**:20346] AH01075: Error dispatching request to : (polling),
referer: https://www.<my-domain-name.com>/wp-admin/plugins.php?s=&plugin_status=all

Some of the videos I found on youtube suggest that running this command "sudo systemctl restart httpd" resolves the issue. I am not sure if this also applies to Bitnami. In any case, I cannot run this command with "bitnami" user and I keep getting this error "Unit httpd.service could not be found."

I can only connect to the instance using Putty and "bitnami" user. Connecting either with Putty or EC2 Instance Connect as "ec2-user" or "admin" throws this error:

Failed to connect to your instance
Error establishing SSH connection to your instance. Try again later.

I am not a cloud expert. I can't figure out if the issue is with AWS or Bitnami or both. But I wonder why is it so hard to bring the site back up since I "only" stopped and started an instance. My site is down for few days, so I'd appreciate any help. Since I am not a cloud expert I would extremely appreciate very precise, step-by-step instructions on what needs to be done to bring the site back up. If you need any additional information, please let me know and I will send the screenshots.

Thank you!


Solution

  • Check bitnami docs for start/stop services:

    Each Bitnami stack includes a control script that lets you easily stop, start and restart services.

    Obtain the status of a service:

    sudo /opt/bitnami/ctlscript.sh status

    Call it without any service name arguments to start all services:

    sudo /opt/bitnami/ctlscript.sh start

    Or use it to restart a single service, such as Apache only, by passing the service name as argument:

    sudo /opt/bitnami/ctlscript.sh restart apache

    Use this script to stop all services:

    sudo /opt/bitnami/ctlscript.sh stop

    Restart the services by running the script without any arguments:

    sudo /opt/bitnami/ctlscript.sh restart

    https://docs.bitnami.com/aws/faq/administration/control-services/