1.首先确保你需要更改主目录,确定目录的权限和所有者也是正确的。
打开httpd.conf文件,找到
Require all granted
打开selinux,找到httpd_sys_content_t类型的标签,允许Apache访问目标目录:
sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/new/home(/.*)?"
sudo restorecon /path/to/new/home
重启Apache服务器。