質問編集履歴

1

httpd\.confの内容を追記

2016/11/20 15:13

投稿

kugino
kugino

スコア11

test CHANGED
File without changes
test CHANGED
@@ -8,16 +8,6 @@
8
8
 
9
9
  ・AWSのElastic Beanstalkを使用してソースをサーバーにデプロイしています。
10
10
 
11
- ・.htaccessのファイルは、ソースのトップに配置しています。
12
-
13
- app :ディレクトリ
14
-
15
- cake :ディレクトリ
16
-
17
- .htaccess :ここにアップロード
18
-
19
-
20
-
21
11
  ・phpini()によって「mod_rewrite」が入っていることは確認しています。
22
12
 
23
13
  ・httpd.confに以下の記述はあります。
@@ -66,8 +56,6 @@
66
56
 
67
57
  とした場合は、リダイレクトしています。
68
58
 
69
- (ただし、DNSの参照元が一緒のためループが発生してしまう)
70
-
71
59
 
72
60
 
73
61
  ###補足情報(言語/FW/ツール等のバージョンなど)
@@ -79,3 +67,647 @@
79
67
 
80
68
 
81
69
  のように、条件付けのリダイレクトを行ないたいため、mod_rewriteが使える様、ご教授をお願いします。
70
+
71
+
72
+
73
+ ▼下記追記しました。
74
+
75
+ ・デプロイしたソースファイルは「var/www/html」に展開されているようです。
76
+
77
+ ・「/etc/httpd/conf/httpd.conf」の中身は下記の通りです。
78
+
79
+ ```
80
+
81
+ ServerTokens OS
82
+
83
+
84
+
85
+ ServerRoot "/etc/httpd"
86
+
87
+
88
+
89
+ PidFile run/httpd.pid
90
+
91
+
92
+
93
+ Timeout 60
94
+
95
+
96
+
97
+ KeepAlive Off
98
+
99
+
100
+
101
+ MaxKeepAliveRequests 100
102
+
103
+
104
+
105
+ KeepAliveTimeout 15
106
+
107
+
108
+
109
+ ## Server-Pool Size Regulation (MPM specific)
110
+
111
+ <IfModule prefork.c>
112
+
113
+ StartServers 8
114
+
115
+ MinSpareServers 5
116
+
117
+ MaxSpareServers 20
118
+
119
+ ServerLimit 256
120
+
121
+ MaxClients 256
122
+
123
+ MaxRequestsPerChild 4000
124
+
125
+ </IfModule>
126
+
127
+
128
+
129
+ <IfModule worker.c>
130
+
131
+ StartServers 4
132
+
133
+ MaxClients 300
134
+
135
+ MinSpareThreads 25
136
+
137
+ MaxSpareThreads 75
138
+
139
+ ThreadsPerChild 25
140
+
141
+ MaxRequestsPerChild 0
142
+
143
+ </IfModule>
144
+
145
+
146
+
147
+ Listen 80
148
+
149
+
150
+
151
+ LoadModule auth_basic_module modules/mod_auth_basic.so
152
+
153
+ LoadModule auth_digest_module modules/mod_auth_digest.so
154
+
155
+ LoadModule authn_file_module modules/mod_authn_file.so
156
+
157
+ LoadModule authn_alias_module modules/mod_authn_alias.so
158
+
159
+ LoadModule authn_anon_module modules/mod_authn_anon.so
160
+
161
+ LoadModule authn_dbm_module modules/mod_authn_dbm.so
162
+
163
+ LoadModule authn_default_module modules/mod_authn_default.so
164
+
165
+ LoadModule authz_host_module modules/mod_authz_host.so
166
+
167
+ LoadModule authz_user_module modules/mod_authz_user.so
168
+
169
+ LoadModule authz_owner_module modules/mod_authz_owner.so
170
+
171
+ LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
172
+
173
+ LoadModule authz_dbm_module modules/mod_authz_dbm.so
174
+
175
+ LoadModule authz_default_module modules/mod_authz_default.so
176
+
177
+ LoadModule ldap_module modules/mod_ldap.so
178
+
179
+ LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
180
+
181
+ LoadModule include_module modules/mod_include.so
182
+
183
+ LoadModule log_config_module modules/mod_log_config.so
184
+
185
+ LoadModule logio_module modules/mod_logio.so
186
+
187
+ LoadModule env_module modules/mod_env.so
188
+
189
+ LoadModule ext_filter_module modules/mod_ext_filter.so
190
+
191
+ LoadModule mime_magic_module modules/mod_mime_magic.so
192
+
193
+ LoadModule expires_module modules/mod_expires.so
194
+
195
+ LoadModule deflate_module modules/mod_deflate.so
196
+
197
+ LoadModule headers_module modules/mod_headers.so
198
+
199
+ LoadModule usertrack_module modules/mod_usertrack.so
200
+
201
+ LoadModule setenvif_module modules/mod_setenvif.so
202
+
203
+ LoadModule mime_module modules/mod_mime.so
204
+
205
+ LoadModule dav_module modules/mod_dav.so
206
+
207
+ LoadModule status_module modules/mod_status.so
208
+
209
+ LoadModule autoindex_module modules/mod_autoindex.so
210
+
211
+ LoadModule info_module modules/mod_info.so
212
+
213
+ LoadModule dav_fs_module modules/mod_dav_fs.so
214
+
215
+ LoadModule vhost_alias_module modules/mod_vhost_alias.so
216
+
217
+ LoadModule negotiation_module modules/mod_negotiation.so
218
+
219
+ LoadModule dir_module modules/mod_dir.so
220
+
221
+ LoadModule actions_module modules/mod_actions.so
222
+
223
+ LoadModule speling_module modules/mod_speling.so
224
+
225
+ LoadModule userdir_module modules/mod_userdir.so
226
+
227
+ LoadModule alias_module modules/mod_alias.so
228
+
229
+ LoadModule substitute_module modules/mod_substitute.so
230
+
231
+ LoadModule rewrite_module modules/mod_rewrite.so
232
+
233
+ LoadModule proxy_module modules/mod_proxy.so
234
+
235
+ LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
236
+
237
+ LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
238
+
239
+ LoadModule proxy_http_module modules/mod_proxy_http.so
240
+
241
+ LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
242
+
243
+ LoadModule proxy_connect_module modules/mod_proxy_connect.so
244
+
245
+ LoadModule cache_module modules/mod_cache.so
246
+
247
+ LoadModule suexec_module modules/mod_suexec.so
248
+
249
+ LoadModule disk_cache_module modules/mod_disk_cache.so
250
+
251
+ LoadModule cgi_module modules/mod_cgi.so
252
+
253
+ LoadModule version_module modules/mod_version.so
254
+
255
+
256
+
257
+ Include conf.d/*.conf
258
+
259
+
260
+
261
+ User ${EB_CONFIG_APP_USER}
262
+
263
+ User ${EB_CONFIG_APP_USER}
264
+
265
+
266
+
267
+ ### Section 2: 'Main' server configuration
268
+
269
+ ServerAdmin root@localhost
270
+
271
+
272
+
273
+ UseCanonicalName Off
274
+
275
+
276
+
277
+ DocumentRoot "/var/www/html/app/webroot"
278
+
279
+
280
+
281
+ <Directory />
282
+
283
+ Options FollowSymLinks
284
+
285
+ AllowOverride All
286
+
287
+ </Directory>
288
+
289
+
290
+
291
+ <Directory "/var/www/html">
292
+
293
+ Options FollowSymLinks
294
+
295
+ AllowOverride All
296
+
297
+ # Controls who can get stuff from this server.
298
+
299
+ Order allow,deny
300
+
301
+ Allow from all
302
+
303
+
304
+
305
+ </Directory>
306
+
307
+
308
+
309
+ <IfModule mod_userdir.c>
310
+
311
+ UserDir disabled
312
+
313
+ </IfModule>
314
+
315
+
316
+
317
+ DirectoryIndex index.php index.html
318
+
319
+
320
+
321
+ AccessFileName .htaccess
322
+
323
+
324
+
325
+ <Files ~ "^\.ht">
326
+
327
+ Order allow,deny
328
+
329
+ Deny from all
330
+
331
+ Satisfy All
332
+
333
+ </Files>
334
+
335
+
336
+
337
+ TypesConfig /etc/mime.types
338
+
339
+
340
+
341
+ DefaultType text/plain
342
+
343
+
344
+
345
+ <IfModule mod_mime_magic.c>
346
+
347
+ MIMEMagicFile conf/magic
348
+
349
+ </IfModule>
350
+
351
+
352
+
353
+ HostnameLookups Off
354
+
355
+
356
+
357
+ ErrorLog logs/error_log
358
+
359
+
360
+
361
+ LogLevel warn
362
+
363
+
364
+
365
+ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
366
+
367
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
368
+
369
+ LogFormat "%{Referer}i -> %U" referer
370
+
371
+ LogFormat "%{User-agent}i" agent
372
+
373
+
374
+
375
+ CustomLog logs/access_log combined
376
+
377
+
378
+
379
+ ServerSignature On
380
+
381
+
382
+
383
+ Alias /icons/ "/var/www/icons/"
384
+
385
+
386
+
387
+ <Directory "/var/www/icons">
388
+
389
+ Options Indexes MultiViews FollowSymLinks
390
+
391
+ AllowOverride All
392
+
393
+ Order allow,deny
394
+
395
+ Allow from all
396
+
397
+ </Directory>
398
+
399
+
400
+
401
+ <IfModule mod_dav_fs.c>
402
+
403
+ # Location of the WebDAV lock database.
404
+
405
+ DAVLockDB /var/lib/dav/lockdb
406
+
407
+ </IfModule>
408
+
409
+
410
+
411
+ ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
412
+
413
+
414
+
415
+ <Directory "/var/www/cgi-bin">
416
+
417
+ AllowOverride All
418
+
419
+ Options None
420
+
421
+ Order allow,deny
422
+
423
+ Allow from all
424
+
425
+ </Directory>
426
+
427
+
428
+
429
+ IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
430
+
431
+
432
+
433
+ AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
434
+
435
+
436
+
437
+ AddIconByType (TXT,/icons/text.gif) text/*
438
+
439
+ AddIconByType (IMG,/icons/image2.gif) image/*
440
+
441
+ AddIconByType (SND,/icons/sound2.gif) audio/*
442
+
443
+ AddIconByType (VID,/icons/movie.gif) video/*
444
+
445
+
446
+
447
+ AddIcon /icons/binary.gif .bin .exe
448
+
449
+ AddIcon /icons/binhex.gif .hqx
450
+
451
+ AddIcon /icons/tar.gif .tar
452
+
453
+ AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
454
+
455
+ AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
456
+
457
+ AddIcon /icons/a.gif .ps .ai .eps
458
+
459
+ AddIcon /icons/layout.gif .html .shtml .htm .pdf
460
+
461
+ AddIcon /icons/text.gif .txt
462
+
463
+ AddIcon /icons/c.gif .c
464
+
465
+ AddIcon /icons/p.gif .pl .py
466
+
467
+ AddIcon /icons/f.gif .for
468
+
469
+ AddIcon /icons/dvi.gif .dvi
470
+
471
+ AddIcon /icons/uuencoded.gif .uu
472
+
473
+ AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
474
+
475
+ AddIcon /icons/tex.gif .tex
476
+
477
+ AddIcon /icons/bomb.gif core
478
+
479
+
480
+
481
+ AddIcon /icons/back.gif ..
482
+
483
+ AddIcon /icons/hand.right.gif README
484
+
485
+ AddIcon /icons/folder.gif ^^DIRECTORY^^
486
+
487
+ AddIcon /icons/blank.gif ^^BLANKICON^^
488
+
489
+
490
+
491
+ DefaultIcon /icons/unknown.gif
492
+
493
+
494
+
495
+ ReadmeName README.html
496
+
497
+ HeaderName HEADER.html
498
+
499
+
500
+
501
+ IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
502
+
503
+
504
+
505
+ AddLanguage ca .ca
506
+
507
+ AddLanguage cs .cz .cs
508
+
509
+ AddLanguage da .dk
510
+
511
+ AddLanguage de .de
512
+
513
+ AddLanguage el .el
514
+
515
+ AddLanguage en .en
516
+
517
+ AddLanguage eo .eo
518
+
519
+ AddLanguage es .es
520
+
521
+ AddLanguage et .et
522
+
523
+ AddLanguage fr .fr
524
+
525
+ AddLanguage he .he
526
+
527
+ AddLanguage hr .hr
528
+
529
+ AddLanguage it .it
530
+
531
+ AddLanguage ja .ja
532
+
533
+ AddLanguage ko .ko
534
+
535
+ AddLanguage ltz .ltz
536
+
537
+ AddLanguage nl .nl
538
+
539
+ AddLanguage nn .nn
540
+
541
+ AddLanguage no .no
542
+
543
+ AddLanguage pl .po
544
+
545
+ AddLanguage pt .pt
546
+
547
+ AddLanguage pt-BR .pt-br
548
+
549
+ AddLanguage ru .ru
550
+
551
+ AddLanguage sv .sv
552
+
553
+ AddLanguage zh-CN .zh-cn
554
+
555
+ AddLanguage zh-TW .zh-tw
556
+
557
+
558
+
559
+ LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
560
+
561
+
562
+
563
+ ForceLanguagePriority Prefer Fallback
564
+
565
+
566
+
567
+ AddDefaultCharset UTF-8
568
+
569
+
570
+
571
+ AddType application/x-compress .Z
572
+
573
+ AddType application/x-gzip .gz .tgz
574
+
575
+
576
+
577
+ AddType application/x-x509-ca-cert .crt
578
+
579
+ AddType application/x-pkcs7-crl .crl
580
+
581
+
582
+
583
+ AddHandler type-map var
584
+
585
+
586
+
587
+ AddType text/html .shtml
588
+
589
+ AddOutputFilter INCLUDES .shtml
590
+
591
+
592
+
593
+ Alias /error/ "/var/www/error/"
594
+
595
+
596
+
597
+ <IfModule mod_negotiation.c>
598
+
599
+ <IfModule mod_include.c>
600
+
601
+ <Directory "/var/www/error">
602
+
603
+ AllowOverride All
604
+
605
+ Options IncludesNoExec
606
+
607
+ AddOutputFilter Includes html
608
+
609
+ AddHandler type-map var
610
+
611
+ Order allow,deny
612
+
613
+ Allow from all
614
+
615
+ LanguagePriority en es de fr
616
+
617
+ ForceLanguagePriority Prefer Fallback
618
+
619
+ </Directory>
620
+
621
+
622
+
623
+ </IfModule>
624
+
625
+ </IfModule>
626
+
627
+
628
+
629
+ BrowserMatch "Mozilla/2" nokeepalive
630
+
631
+ BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
632
+
633
+ BrowserMatch "RealPlayer 4\.0" force-response-1.0
634
+
635
+ BrowserMatch "Java/1\.0" force-response-1.0
636
+
637
+ BrowserMatch "JDK/1\.0" force-response-1.0
638
+
639
+
640
+
641
+ BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
642
+
643
+ BrowserMatch "MS FrontPage" redirect-carefully
644
+
645
+ BrowserMatch "^WebDrive" redirect-carefully
646
+
647
+ BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
648
+
649
+ BrowserMatch "^gnome-vfs/1.0" redirect-carefully
650
+
651
+ BrowserMatch "^XML Spy" redirect-carefully
652
+
653
+ BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
654
+
655
+
656
+
657
+ ### Section 3: Virtual Hosts
658
+
659
+
660
+
661
+ FileETag none
662
+
663
+
664
+
665
+ Header unset Server
666
+
667
+ Header unset X-Powered-By
668
+
669
+
670
+
671
+ ServerSignature Off
672
+
673
+ ServerTokens Prod
674
+
675
+
676
+
677
+ <Location /server-status>
678
+
679
+ SetHandler server-status
680
+
681
+ Order Deny,Allow
682
+
683
+ Deny from all
684
+
685
+ Allow from 127.0.0.1
686
+
687
+ </Location>
688
+
689
+
690
+
691
+ KeepAlive On
692
+
693
+
694
+
695
+ <Directory "/var/www/html">
696
+
697
+ Options FollowSymLinks
698
+
699
+ AllowOverride All
700
+
701
+ DirectoryIndex index.html index.php
702
+
703
+ Order allow,deny
704
+
705
+ Allow from all
706
+
707
+ </Directory>
708
+
709
+
710
+
711
+
712
+
713
+ ```