Amazon Lightsail: Bitnami LAMP server website hosting: sudo service apache2 restart

4.8k views Asked by At

I am trying follow the guide here: http://www.servermom.org/how-to-add-new-site-into-your-apache-based-ubuntu-server/ to host a few PHP files on the web. Everything works until the second to last step: the command in the title. The console message I get is below:

bitnami@ip-*not important*:~$ sudo service apache2 restart
 * Restarting web server apache2        
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified do
main name, using 127.0.0.1. Set the 'ServerName' directive globally to suppres
s this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]
:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.
0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
[fail]
 * The apache2 instance did not start within 20 seconds. Please read the log f
iles to discover problems

I open the access.log and error.log files in /var/log/apache2 with nano and both appear empty. Any ideas on why "Action 'start' failed"?

Thanks in advance for any help

1

There are 1 answers

1
Jamie Starke On

Bitnami puts the systems under it's control into a non-standard location. They can be found under /opt/bitnami. I'd recommend checking out their Documenation on the configuration of Apache.

Common differences:

  • Configuration is stored in /opt/bitnami/apps/myapp/conf/
  • Base folders like /var/www are application specific like /opt/bitnami/apps/<app_name>/htdocs/, where is the name of your app.
  • Restarting Apache can be done with sudo /opt/bitnami/ctlscript.sh restart apache
  • Access and Error logs can be found at /opt/bitnami/apache2/logs/access_log and /opt/bitnami/apache2/logs/error_log respectively

Hope that helps get you in the right direction.