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服务器。
上一篇:apache更改网站根目录ubuntu
下一篇:Apache更新后出现AH10411错误-重定向带有空格(%20)