CentOS7 の Apache のディレクトリ設定

CentOS7のApacheのフォルダの設定
「/var/www」以下のコンテンツを配置していればいいのですが
それ以外に配置した際に「Require all granted」をしておかない
と繋がらないよという件
 
CentOS6までのディレクティブを貼り付けたら動かなくてすこし悩んだのでメモ
 

AH01630: client denied by server configuration: フォルダ名

がエラーログに出力される

 
/etc/httpd/conf/httpd.confより

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

「/」以下で「/var/www」以外はDenyなので許可する必要あり

<Directory "/home/aaa/bbb/">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

 
 
 
CentOS6までは以下のような感じで明示的に拒否になっていなかった

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA