状況
/var/wwwをwebserverのホームフォルダにして
/home/user_name/wwwというフォルダを作成して
/var/wwwの下にシンボリックリンクを貼って飛ぶということ。
原因
CentosあるあるのSELINUXだった。
SELINUXをdisabledにしないと、リンクを飛ぶことが許されない。
SELINUXをオフ
$ sudo vim /etc/selinux/config
/etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled #←ここ
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
環境構築終わってから気づいたが
ここを参考にすれば、スムーズに環境構築できるかもしれない。
参考:
YumでNginxセットアップ+PHP-FPM