LoginSignup
34
32

More than 5 years have passed since last update.

[解決] YosemiteでApacheの〜(チルダ)指定が動かなくなる。

Posted at

Yosemiteにアップグレードすると、Apacheの設定が若干変更されている。特に困ったのが userdir の設定がはずれていて、~(チルダ)でのユーザサイトにアクセスできなくなっている。

次のように解決できたのでメモ。

/etc/apache2/httpd.conf
# 166行目付近 コメントを外す
LoadModule userdir_module libexec/apache2/mod_userdir.so
# 492行目付近 コメントを外す
Include /private/etc/apache2/extra/httpd-userdir.conf

次に確認するのが、下記のファイル。usersの下を読み込むようになっていれば正解。

/etc/apache2/extra/httpd-userdir.conf
UserDir enabled
UserDir Sites
Include /private/etc/apache2/users/*.conf
<IfModule bonjour_module>
       RegisterUserSite customized-users
</IfModule>

最後に、usersの下のファイルを修正。usernameところは、それぞれで変更。

/etc/apache2/users/username.conf
<Directory /Users/*/Sites>
 DirectoryIndex index.html index.php
 AllowOverride All
 Options All
 Require all granted
</Directory>

Apacheが2.4系になっているので、allow,deny の記述方法が変わってるので注意。上の例は何でもありの設定なので、適宜変更した方が良い。

最後に httpd リスタート

apachectl -t
sudo apachectl restart

パーミッションの問題が出るならば、自分のディレクトリのパーミッションとかを確認。

34
32
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
34
32