LoginSignup
0
0

More than 5 years have passed since last update.

CentOS7 Nginx リンク 403 forbiddenエラー

Posted at

状況

/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

0
0
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
0
0