httpd.conf中一旦修改DocumentRoot为其他的目录出现Forbidden
来源:互联网 发布:大学网络教育专业 编辑:程序博客网 时间:2024/05/21 17:09
首先:保证修改后的DocumentRoot的目录具有apache访问权限,也为apache服务器是以apache用户启动的,他对/home/username/目录不一定有访问权限。我做的方法是首先给该目录777权限,同时增加两行代码:user username;gourp username
可以参考:http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server
//这个是确保内部没有安全因素的问题下的
httpd.conf中一旦修改DocumentRoot为其他的目录,则出现Forbidden
2、解决方法1 google后,我发现出现上述问题的原因不在于SElinux,而是因为httpd.conf中有
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all ..........修改为Allow from all 后解决
</Directory>
将Deny from all 修改为Allow from all ,就可以访问到我虚拟主机设置文件中的其他目录了!如可访问/var/www,附虚拟主机文件 httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /var/www
ServerName
DirectoryIndex index.html index.php index.htm
</VirtualHost>
问题2:在主文件httpd.conf中修改为Allow from all 后,apache的默认根目录及/var/www目录的安全性又如何?
3、解决方法2 或者不改变主文件httpd.conf,在虚拟主机文件 httpd-vhosts.conf中,按如下设置也可以访问到该虚拟主机目录
<Directory /var/www>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www
ServerName
DirectoryIndex index.html index.php index.htm
</VirtualHost>
- httpd.conf中一旦修改DocumentRoot为其他的目录出现Forbidden
- 设置httpd.conf的DocumentRoot值为其他目录时出现“Document root must be a directory”的问题
- 设置httpd.conf的DocumentRoot值为其他目录时出现“Document root must be a directory”的问题
- 关于virtualBox中最小化安装CentOS7系统,更改httpd.conf中的DocumentRoot之后访问出现Forbidden的问题
- mac 中配置apache的DocumentRoot路径 出现403 Forbidden错误
- Apache httpd.conf 配置 之 DocumentRoot
- 解决修改XAMPP DocumentRoot: Access forbidden!
- 通过浏览器访问 memcache.php提示找不到该文件, 注意 httpd.conf 的 “documentroot”路径
- httpd.conf目录
- apache VirtualHost httpd.conf的修改
- 手动修改httpd.conf
- httpd.conf为空
- mac修改apache中httpd.conf,修改默认访问路径
- APACHE中 httpd.conf 的中文详解
- APACHE中 httpd.conf 的中文详解
- APACHE中 httpd.conf 的中文详解
- Apache中httpd.conf文件的详解
- apache 中 httpd.conf 的配置详解
- 解读Wi-Fi航班:陆基、星基两大技术支撑
- [网易科技]微信硬件接口并没有想象中的那么美!
- JNI之------JNINativeMethod
- iOS中Block(2)
- linux zip/unzip命令
- httpd.conf中一旦修改DocumentRoot为其他的目录出现Forbidden
- uva 467 - Synching Signals(暴力+数学)
- Tomcat Server.xml文件配置
- 马云留下的感悟
- iOS中block(3)
- 混淆打包apk时 proguard-project的配置
- 泊松分酒
- 【Android】倒计时
- Unity与高通AR结合学习记录 - 创建自己的AR工程