質問編集履歴
1
不足情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
+
### 実現したいこと
|
2
|
+
|
3
|
+
app2を表示させたいです。
|
4
|
+
|
5
|
+
※ app1は表示されます。
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
### 現状出ているエラー
|
12
|
+
|
1
13
|
マルチドメイン設定を行っている片方のドメインがうまく表示されません。
|
2
14
|
|
3
15
|
nginxなどのルーティング設定が怪しいと考え、nginx -tコマンドを実行したところ、エラーが出てしまいました。
|
4
16
|
|
5
17
|
|
6
18
|
|
19
|
+
|
20
|
+
|
7
21
|
```ここに言語を入力
|
8
22
|
|
9
23
|
$ nginx -t
|
@@ -34,13 +48,15 @@
|
|
34
48
|
|
35
49
|
```
|
36
50
|
|
37
|
-
|
38
|
-
|
39
51
|
### 試したこと
|
40
52
|
|
41
|
-
1.リブート
|
53
|
+
##### 1.リブート
|
54
|
+
|
42
|
-
|
55
|
+
##### 2.```/var/www/html/nuriemon/public/index.html``` に「OK」と記載したファイルを追加
|
56
|
+
|
57
|
+
問題なく表示されました。
|
58
|
+
|
43
|
-
|
59
|
+
##### 3.全てに;を追加した
|
44
60
|
|
45
61
|
※ 以下のエラーに変わった
|
46
62
|
|
@@ -54,4 +70,436 @@
|
|
54
70
|
|
55
71
|
|
56
72
|
|
73
|
+
### その他情報
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
$ /usr/lib/systemd/system/httpd.service
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
[Unit]
|
82
|
+
|
83
|
+
Description=The Apache HTTP Server
|
84
|
+
|
85
|
+
Wants=httpd-init.service
|
86
|
+
|
87
|
+
After=network.target remote-fs.target nss-lookup.target httpd-init.service
|
88
|
+
|
89
|
+
Documentation=man:httpd.service(8)
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
[Service]
|
94
|
+
|
95
|
+
Type=notify
|
96
|
+
|
97
|
+
Environment=LANG=C
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
|
102
|
+
|
103
|
+
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
|
104
|
+
|
105
|
+
# Send SIGWINCH for graceful stop
|
106
|
+
|
107
|
+
KillSignal=SIGWINCH
|
108
|
+
|
109
|
+
KillMode=mixed
|
110
|
+
|
111
|
+
PrivateTmp=true
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
[Install]
|
116
|
+
|
117
|
+
WantedBy=multi-user.target
|
118
|
+
|
119
|
+
```
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
$ vi /etc/nginx/nginx.conf
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
user nginx;
|
128
|
+
|
129
|
+
worker_processes auto;
|
130
|
+
|
131
|
+
error_log /var/log/nginx/error.log;
|
132
|
+
|
133
|
+
pid /run/nginx.pid;
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
138
|
+
|
139
|
+
include /usr/share/nginx/modules/*.conf;
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
events {
|
144
|
+
|
145
|
+
worker_connections 1024;
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
http {
|
152
|
+
|
153
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
154
|
+
|
155
|
+
'$status $body_bytes_sent "$http_referer" '
|
156
|
+
|
157
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
access_log /var/log/nginx/access.log main;
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
sendfile on;
|
166
|
+
|
167
|
+
tcp_nopush on;
|
168
|
+
|
169
|
+
tcp_nodelay on;
|
170
|
+
|
171
|
+
keepalive_timeout 65;
|
172
|
+
|
173
|
+
types_hash_max_size 2048;
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
include /etc/nginx/mime.types;
|
178
|
+
|
179
|
+
default_type application/octet-stream;
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
# Load modular configuration files from the /etc/nginx/conf.d directory.
|
184
|
+
|
185
|
+
# See http://nginx.org/en/docs/ngx_core_module.html#include
|
186
|
+
|
187
|
+
# for more information.
|
188
|
+
|
189
|
+
include /etc/nginx/conf.d/*.conf;
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
server {
|
194
|
+
|
195
|
+
listen 80 default_server;
|
196
|
+
|
197
|
+
listen [::]:80 default_server;
|
198
|
+
|
199
|
+
server_name _;
|
200
|
+
|
201
|
+
root /usr/share/nginx/html;
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
# Load configuration files for the default server block.
|
206
|
+
|
207
|
+
include /etc/nginx/default.d/*.conf;
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
location / {
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
error_page 404 /404.html;
|
218
|
+
|
219
|
+
location = /40x.html {
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
error_page 500 502 503 504 /50x.html;
|
226
|
+
|
227
|
+
location = /50x.html {
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
}
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
```
|
236
|
+
|
237
|
+
```
|
238
|
+
|
239
|
+
$ vi /etc/nginx/default.d/php.conf
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
index index.php index.html index.htm;
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
location ~ .php$ {
|
248
|
+
|
249
|
+
try_files $uri =404;
|
250
|
+
|
251
|
+
fastcgi_intercept_errors on;
|
252
|
+
|
253
|
+
fastcgi_index index.php;
|
254
|
+
|
255
|
+
include fastcgi_params;
|
256
|
+
|
257
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
258
|
+
|
259
|
+
fastcgi_pass php-fpm;
|
260
|
+
|
261
|
+
}
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
```
|
266
|
+
|
267
|
+
```
|
268
|
+
|
269
|
+
$ vi /etc/httpd/conf/httpd.conf
|
270
|
+
|
271
|
+
※ コメントアウトの箇所は記載しておりません。
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
ServerRoot "/etc/httpd"
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
Listen 80
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
<VirtualHost *:80>
|
286
|
+
|
287
|
+
#ServerAdmin root@app1.com
|
288
|
+
|
289
|
+
DocumentRoot /var/www/html/ZOTMAN/public
|
290
|
+
|
291
|
+
ServerName app1.com
|
292
|
+
|
293
|
+
#RewriteEngine on
|
294
|
+
|
295
|
+
#RewriteCond %{SERVER_NAME} =app1.com
|
296
|
+
|
297
|
+
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
298
|
+
|
299
|
+
RewriteEngine on
|
300
|
+
|
301
|
+
RewriteCond %{SERVER_NAME} =app1.com
|
302
|
+
|
303
|
+
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
304
|
+
|
305
|
+
</VirtualHost>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<VirtualHost *:80>
|
310
|
+
|
311
|
+
#ServerAdmin root@app2.com
|
312
|
+
|
313
|
+
DocumentRoot /var/www/html/app2/public
|
314
|
+
|
315
|
+
ServerName app2.com
|
316
|
+
|
317
|
+
#RewriteEngine on
|
318
|
+
|
319
|
+
#RewriteCond %{SERVER_NAME} =app1.com
|
320
|
+
|
321
|
+
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
322
|
+
|
323
|
+
RewriteEngine on
|
324
|
+
|
325
|
+
RewriteCond %{SERVER_NAME} =app2.com
|
326
|
+
|
327
|
+
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
328
|
+
|
329
|
+
</VirtualHost>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
Include conf.modules.d/*.conf
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
User apache
|
338
|
+
|
339
|
+
Group apache
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
ServerAdmin root@app1.com
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
ServerName app1.com
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<Directory />
|
352
|
+
|
353
|
+
AllowOverride All
|
354
|
+
|
355
|
+
Require all denied
|
356
|
+
|
357
|
+
</Directory>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
DocumentRoot "/var/www/html"
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<Directory "/var/www">
|
366
|
+
|
367
|
+
AllowOverride All
|
368
|
+
|
369
|
+
# Allow open access:
|
370
|
+
|
371
|
+
Require all granted
|
372
|
+
|
373
|
+
</Directory>
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
<Directory "/var/www/html">
|
378
|
+
|
379
|
+
Options Indexes FollowSymLinks
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
AllowOverride All
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
Require all granted
|
388
|
+
|
389
|
+
</Directory>
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
<IfModule dir_module>
|
394
|
+
|
395
|
+
DirectoryIndex index.html
|
396
|
+
|
397
|
+
</IfModule>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
<Files ".ht*">
|
402
|
+
|
403
|
+
Require all denied
|
404
|
+
|
405
|
+
</Files>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
ErrorLog "logs/error_log"
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
LogLevel warn
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
<IfModule log_config_module>
|
418
|
+
|
419
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
420
|
+
|
421
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
<IfModule logio_module>
|
426
|
+
|
427
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
|
428
|
+
|
429
|
+
</IfModule>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
CustomLog "logs/access_log" combined
|
434
|
+
|
435
|
+
</IfModule>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
<IfModule alias_module>
|
440
|
+
|
441
|
+
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
</IfModule>
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
<Directory "/var/www/cgi-bin">
|
450
|
+
|
451
|
+
AllowOverride None
|
452
|
+
|
453
|
+
Options None
|
454
|
+
|
455
|
+
Require all granted
|
456
|
+
|
457
|
+
</Directory>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
<IfModule mime_module>
|
462
|
+
|
463
|
+
TypesConfig /etc/mime.types
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
AddType application/x-compress .Z
|
468
|
+
|
469
|
+
AddType application/x-gzip .gz .tgz
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
AddType text/html .shtml
|
474
|
+
|
475
|
+
AddOutputFilter INCLUDES .shtml
|
476
|
+
|
477
|
+
</IfModule>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
AddDefaultCharset UTF-8
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
<IfModule mime_magic_module>
|
486
|
+
|
487
|
+
MIMEMagicFile conf/magic
|
488
|
+
|
489
|
+
</IfModule>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
EnableSendfile on
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
IncludeOptional conf.d/*.conf
|
498
|
+
|
499
|
+
Include /etc/httpd/conf/httpd-le-ssl.conf
|
500
|
+
|
501
|
+
~
|
502
|
+
|
503
|
+
```
|
504
|
+
|
57
505
|
お力添えいただけると幸いです。
|