Bitnami WordPress on AWS: I unable to restart Apache

[IMPORTANT, please fill the questions]

Application name and version:
WordPress. The latest version
Is it an installer, cloud image or virtual machine?: 
AWS
Operative system/Platform (Linux, Windows, OSX)(x86/x64):
OSX
Was it installed as the root user?
Is there anything you’ve done and/or tried with the application before posting here?
E.g. changed permissions or installed a plugin:

I tried to restart apache and got this message:
bitnami@ip-172-31-55-232:/opt/bitnami/mysql/bin$ sudo /opt/bitnami/ctlscript.sh restart apache
Unmonitored apache
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : apache not running
Syntax OK
(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
/opt/bitnami/apache2/scripts/ctl.sh : httpd could not be started
Monitored apache

After that I used this command:
netstat -lnp | grep :80

And i got next message:
tcp6 0 0 :::80 :::* LISTEN 2439/httpd.bin

Solution: It seems there is a service using this port. You could kill it by executing:

sudo kill -9 $(sudo lsof -t -i:80)

Then, try to start Apache again.

What i did:
bitnami@ip-172-31-55-232:~$ sudo kill -9 $(sudo lsof -t -i:80)
bitnami@ip-172-31-55-232:~$ sudo /opt/bitnami/ctlscript.sh restart apache
Unmonitored apache
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : apache not running
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
Monitored apache
bitnami@ip-172-31-55-232:~$ sudo /opt/bitnami/ctlscript.sh restart apache
Unmonitored apache
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd stopped
Syntax OK
/opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
Monitored apache

Yes, the server is running properly now.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.