CentOS出错You don't have permission to access on this server
检查http.conf发现没错之后。查找资料后发现时selinux的问题,所以须要关闭这个服务:
1 |
vi /etc/sysconfig/selinux |
2 |
SELINUX=enforcing |
重新启动后生效
不需重新启动 运行命令:
1 |
setenforce |
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
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的错误。
首先,查看文件的訪问权限:
$ 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
CentOS出错You don't have permission to access on this server的更多相关文章
- Linux Centos7 Apache 訪问 You don't have permission to access / on this server.
折腾了非常久,今天才找到了最正确的答案.感言真不easy. 百度出来的99%都是採集的内容.全都是错误的. You don't have permission to access / on this ...
- CentOS出错You don't have permission to access on this server
之前配置phpmyadmin的时候,在浏览器上输入http://192.168.8.250/phpmyadmin/ 也遇到了You don't have permission to access on ...
- You don't have permission to access ××× on this server.
之前开发项目一直在linux上用的xampp集成环境,前几天突然想移到window上面去. 開始在window上安装了一个集成环境(名字大概是 Uniform Service),把项目文件已过去, o ...
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
php多站点配置以及Forbidden You don't have permission to access / on this server问题解决 一.总结 一句话总结:我的问题是php的版本问 ...
- Forbidden You don't have permission to access / on this server PHP
在新安装的谷歌游览器里,打不了PHP网站了,错误显示: Forbidden You don't have permission to access / on this server. 原因还是配置权限 ...
- wamp出现You don’t have permission to access/on this server提示的解决方法
本地搭建wamp 输入http://127.0.0.1访问正常,当输入http://localhost/ apache出现You don't have permission to access/on ...
- yii安装 /You don't have permission to access on this server
在安装yii的时候 ,当打开了init.bat进行配置的时候小黑本弹出了个小黑框立刻就关闭了, 进入cmd模式再打开init.bat就出现了"You don't have permissi ...
- wampserver You don't have permission to access / on this server. 解决 方法(转,正好碰到这样的事情了就转下来)
最近在安装最近版wampserver 2.2 d时发现安装好后启动服务器,访问localhost显示You don't have permission to access / on this serv ...
- Forbidden You don't have permission to access / on this server. You don't have permission to access /phpmyadmin/ on this server. 解决办法
Forbidden You don't have permission to access / on this server. 解决办法 打开 httpd.conf 文件, 将 # onli ...
随机推荐
- InnoDB锁机制之Gap Lock、Next-Key Lock、Record Lock解析
InnoDB锁机制之Gap Lock.Next-Key Lock.Record Lock解析 有意思,解释的很好
- tomcat生成catalina.out文件
生成catalina.out方法 导语:本文为Windows下生tomcat将控制台信息输出到catalina.out文件 且 保证能实时查看日志文件的方法. 一.创建catalina.out 1. ...
- yield让代码更加简洁
不能传入out或ref public IEnumerable<Shop> GetShop() { ; i < ; i++) { yield return new Shop { ID ...
- Android 8.0 启动后台service 出错 IllegalStateException: Not allowed to start service Intent
错误原因: Android 8.0 不再允许后台service直接通过startService方式去启动, 具体行为变更如下: 如果针对 Android 8.0 的应用尝试在不允许其创建后台服务的情况 ...
- 这辈子写过的比较有意思的几个sql
递归 with myRecursion as( select * from recursion where id=1 union all select r.* from myRecursion m,r ...
- x264
x264 x264 h264 1. x264调用主要过程 x264_param_default():设置参数集结构体x264_param_t的缺省值. x264_picture_alloc():为 ...
- Hive扩展功能(七)--Hive On Spark
软件环境: linux系统: CentOS6.7 Hadoop版本: 2.6.5 zookeeper版本: 3.4.8 主机配置: 一共m1, m2, m3这五部机, 每部主机的用户名都为centos ...
- Caffe:导入caffePython-PyQt failed
在另一台电脑上使用caffe python版本,显示 Backend Qt5Agg is interactive backend. Turning interactive mode on. ...
- java浅析
基本结构 1.以字节码的方式运行在虚拟机上,不是直接编译成机器码运行,所以性能上差于 C 但是高于 python这样的解释形语言. 笔者大学期间学习过 汇编和C,工作后使用python,对这两种语言有 ...
- js常用方法和技巧
随着AJAX的流行,js又得到了很多人的重视,js最大的优势就是它能够对html上的所有元素进行操作,包括创建标签元素,更改元素属性等,这样就使得我们能够利用js来实现很多的动态效果,来提供给用户更强 ...