centos7 + apache環境にて、Aliasディレクティブを利用し、DocumentRoot以外に配置している
index.htmlを参照させようとしました。
しかし、403および404エラーが発生し、参照できません。
selinuxを解除し、どのユーザでも参照可能な/tmp配下にindex.htmlを配置しても
参照できません。
・apacheのエラーメッセージ(403エラー発生時のみ出力されます。404エラー時はエラーメッセージ無し。)
[Sun Mar 06 15:51:38.310390 2016] [autoindex:error] [pid 2989] [client 10.0.2.2:63300] AH01276: Cannot serve directory /tmp/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
・httpd.confの抜粋
(httpd.confのコメント、空行を抜いた全行も最後に記載しておきます)
httpd.conf
1<Directory /> 2 AllowOverride none 3 Require all granted 4</Directory> 5 6DocumentRoot "/var/www/html" 7 8<IfModule dir_module> 9 DirectoryIndex index.html index.php 10</IfModule> 11 12<IfModule alias_module> 13 Alias /tmp /tmp 14 <Directory /tmp> 15 Require all granted 16 </Directory> 17 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 18</IfModule> 19
下記は403エラーとなるURLです。
http://localhost/tmp/
下記は404エラーとなるURLです。
http://localhost/tmp/index.html
・/tmp配下にはindex.htmlが644で配置してあります
ls -l /tmp/index.html
-rw-r--r--. 1 root root 28 3月 6 15:07 /tmp/index.html
■質問事項
どのようにすれば参照できるのでしょうか?
■環境情報
・OSバージョン
CentOS Linux release 7.2.1511 (Core)
・apacheバージョン
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 19 2015 21:43:13
■参考情報
httpd.conf
1ServerRoot "/etc/httpd" 2Listen 80 3LoadModule proxy_module modules/mod_proxy.so 4LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 5Include conf.modules.d/*.conf 6User apache 7Group apache 8ServerAdmin root@localhost 9<Directory /> 10 AllowOverride none 11 Require all granted 12</Directory> 13DocumentRoot "/var/www/html" 14<Directory "/var/www"> 15 AllowOverride None 16 Require all granted 17</Directory> 18<Directory "/var/www/html"> 19 Options Indexes FollowSymLinks 20 AllowOverride None 21 Require all granted 22</Directory> 23<IfModule dir_module> 24 DirectoryIndex index.html index.php 25</IfModule> 26<Files ".ht*"> 27 Require all denied 28</Files> 29ErrorLog "logs/error_log" 30LogLevel warn 31<IfModule log_config_module> 32 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 33 LogFormat "%h %l %u %t \"%r\" %>s %b" common 34 <IfModule logio_module> 35 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 36 </IfModule> 37 CustomLog "logs/access_log" combined 38</IfModule> 39<IfModule alias_module> 40 Alias /tmp /tmp 41 <Directory /tmp> 42 Require all granted 43 </Directory> 44 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 45</IfModule> 46<Directory "/var/www/cgi-bin"> 47 AllowOverride None 48 Options None 49 Require all granted 50</Directory> 51<IfModule mime_module> 52 TypesConfig /etc/mime.types 53 AddType application/x-compress .Z 54 AddType application/x-gzip .gz .tgz 55 AddType text/html .shtml 56 AddOutputFilter INCLUDES .shtml 57</IfModule> 58AddDefaultCharset UTF-8 59<IfModule mime_magic_module> 60 MIMEMagicFile conf/magic 61</IfModule> 62EnableSendfile on 63IncludeOptional conf.d/*.conf
■追加情報
apacheをデバッグレベルで出力したログです。
・http://localhost/tmp/
[Sun Mar 06 17:26:32.087141 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of Require all granted: granted
[Sun Mar 06 17:26:32.087353 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of <RequireAny>: granted
[Sun Mar 06 17:26:32.087519 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of Require all granted: granted
[Sun Mar 06 17:26:32.087534 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of <RequireAny>: granted
[Sun Mar 06 17:26:32.087628 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of Require all granted: granted
[Sun Mar 06 17:26:32.087637 2016] [authz_core:debug] [pid 5571] mod_authz_core.c(809): [client 10.0.2.2:64052] AH01626: authorization result of <RequireAny>: granted
[Sun Mar 06 17:26:32.087890 2016] [autoindex:error] [pid 5571] [client 10.0.2.2:64052] AH01276: Cannot serve directory /tmp/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
・http://localhost/tmp/index.html
[Sun Mar 06 17:28:06.290017 2016] [authz_core:debug] [pid 5570] mod_authz_core.c(809): [client 10.0.2.2:64062] AH01626: authorization result of Require all granted: granted
[Sun Mar 06 17:28:06.290412 2016] [authz_core:debug] [pid 5570] mod_authz_core.c(809): [client 10.0.2.2:64062] AH01626: authorization result of <RequireAny>: granted
[Sun Mar 06 17:28:06.290631 2016] [core:info] [pid 5570] [client 10.0.2.2:64062] AH00128: File does not exist: /tmp/index.html
また、切り分けのために下記のように/var/www/html内でAliasを使用した際のログも記載します。(正常アクセス可能)
Alias /nob /var/www/html/nob777↲
<Directory /var/www/html/nob777>↲
Require all granted↲
</Directory>↲
・http://localhost/nob/index.html
[Sun Mar 06 17:30:59.392574 2016] [authz_core:debug] [pid 6330] mod_authz_core.c(809): [client 10.0.2.2:64067] AH01626: authorization result of Require all granted: granted
[Sun Mar 06 17:30:59.392697 2016] [authz_core:debug] [pid 6330] mod_authz_core.c(809): [client 10.0.2.2:64067] AH01626: authorization result of <RequireAny>: granted
[Sun Mar 06 17:30:59.892143 2016] [proxy:debug] [pid 6574] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Sun Mar 06 17:30:59.892278 2016] [proxy:debug] [pid 6574] proxy_util.c(1885): AH00927: initializing worker proxy:reverse local
[Sun Mar 06 17:30:59.892350 2016] [proxy:debug] [pid 6574] proxy_util.c(1936): AH00931: initialized single connection worker in child 6574 for (*)
以上、よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。