Apacheの「AH00132: file permissions deny server access」
環境
- OSX
- XAMPP-OSX 7.2.31 Rev.1
- Apache 2.4.43
症状
XAMPPではxamppfiles/htdocs
がデフォルトでApacheのDocumentRoot
なのですが、
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
毎度このhtdocs
を
・プロジェクト毎にリネーム
・Gitでクローンしたディレクトリに全てC&Pしてコミット
するという作業が非効率に感じてきたので、ローカルのApache on XAMPPを作業ディレクトリの方に持ってきたかった。
DocumentRoot
を例えば
DocumentRoot "/Users/<user>/Documents/Projects"
<Directory "/Users/<user>/Documents/Projects">
に持ってこられれば、そのまま作業ディレクトリにサーバを立てられるので上記二つの作業オーバーヘッドを減らせる。
と考えたので変更してみると
だと思った。
DocumentRootの変更
変更前
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
変更後
DocumentRoot "/Users/<user>/Documents/Projects"
<Directory "/Users/<user>/Documents/Projects">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
やったこと
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
DocumentRoot "/Users/<user>/Documents/Projects"
<Directory "/Users/<user>/Documents/Projects">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
とりあえず、ログを確認。
横長で見辛いので適度に改行してます。
[core:error] [pid 18609]
(1)Operation not permitted: [client ::1:54134]
AH00132: file permissions deny server access:
/Users/<user>/Documents/Projects/index.html
テスト用に$ echo "Hello" > /Users/<user>/Documents/Projects/index.html
で作成したフォルダへの権限がないみたいなので、
index.html
に対して
$ chmod 755 /Users/<user>/Documents/Projects/index.html
$ chmod +x /Users/<user>/Documents/Projects/index.html
したんですが、症状は変わらず。
親ディレクトリ&index.html
全てオープンな権限にしてみるも、症状変わらず。
httpd
を実行しているapacheユーザであるdaemon
をid
$ id daemon
uid=1(daemon) gid=1(daemon) groups=1(daemon),12(everyone),61(localaccounts),
100(_lpoperator),701(com.apple.sharepoint.group.1)
特に問題はなさそうです。
他症状
httpdのログを閲覧しているとXAMPPがフリーズしてしまう。
解決方法
不明。
httpd.conf
のDirectory
の設定は間違ってなさそう、というか元々htdocs
だった際のものをディレクトリだけ書き換えたものなので動かないはずがない。
そもそも、httpd.conf
で拒否されていたら
AH01630: client denied by server configuration
だろうし。
なぜ権限を全て与えているのに閲覧不可なのか。。。
解決には至りませんでしたが、情報源が少なかったので書いてみました。
原因わかりそうな方、コメント欄にお願いします。
Author And Source
この問題について(Apacheの「AH00132: file permissions deny server access」), 我々は、より多くの情報をここで見つけました https://qiita.com/kkent030315/items/78ce15caac1ef590bf2f著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .