Centos下Apache访问网站根目录下子目录出现You don't have permission to access错误的解决办法
来源:互联网 发布:淘宝wap访客是什么意思 编辑:程序博客网 时间:2024/06/05 23:00
检查http.conf发现没错之后,查找资料后发现时selinux的问题,所以需要关闭这个服务:
1
vi
/etc/sysconfig/selinux
2
SELINUX=enforcing 改为 SELINUX=disabled
重启后生效
不需重启 执行命令:
1
setenforce 0
*********************************************************
在CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6中运行PHP程序出错
You don't have permission to access / on this server
装好apache+php+mysql后,
拷贝一份phpmyadmin过后运行出错:
You don't have permission to access / on this server
有人说把selinux关掉就好了
而我发现了这个原因和方法:
因为网站执行的权限,一般要Read from all httpd scripts and the daemon这个权限。
当系统内经过解压出来的文件夹是没有这个权限的。
我们要在html/下新建一个目录(这时会自动分为Read from all httpd scripts and the daemon权限)
然后把档案复制一份过来放进去(注意不是剪切)
运行试试看吧。
我就可以了。
CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6(都是系统自带的)
You don't have permission to access / on this server
装好apache+php+mysql后,
拷贝一份phpmyadmin过后运行出错:
You don't have permission to access / on this server
有人说把selinux关掉就好了
而我发现了这个原因和方法:
因为网站执行的权限,一般要Read from all httpd scripts and the daemon这个权限。
当系统内经过解压出来的文件夹是没有这个权限的。
我们要在html/下新建一个目录(这时会自动分为Read from all httpd scripts and the daemon权限)
然后把档案复制一份过来放进去(注意不是剪切)
运行试试看吧。
我就可以了。
CentOS5.3+MySQL 5.0.45 +Apache2.2.3 +PHP5.1.6(都是系统自带的)
*********************************************************
在终端输入 (更改网站根目录权限为755,很多centos系统默认为700)
[root@localhost ~]# chmod -R 755 /var/www/html/
然后重启
[root@localhost ~]# /etc/init.d/httpd restart
*********************************************************
打开apache的配置文件httpd.conf,逐行检查。在大约快一半的地方有以下这段代码:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
发现了吧。由于配置了php后,这里的“Deny from all”已经拒绝了一切连接。把该行改成“allow from all”,修改后的代码如下,问题解决。
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
系统是centos,You don't have permission to access / on this server.
在google上搜索了一下,大部分的解决方法就是。
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
这里改成
Options Indexes FollowSymLinks
AllowOverride None
我改了之后还是会出现上面的错误,于是看一下自己设定的工作目录权限。
Options ExecCGI Includes
改成下面这行设置后,显示正常。
Options Indexes FollowSymLinks
当访问类unix操作系统上的/usr/local/apache2/htdocs/foo/bar.htm文件时,你收到了Permission Denied的错误。
Options Indexes FollowSymLinks
当访问类unix操作系统上的/usr/local/apache2/htdocs/foo/bar.htm文件时,你收到了Permission Denied的错误。
首先,查看文件的访问权限:
$ cd /usr/local/apache2/htdocs/foo
$ ls -l bar.htm
如果须要的话,就修复它们:
$ chmod 644 bar.html
对文件夹以及每个父文件夹做相同的操作
(/usr/local/apache2/htdocs/foo,/usr/local/apache2/htdocs,/usr/local/apache2,/usr/local/,/usr):
$ ls -la
$ chmod +x
$ cd ..
$ #repeat up to the root
在一些系统上,可使用工具namei来列出各个路径上的不同组件的访问权限,然后去发现是否有权限问题:
$ namei -m /usr/local/apache2/htdocs/foo/bar.html
0 0
- Centos下Apache访问网站根目录下子目录出现You don't have permission to access错误的解决办法
- Apache没有目录权限的解决办法-You don't have permission to access / on this server.
- CentOS Apache经常出现 You don't have permission to access on this server的问题
- yii中访问出现的错误: You don't have permission to access / on this server
- 嵌入式 apache出现You don't have permission to access
- apache:在浏览器里访问Document目录出现“you don't have permission to access / on this server”问题
- Apache出现 You don't have permission to access /phpmyadmin/ on this server. 解决办法
- Apache出现 You don't have permission to access /phpmyadmin/ on this server. 解决办法
- apache 403错误 显示如下: You don't have permission to access / on this server. 解决办法
- 局域网访问Apache PHP错误:Forbidden You don't have permission to access / on this server.
- WampServer 配置网站,访问出现You don‘t have permission to access XXXX on the server.
- 网站发布时出现Forbidden You don't have permission to access / on this server. 错误
- apache伪静态出现404 not found及You don't have permission to access / on this server.的解决办法
- Wamp 修改默认网站目录的方法及出现You don't have permission to access / on this server问题解决
- apache 之 you don't have permission to access / on this server linux 下 错误解决方法
- apache 之 you don't have permission to access / on this server linux 下 错误解决方法
- apache 之 you don't have permission to access / on this server linux 下 错误解决方法
- apache 之 you don't have permission to access / on this server linux 下 错误解决方法
- ElasticSearch 入门
- UVA - 12657 Boxes in a Line(双向链表)
- 几条使用率最高的SQL语句
- 在命令里编译和执行 带包名 和 jar包 java的文件
- Android 随笔——Activity的生命周期的理解
- Centos下Apache访问网站根目录下子目录出现You don't have permission to access错误的解决办法
- Emacs的ASCII图模式
- iOS面试题
- mysql赋权与收回权限(grant&revoke) 删除权限
- 客户端apache配置
- 微软BI 之SSIS 系列 - ErrorOutput 错误输出与处理
- Hacking Vim: startify(05)
- 欢迎使用CSDN-markdown编辑器
- Xamarin.Forms探索--使用 Xamarin.Forms 来创建跨平台的用户界面