前提・実現したいこと
railsで、デプロイ をしてるのですが、nginxの起動で下記を実行するとエラーが出てしまいます。
$ sudo service nginx start
発生している問題・エラーメッセージ
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 Mon 2021-01-11 07:05:20 UTC; 7min ago Process: 27782 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE) Process: 27766 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy server... Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal nginx[27782]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal nginx[27782]: nginx: [emerg] open() "/var/www/buggage-mgt/log/nginx.error.log" failed (2: No such file or directory) Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal nginx[27782]: nginx: configuration file /etc/nginx/nginx.conf test failed Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal systemd[1]: nginx.service: control process exited, code=exited status=1 Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal systemd[1]: Failed to start The nginx HTTP and reverse proxy server. Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal systemd[1]: Unit nginx.service entered failed state. Jan 11 07:05:20 ip-172-31-40-146.ap-northeast-1.compute.internal systemd[1]: nginx.service failed.
nginx -tで確認したものが下記です.
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2021/01/11 07:14:31 [warn] 27883#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2021/01/11 07:14:31 [emerg] 27883#0: open() "/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed
nginx.error.logは、存在しなかったので、作成してみましたが、変わらなかったです。
その他、気になる箇所があれば、ご教授願いたいです。
よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/01/11 09:33
2021/01/23 03:00 編集