Why does my webpage on a Bitnami-hosted Lightsail instance load the Apache default page instead of my website after an instance stop and start or reboot?

2 minute read
0

I restarted my Bitnami-hosted Amazon Lightsail instance, and now my website loads the Apache default page instead of my website.

Short description

Bitnami-hosted instances have their own web service, such as Apache and NGINX, preconfigured inside their stack on port 80. If you install the Apache2 package, then the new Apache2 service starts first after an instance reboot or stop and start. Also, the Apache2 package might be installed as a dependency when you install packages, such as python-certbot-apache.

Because the new Apache2 starts automatically and listens on port 80, the Apache that Bitmani provides can't start and listen on that port. Because the port is in use, the website loads the default Apache page from /var/www/html/index.html

Resolution

To make sure that the Bitmani Apache starts after you stop, start, or reboot an instance, complete the following steps:

  1. Run the following commands to stop the Apache2 service:

    sudo systemctl stop apache2
    sudo pkill -f apache
  2. Run the following command to start Bitnami's Apache service:

    sudo /opt/bitnami/ctlscript.sh restart
  3. Run the following command so that the Apache2 service doesn't start on boot:

    sudo systemctl disable apache2
AWS OFFICIAL
AWS OFFICIALUpdated 3 months ago