質問編集履歴

2

補足

2020/11/11 14:17

投稿

kavvano
kavvano

スコア47

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- Nginxを起動させたいです。
5
+ Railsアプリを動かすために、Nginxを起動させたいです。
6
6
 
7
7
  設定の記述等は完了しています。
8
8
 

1

文字が消えていた

2020/11/11 14:17

投稿

kavvano
kavvano

スコア47

test CHANGED
File without changes
test CHANGED
@@ -2,31 +2,25 @@
2
2
 
3
3
 
4
4
 
5
- Nginxを起動させたい
5
+ Nginxを起動させたいです。
6
+
7
+ 設定の記述等は完了しています。
6
8
 
7
9
 
8
10
 
9
11
  ### 発生している問題・エラーメッセージ
10
12
 
11
- `sudo systemctl start nginx`で、Nginxを起動させようとしているが以下が表示され起動できない。
13
+ `sudo systemctl start nginx`で、Nginxを起動させようとしているが以下が表示され起動できない。
12
14
 
13
15
  ```
14
16
 
15
17
  Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
16
18
 
19
+
20
+
17
- ```
21
+ *****<翻訳>*****
18
22
 
19
23
  制御プロセスがエラーコードで終了したため、nginx.serviceのジョブが失敗しました。 詳細については、「systemctlstatusnginx.service」および「journalctl-xe」を参照してください。
20
-
21
-
22
-
23
- ### 該当のソースコード
24
-
25
-
26
-
27
- ```ここに言語名を入力
28
-
29
- ソースコード
30
24
 
31
25
  ```
32
26
 
@@ -34,7 +28,51 @@
34
28
 
35
29
  ### 試したこと
36
30
 
31
+ ①`systemctlstatusnginx.service`を実行し、内容を確認
32
+
33
+ ```
34
+
35
+ ● nginx.service - The nginx HTTP and reverse proxy server
36
+
37
+ Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
38
+
39
+ Active: failed (Result: exit-code) since 水 2020-11-11 13:28:43 UTC; 4min 59s ago
40
+
41
+ Process: 16766 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
42
+
43
+ Process: 16763 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
44
+
45
+ Process: 16762 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
46
+
47
+
48
+
49
+ 11月 11 13:28:41 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
50
+
51
+ 11月 11 13:28:42 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
52
+
53
+ 11月 11 13:28:42 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
54
+
55
+ 11月 11 13:28:42 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
56
+
57
+ 11月 11 13:28:42 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
58
+
59
+ 11月 11 13:28:43 ip-10-0-10-10.ap-northeast-1.compute.internal nginx[16766]: nginx: [emerg] still could not bind()
60
+
61
+ 11月 11 13:28:43 ip-10-0-10-10.ap-northeast-1.compute.internal systemd[1]: nginx.service: control process exited, code=exited status=1
62
+
63
+ 11月 11 13:28:43 ip-10-0-10-10.ap-northeast-1.compute.internal systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
64
+
65
+ 11月 11 13:28:43 ip-10-0-10-10.ap-northeast-1.compute.internal systemd[1]: Unit nginx.service entered failed state.
66
+
67
+ 11月 11 13:28:43 ip-10-0-10-10.ap-northeast-1.compute.internal systemd[1]: nginx.service failed.
68
+
69
+ ```
70
+
71
+ 赤字だった14行目の"Failed to start The nginx HTTP and reverse proxy server."について調べたら、`nginx -t`をやってみると良いようだったので、そちらを実行。
72
+
73
+
74
+
37
- `nginx -t`
75
+ `nginx -t`でエラー内容の確認を実施
38
76
 
39
77
  ```
40
78
 
@@ -48,11 +86,13 @@
48
86
 
49
87
  nginx: configuration file /etc/nginx/nginx.conf test failed
50
88
 
89
+
90
+
51
- ```
91
+ **********<翻訳>**********
52
92
 
53
93
  nginx:[アラート]はエラーログファイルを開くことができませんでした:open() "/var/log/nginx/error.log"が失敗しました(13:アクセスが拒否されました)
54
94
 
55
- 2020/11/11 13:35:07 [警告] 16792#0:「user」ディレクティブは、マスタープロセスがスーパーユーザー権限で実行されている場合にのみ意味があり、/ etc / nginx / nginx.conf:5では無視されます
95
+ 2020/11/11 13:35:07 [警告] 16792#0:「user」ディレクティブは、マスタープロセスがスーパーユーザー権限で実行されている場合にのみ意味があり、/etc/nginx/nginx.conf:5では無視されます
56
96
 
57
97
  nginx:構成ファイル/etc/nginx/nginx.conf構文は問題ありません
58
98
 
@@ -60,8 +100,38 @@
60
100
 
61
101
  nginx:構成ファイル/etc/nginx/nginx.confテストが失敗しました
62
102
 
63
- ### 補足情報(FW/ツールのバージョンなど)
103
+ ```
64
104
 
65
105
 
66
106
 
107
+ ③上のエラー内容より、"/var/log/nginx/error.log"と"/run/nginx.pid"はとりあえず権限を"777"へ変更しています。
108
+
109
+ "/etc/nginx/nginx.conf"は何が問題なのかわかりません。5行目は、"user nginx;"ですが何が問題なのでしょうか?
110
+
111
+ ```
112
+
113
+ </etc/nginx/nginx.conf>
114
+
115
+ # For more information on configuration, see:
116
+
117
+ # * Official English Documentation: http://nginx.org/en/docs/
118
+
119
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
120
+
121
+
122
+
123
+ user nginx;
124
+
125
+ worker_processes auto;
126
+
127
+ error_log /var/log/nginx/error.log;
128
+
129
+ pid /run/nginx.pid;
130
+
131
+ 〜省略〜
132
+
133
+ ```
134
+
67
- ここにり詳細な情報記載ださい。
135
+ ければご回答よろしくお願いたします
136
+
137
+ こんなことやってみればとか、自分はちょっと違うけどこんなことありました的な内容でも構いませんのでお願いいたします。