Case Study: SSL Site Errors & Fix Process on an AWS Lightsail Bitnami Server.

Introduction:
Below is a summary of the issue, key bash commands, and steps used to identify and fix the Apache issue on a Customer's Bitnami server:

  • The issue was diagnosed by the site being down, due to an SSL failure.
  • Then the Apache server error_logs were not available.

Server Configuration:

  • AWS Lightsail, Bitnami, Drupal
  • Site had been running nonstop since Aug 2022 without issue.

Client Engagement Process:

We were contacted by the client via a contact us form message.
After a brief chat on the phone and an estimate, we agreed to work together.
After receiving credentials to access the server, we setup a terminal and sftp connection to the site, (a 15-30 minutes).

1. Check the Status of Services

First, we verified the status of Apache, MariaDB, and PHP-FPM:

sudo /opt/bitnami/ctlscript.sh status

Issue found: Apache was not running, while MariaDB and PHP-FPM were active.

 

2. Check Logs

To diagnose the issue further, we checked the logs:

Issue: The error logs were empty, which meant no direct errors were being logged by Apache.

 

3. Test Apache Configuration

We verified whether Apache’s configuration was correct:

sudo /opt/bitnami/apache2/bin/apachectl -t Result: Syntax was OK, indicating no misconfiguration.

sudo tail -n 50 /var/log/gonit.log sudo tail -n 50 /opt/bitnami/apache2/logs/error_log

 

4. Check Active Network Ports

To see if another service was using port 80 (which is required by Apache):

sudo netstat -tuln | grep ':80\|:443'

Result: Another instance of Apache (from a different package) was already using port 80.

 

5. Identify Running Apache Instances

We identified the processes using port 80:

sudo lsof -i :80

Result: It showed an Apache instance from /usr/sbin rather than the Bitnami stack.

 

6. Stop and Disable the Conflicting Apache Service

We stopped and disabled the conflicting Apache service to free up port 80 for Bitnami's Apache:

 

7. Restart Bitnami's Apache

Once the conflicting Apache service was stopped, we restarted Bitnami's Apache:

Result: Apache started successfully, and the site was accessible again.

 

8. Verify Logs After Restart

sudo systemctl stop apache2 sudo systemctl disable apache2

sudo /opt/bitnami/ctlscript.sh restart apache sudo /opt/bitnami/ctlscript.sh status

 

We confirmed that the access and error logs were being populated again:

sudo tail -n 50 /opt/bitnami/apache2/logs/access_log sudo tail -n 50 /opt/bitnami/apache2/logs/error_log


Conclusion:

This fix took us a little less than an hour to diagnose and fix, (total customer cost $75).

The issue was caused by a conflicting Apache instance using port 80. After identifying and disabling the conflicting service, we restarted the Bitnami Apache service, and the site became operational again.

We then double checked that the error logs are available.

Problem solved: The site was back up and running!  We hope this helps.  
If you need assistance please contact us.

 

Primary Category
Sub-Domain
Confidentiality
No