問題
本番環境でアプリケーションをデプロイしようとしている途中。
Nginxを起動できない。
エラー
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
[アプリケーションのディレクトリ]$ systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 水 2020-09-30 06:32:13 UTC; 9s ago
Process: 31655 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 31652 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 31651 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
解決手順
Apatcheを停止したら
/ディレクトリで
$ sudo apachectl stop
Nginxを起動できました🎉
sudo service nginx start
ApatcheとNginxは競合してはいけないんですね。