質問編集履歴
7
進展
test
CHANGED
File without changes
|
test
CHANGED
@@ -118,3 +118,8 @@
|
|
118
118
|
2022/07/30 17:31:16 [error] 8549#8549: *2 open() "/var/www/app/public/50x.html" failed (2: No such file or directory), client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock", host: "パブリックIP"
|
119
119
|
|
120
120
|
```
|
121
|
+
|
122
|
+
エラーを読んで、記事を漁っていたらLaravel側のエラー説が出てきました。
|
123
|
+
```storage/logs/laravel.log
|
124
|
+
[2022-07-31 03:02:17] local.ERROR: Target class [App\Models\post] does not exist. {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [App\\Models\\post] does not exist. at /var/www/sugi-ura/src/vendor/laravel/framework/src/Illuminate/Container/Container.php:877)
|
125
|
+
```
|
6
ごじ
test
CHANGED
File without changes
|
test
CHANGED
@@ -115,6 +115,6 @@
|
|
115
115
|
|
116
116
|
```var/log/error.log
|
117
117
|
2022/07/30 17:31:16 [crit] 8549#8549: *2 connect() to unix:/run/php-fpm/www.sock failed (2: No such file or directory) while connecting to upstream, client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "パブリックIP"
|
118
|
-
2022/07/30 17:31:16 [error] 8549#8549: *2 open() "/var/www/
|
118
|
+
2022/07/30 17:31:16 [error] 8549#8549: *2 open() "/var/www/app/public/50x.html" failed (2: No such file or directory), client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock", host: "パブリックIP"
|
119
119
|
|
120
120
|
```
|
5
新しい情報
test
CHANGED
File without changes
|
test
CHANGED
@@ -114,7 +114,7 @@
|
|
114
114
|
- `/var/www/app`で`$ chmod -R 777 bootstrap/cache`
|
115
115
|
|
116
116
|
```var/log/error.log
|
117
|
-
2022/07/30 17:1
|
118
|
-
2022/07/30 17:1
|
117
|
+
2022/07/30 17:31:16 [crit] 8549#8549: *2 connect() to unix:/run/php-fpm/www.sock failed (2: No such file or directory) while connecting to upstream, client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "パブリックIP"
|
118
|
+
2022/07/30 17:31:16 [error] 8549#8549: *2 open() "/var/www/sugi-ura/src/public/50x.html" failed (2: No such file or directory), client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock", host: "パブリックIP"
|
119
119
|
|
120
120
|
```
|
4
質問の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -104,11 +104,6 @@
|
|
104
104
|
CGroup: /system.slice/nginx.service
|
105
105
|
├─7638 nginx: master process /usr/sbin/nginx
|
106
106
|
└─7639 nginx: worker process
|
107
|
-
|
108
|
-
Jul 30 15:37:27 ip-172-31-38-234.ap-northeast-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy server...
|
109
|
-
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal nginx[7632]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
110
|
-
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal nginx[7632]: nginx: configuration file /etc/nginx/nginx.conf test is successful
|
111
|
-
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal systemd[1]: Started The nginx HTTP and reverse proxy server.
|
112
107
|
```
|
113
108
|
|
114
109
|
- `$ sudo groupadd www`
|
@@ -118,4 +113,8 @@
|
|
118
113
|
- `/var/www/app`で`$ chmod -R 777 storage`
|
119
114
|
- `/var/www/app`で`$ chmod -R 777 bootstrap/cache`
|
120
115
|
|
116
|
+
```var/log/error.log
|
117
|
+
2022/07/30 17:15:30 [crit] 8401#8401: *23 connect() to unix:/run/php-fpm/www.sock failed (2: No such file or directory) while connecting to upstream, client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "パブリックIP"
|
118
|
+
2022/07/30 17:15:30 [error] 8401#8401: *23 open() "/var/www/app/public/50x.html" failed (2: No such file or directory), client: 119.82.177.188, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock", host: "パブリックIP"
|
121
119
|
|
120
|
+
```
|
3
nginxの起動状態を確認
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,6 +92,23 @@
|
|
92
92
|
|
93
93
|
$ ls -l public/
|
94
94
|
drwxrwxrwx 5 ec2-user ec2-user 171 7月 30 13:28 public
|
95
|
+
|
96
|
+
$ sudo systemctl status nginx.service
|
97
|
+
● nginx.service - The nginx HTTP and reverse proxy server
|
98
|
+
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
|
99
|
+
Active: active (running) since Sat 2022-07-30 15:37:28 UTC; 1h 13min ago
|
100
|
+
Process: 7636 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
|
101
|
+
Process: 7632 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
|
102
|
+
Process: 7631 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
|
103
|
+
Main PID: 7638 (nginx)
|
104
|
+
CGroup: /system.slice/nginx.service
|
105
|
+
├─7638 nginx: master process /usr/sbin/nginx
|
106
|
+
└─7639 nginx: worker process
|
107
|
+
|
108
|
+
Jul 30 15:37:27 ip-172-31-38-234.ap-northeast-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy server...
|
109
|
+
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal nginx[7632]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
110
|
+
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal nginx[7632]: nginx: configuration file /etc/nginx/nginx.conf test is successful
|
111
|
+
Jul 30 15:37:28 ip-172-31-38-234.ap-northeast-1.compute.internal systemd[1]: Started The nginx HTTP and reverse proxy server.
|
95
112
|
```
|
96
113
|
|
97
114
|
- `$ sudo groupadd www`
|
2
追加依頼の対応
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,6 +86,19 @@
|
|
86
86
|
|
87
87
|
### 試したこと
|
88
88
|
|
89
|
+
```
|
89
|
-
|
90
|
+
$ ls public/
|
90
|
-
|
91
|
+
css favicon.ico images index.php js mix-manifest.json phpinfo.php robots.txt storage
|
91
92
|
|
93
|
+
$ ls -l public/
|
94
|
+
drwxrwxrwx 5 ec2-user ec2-user 171 7月 30 13:28 public
|
95
|
+
```
|
96
|
+
|
97
|
+
- `$ sudo groupadd www`
|
98
|
+
- `$ sudo usermod -a -G www ec2-user`
|
99
|
+
- `$ sudo chown -R root:www /var/www`
|
100
|
+
- `$ sudo chmod 2775 /var/www`
|
101
|
+
- `/var/www/app`で`$ chmod -R 777 storage`
|
102
|
+
- `/var/www/app`で`$ chmod -R 777 bootstrap/cache`
|
103
|
+
|
104
|
+
|
1
コマンドの記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,6 +86,6 @@
|
|
86
86
|
|
87
87
|
### 試したこと
|
88
88
|
|
89
|
-
- `/var/www/app`で`$ chmod 777
|
89
|
+
- `/var/www/app`で`$ chmod -R 777 storage`を実行
|
90
|
-
- `/var/www/app`で`$ chmod 777
|
90
|
+
- `/var/www/app`で`$ chmod -R 777 bootstrap/cache`を実行
|
91
91
|
|