sudo /opt/bitnami/ctlscript.sh start
/opt/bitnami/mysql/scripts/ctl.sh : mysql started at port 3306
/opt/bitnami/php/scripts/ctl.sh : php-fpm started
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] still could not bind()
【原因】
80ポートが怪しそうなので以下のコマンドで使用状況を確認してみる
80ポートをApache2がすでに使用しているためNginxが起動できなくなっていた。
sudo lsof -i:80
google_ne 809 root 7u IPv4 931409 0t0 TCP xxxxx->metadata.google.internal:http (ESTABLISHED)
google_ac 811 root 5u IPv4 931326 0t0 TCP xxxxx->metadata.google.internal:http (ESTABLISHED)
google_cl 814 root 5u IPv4 931061 0t0 TCP xxxxx->metadata.google.internal:http (CLOSE_WAIT)
google_cl 814 root 6u IPv4 931309 0t0 TCP xxxxx->metadata.google.internal:http (ESTABLISHED)
apache2 18458 root 4u IPv6 930680 0t0 TCP *:http (LISTEN)
apache2 18459 www-data 4u IPv6 930680 0t0 TCP *:http (LISTEN)
apache2 18460 www-data 4u IPv6 930680 0t0 TCP *:http (LISTEN)
【解決方法】
Apache2を停止しNginxを起動する。
sudo service apache2 stop
sudo /opt/bitnami/ctlscript.sh restart