LoginSignup
4
3

More than 5 years have passed since last update.

macでxamppを使用する際にvirtualhostの設定で403が出る

Posted at

XAMPP 5.6.23

新しくmacを購入して、xamppでバーチャルホストの設定しようと思ったら、
ブラウザで見ても403..403..の連続になってしまった。

色々な記事を見て試したが解決せず。
ファイルのパーミッションを777にしてもダメ。

やっとこさ解決策が以下に書いてあった。

[403 errorの箇所]
http://jonathannicol.com/blog/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/

要は、
apacheはデフォルトでは、「nobody」ユーザーで実行されるため
あなたのOSX内のディレクトリ等にアクセスする許可を持たないから。
ということらしい。(ディレクトリとファイルのパーミッション777にしたんだけど。。)

なので、apacheのユーザーをOSXのユーザーと同じにすればいいということで、

/Applications/XAMPP/xamppfiles/etc/httpd.conf
のファイル内の

<IfModule unixd_module>
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon
</IfModule>

のユーザーの箇所を

<IfModule unixd_module>
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User あなたのosxのユーザー
Group daemon
</IfModule>

に変更して再起動させたら、閲覧できるようになりました。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3