teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

誤字

2018/07/31 12:39

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -23,8 +23,8 @@
23
23
  systemctl stop httpd
24
24
  アクセス拒否確認
25
25
  systemctl start httpd
26
- アクセス可の確認してみた
26
+ アクセス可の確認してみた
27
- 変わらずの
27
+ しかし、変わらずの
28
28
  html/index.htmlの内容が出て来る。本来ならこれで変更が可能だったと思いますが違いますか???
29
29
  ーーーーーーーーーーーーーーーーーーーーーー
30
30
  次ぎも以下のように変更してみた

4

log追加

2018/07/31 12:39

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -94,5 +94,15 @@
94
94
  ErrorDocument 403 /.noindex.html
95
95
  </LocationMatch>
96
96
  をコメントアウトした時のログだと思われます
97
+ 31のerrorログ内容(welcom.confコメントアウト後)
98
+ e Jul 31 21:21:00.760963 2018] [mpm_prefork:notice] [pid 1918] AH00170: caught SIGWINCH, shutting down gracefully
99
+ [Tue Jul 31 21:21:02.727741 2018] [core:notice] [pid 1945] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
100
+ [Tue Jul 31 21:21:02.729456 2018] [suexec:notice] [pid 1945] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
101
+ [Tue Jul 31 21:21:02.785191 2018] [auth_digest:notice] [pid 1945] AH01757: generating secret for digest authentication ...
102
+ [Tue Jul 31 21:21:02.786424 2018] [lbmethod_heartbeat:notice] [pid 1945] AH02282: No slotmem from mod_heartmonitor
103
+ [Tue Jul 31 21:21:02.821366 2018] [mpm_prefork:notice] [pid 1945] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16 configured -- resuming normal operations
104
+ [Tue Jul 31 21:21:02.821433 2018] [core:notice] [pid 1945] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
105
+ [Tue Jul 31 21:21:08.939653 2018] [authz_core:error] [pid 1946] [client 192.168.100.167:49336] AH01630: client denied by server configuration: /var/www/html/
97
106
 
107
+
98
108
  -------------------------------------------------

3

読み易くしました

2018/07/31 12:28

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -12,6 +12,7 @@
12
12
  Options Indexes FollowSumLinks
13
13
  .......
14
14
  </Directory>
15
+
15
16
  ---------------------------------
16
17
  を次のように変更
17
18
  DocumentRoot "/var/www/wp"
@@ -50,6 +51,7 @@
50
51
  ディレクトリ修正
51
52
  <Directory "/var/www/wp">
52
53
  その他詳細に記入
54
+
53
55
  ------------------------------------------
54
56
  試してみたこと確認したこと
55
57
  1
@@ -78,6 +80,7 @@
78
80
  www/htmlと同じようにしてみた
79
81
  drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 html
80
82
  drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 wp
83
+
81
84
  ------------------------------
82
85
  追加事項
83
86
  デフォルト設定での動作確認OK
@@ -91,4 +94,5 @@
91
94
  ErrorDocument 403 /.noindex.html
92
95
  </LocationMatch>
93
96
  をコメントアウトした時のログだと思われます
97
+
94
98
  -------------------------------------------------

2

誤字修正、試してみたことの追加

2018/07/31 12:25

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -6,22 +6,27 @@
6
6
 
7
7
 
8
8
  httpd.confの内容(デフォルト)
9
- DocumentRoot "/var/www/html
9
+ DocumentRoot "/var/www/html">
10
- <Directory "/var/www>
10
+ <Directory "/var/www">
11
11
  <Directory "/var/www/html">
12
12
  Options Indexes FollowSumLinks
13
13
  .......
14
14
  </Directory>
15
15
  ---------------------------------
16
16
  を次のように変更
17
- DocumentRoot "/var/www/wp
17
+ DocumentRoot "/var/www/wp"
18
- <Directory "/var/wp>
18
+ <Directory "/var/www/wp">
19
19
  apache再起動後(stop&startも実行してみる)
20
- 結果
21
- /var/www/html/index.htmlが表示される。
20
+ /var/www/html/index.htmlの内容が表示される。
21
+ 再起動ができていないのかと疑ってみて
22
+ systemctl stop httpd
23
+ アクセス拒否確認
24
+ systemctl start httpd
25
+ アクセス可の確認としてみた
26
+ 変わらずの
22
- 本来ならこれで変更が可能だったと思いますが違いますか???
27
+ html/index.htmlの内容が出て来る。本来ならこれで変更が可能だったと思いますが違いますか???
23
28
  ーーーーーーーーーーーーーーーーーーーーーー
24
- 次ぎも以下のように変更
29
+ 次ぎも以下のように変更してみた
25
30
  <Directory "/var/www/wp">
26
31
  Options Indexes FollowSumLinks
27
32
  .......
@@ -31,4 +36,59 @@
31
36
  testing 123には
32
37
  You should add your website content to the directory /var/www/html/
33
38
  と表記されています.....
39
+ つまりパスは/var/www/htmlを読み込んでいるのではないのかと思ったため
40
+ httpd.confの他に何があるのかを見てみる
41
+ httpd.conf httpd.conf.org httpd.confwp magic
42
+ となっている
43
+ 未だに解決が出来ず......
44
+
45
+ ーーーーーーーーー質問の修正内容、追加内容ーーーーーーーーーーーーーーーーーーーーーーーー
46
+ 試してみたことが記入されていなかったり誤字があったことお詫びいたします。
47
+ 質問修正内容
48
+ "の追加
49
+ DocumentRoot "/var/www/wp"
50
+ ディレクトリ修正
51
+ <Directory "/var/www/wp">
52
+ その他詳細に記入
53
+ ------------------------------------------
54
+ 試してみたこと確認したこと
55
+ 1
56
+ SElinuxの一時停止
57
+ setenforce 0
58
+ permissiveに変更
59
+ 2
60
+ SElinuxの停止
61
+ vi /etc/selinux/config
62
+ SELINUX=enforcing
63
+ 再起動(reboot)
64
+ 3
65
+ chownで所有者変更
66
+ htmlがapache:apacheとなっていたため同じように変更
67
+ wp/index.htmlも同じように変更
68
+ lsで確認
69
+ drwxr-xr-x. 2 apache apache 40 7月 29 08:35 html
70
+ drwxr-xr-x. 2 apache apache 24 7月 29 08:35 wp
71
+ -rwxrwxrwx. 1 apache apache 43 7月 29 08:35 index.html
72
+ 4chmod権限変更
73
+ 取り敢えず777にしてみた
74
+ ls結果
75
+ -rwxrwxrwx. 1 apache apache 43 7月 29 08:35 index.html
76
+ 5
77
+ chconでセキュリティコンテキスト変更
78
+ www/htmlと同じようにしてみた
79
+ drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 html
80
+ drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 wp
81
+ ------------------------------
82
+ 追加事項
83
+ デフォルト設定での動作確認OK
84
+ 29日のログ
85
+ error_log-20180729ファイル
86
+ [authz_core:error] [pid 2004] [client 192.168.100.167:40694] AH01630: client denied by server configuration: /var/www/html/
87
+ これは
88
+ welcom.confの
89
+ LocationMatch "^/+$">
90
+ Options -Indexes
91
+ ErrorDocument 403 /.noindex.html
92
+ </LocationMatch>
34
- 助けて下さいよろくお願いします
93
+ をコメントアウトた時のログだと思われます
94
+ -------------------------------------------------

1

質問内容の変更

2018/07/31 12:23

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- CentOS7 apache2.4のDocumentRoot変更
1
+ CentOS7 apache2.4 index.html場所の変更
body CHANGED
@@ -1,43 +1,34 @@
1
- 403Forbidden
2
- You don't have permission to access / on this server.にハマってしまいました。
3
- apache testing 123表示は削除済みです
1
+ Documentrootの変更ががうまくいきません
2
+ やりたいことindex.htmlファイルの読み込み場所を変更したい
3
+ var/www/html/index.html
4
+
5
+ var/www/wp/index.htmlに変更したい
6
+
7
+
4
- apacheのhttpd.confファイル中身デフォルト設定の以下3つ
8
+ httpd.confの内容(デフォルト
5
9
  DocumentRoot "/var/www/html
6
- <Directory "/var/www/>
10
+ <Directory "/var/www>
7
11
  <Directory "/var/www/html">
8
12
  Options Indexes FollowSumLinks
9
13
  .......
10
14
  </Directory>
15
+ ---------------------------------
11
- のパスを次のように変更
16
+ を次のように変更
12
17
  DocumentRoot "/var/www/wp
13
- <Directory "/var/www/wp>
18
+ <Directory "/var/wp>
19
+ apache再起動後(stop&startも実行してみる)
20
+ 結果
21
+ /var/www/html/index.htmlが表示される。
22
+ 本来ならこれで変更が可能だったと思いますが違いますか???
23
+ ーーーーーーーーーーーーーーーーーーーーーー
24
+ 次ぎも以下のように変更
14
25
  <Directory "/var/www/wp">
15
- Options Indexes F.......
26
+ Options Indexes FollowSumLinks
27
+ .......
16
28
  </Directory>
17
- -----------------------------------------------------
18
- ためして見たこと
19
- 1 デフォルト設定の動作確認
20
- パスをデフォルトの/var/www/htmlに変更
21
- 起動:O
29
+ すると
22
-
23
- 2 SElinuxの停止、一時停止
30
+ testing 123ページが表示されます
24
- setenforce 0
31
+ testing 123には
32
+ You should add your website content to the directory /var/www/html/
33
+ と表記されています.....
25
- SELINUX=enforceing
34
+ 助けて下さいよろしくお願いします
26
- 起動:X
27
-
28
- 3ラベル変更
29
- ls -Zで確認htmlフォルダとindex.html
30
- system_u:object_r:httpd_sys_content_t:s0
31
- chconで同じ値に変更
32
- 起動:X
33
-
34
- 4 ディレクトリのパーミッション変更
35
- chmod 777 wp/html
36
- -rwxrwxrwx index.html
37
- 起動:X
38
-
39
- 5所有者の変更
40
- chown でhtml/index.htmlと同じ値に変更する
41
- chown apache:apache wp/index.html
42
-
43
- その他reboot,restart httpdです。