在配置apache服务时经常遇到DocumentRoot must be a directory的错误提示,刚接触到apache时折腾了几个小时才找到错误的原因,出现这样的错误一般都是由于selinux的原因. SELinux(Security-Enhanced Linux) 是美国国家安全局(NSA)对于强制访问控制的实现,是 Linux® 上最杰出的新安全子系统.NSA是在Linux社区的帮助下开发了一种访问控制体系,在这种访问控制体系的限制下,进程只能访问那些在他的任务中所需要文 件.SE…
w 有无\的区别. https://httpd.apache.org/docs/2.4/vhosts/examples.html hosts 127.0.0.1 w.w httpd.conf ServerName w.w # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Di…
目录的权限都 应该设置 为 drwxr_xr_x, 即755, 而html下的文件的权限设置为; 644 即可! -x 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性. -w权限, 可以 umask [-p] [-S] [mode] The user file-creation mask is set to mode. The -S option causes the mask to be printed in symbolic form; 默认的系统的umask是0002,…