Centos7 nginx提示错误 Access denied.
SELinux will cause this error on CentOS/RHEL 7+ by default :(
CentOS/RHEL 7+ 系统默认会因为SELinux出现这个报错
To test if SELinux is the source of your woes, do
你可以通过下面这个命令关闭SELinux,进行测试
setenforce
... and see if everything works. If that fixed it, you can leave SELinux off (weak, you're better than that), or you can turn it back on with
看看是否运行正常,如果成功修复了,你可以修改配置文件永久保留关闭,或者再打开SELinux
setenforce
... and then properly fix the issue.
然后妥善解决这个问题。
If you do
如果你执行
tail -f /var/log/audit/audit.log
... you'll see the SELinux issue. In my case, it was denying PHP-FPM access to web files. You can run the following directives to fix it:
你将会看到是SELinux的问题。在我看来,这是因为SELinux拒绝了PHP-FPM访问Web文件。您可以运行以下指令来修复它:
setsebool -P httpd_can_network_connect_db
setsebool -P httpd_can_network_connect
This actually didn't fix it for me at first, but then restoring SELinux context did it
这一步还没有完全修复好,继续执行下面命令修复上下文
restorecon -R -v /var/www(你的web目录)
Hope that helps.
希望能帮到你
作者:匿名用户
链接:https://www.zhihu.com/question/22128267/answer/105600681
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
Centos7 nginx提示错误 Access denied.的更多相关文章
- 当尝试从ArcCatalog、.net应用或是Java应用中连接ArcGIS Server 时,显示下面任何一种错误提示: "Access Denied" 或 "The connection could not be made"
Error: 访问拒绝或无法连接错误 文章编号 : 29042 软件: ArcGIS Server 9.0, 9.1, 9.2, 9.3, 9.3.1 操作系统: Windows 2000, XP, ...
- jenkins 设置权限后管理员登陆提示:Access Denied admin没有Overall/Read权限
jenkins 设置权限后,管理员登陆提示:Access Denied admin没有Overall/Read权限 处理办法: window下编辑 xml 配置文件: %userprofile%\. ...
- 错误提示:Access denied for user 'GC'@'localhost' (using password: YES)
错误描述:使用的是C3P0连接池 Spring整合Mybatis时出现错误 java.sql.SQLException: Access denied for user 'GC'@'localhost' ...
- mysql将某数据库的全部权限赋给某用户,提示1044错误Access denied
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; ERROR 1044 (4 ...
- Suse发生了错误Access denied for user ''@'localhost' to&
好久没实用MySQL了,上次由于装了Banq的论坛系统.在用MySQL Administrator进去的时候居然提示mysql error number 1045 access denied for ...
- phpMyAdmin出现错误 Access denied for user 'root'@'localhost' (using password: NO)
今天安装wmpp,之后启动后点击phpMyAdmin 报拒绝连接错误:#1045 - Access denied for user 'root'@'localhost' (using password ...
- Navicat远程连接MySQL 提示1045 - Access denied for user 'root'@'223.74.158.192'(using password:YES)
问题: 今天在自己的阿里云服务器上(Window Server2012 R2)安装了一个MySQL5.7.26,在阿里云服务器中通过本地链接是正常的,但是当在自己的电脑上使用Navicat连接是提示: ...
- eclipse不正常编译导致错误:Access denied for user 'root'@'localhost' (using password: YES)
使用eclipse连接mysql报错:Access denied for user 'root'@'localhost' (using password: YES) 连接代码没有任何问题,网上找了很多 ...
- mysql错误 Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
mysql -u root -p Aaa111222333 grant all privileges on *.* to root@'%' identified by 'aaa111222333; Q ...
随机推荐
- (贪心)P1223 排队接水 洛谷
题目描述 有n个人在一个水龙头前排队接水,假如每个人接水的时间为Ti,请编程找出这n个人排队的一种顺序,使得n个人的平均等待时间最小. 输入输出格式 输入格式: 输入文件共两行,第一行为n:第二行分别 ...
- CEdit编辑框字体和背景设置
CEdit编辑框字体和背景设置注意事项:当CEdit为“disable”时,设置编辑框的字体和背景会没有效果.解决方案:将CEdit的Style设置为“readonly”,这样设置就能生效了,同时也能 ...
- jsr223 md5
import java.security.MessageDigest; String content = "xxx"; MessageDigest digest = Message ...
- maven_eclipse配置maven
1.eclipse配置3.3.9版本的maven 2.修改仓库位置
- MySQL5.7基于binary log的主从复制
MySQL5.7基于binary log的主从复制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 基于binary log 的复制是指主库将修改操作写入binary log 中, ...
- java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
在 windows 上运行 MapReduce 时报如下异常 Exception in thread "main" java.lang.UnsatisfiedLinkError: ...
- HDFS-JavaAPI
一.pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="h ...
- 设计模式---对象性能模式之单例模式(Singleton)
前提:“对象性能”模式 面向对象很好的解决了“抽象”的问题,但是必不可免地要付出一定的代价.对于通常情况来讲,面向对象的成本大都可以忽略不计.但是某些情况,面向对象所带来的成本必须谨慎处理. 前面是 ...
- Sublime Text 3 Mac常用快捷键与注意事项
大多数情况下容易忘记的快捷键,在此整理了一下. 编辑快捷键:cmd+L:选择行(重复按下将下一行加入选择):cmd+D:选择词(重复按下时多重选择相同的词进行多重编辑):cmd+shift+D 复制光 ...
- .net中 登录 才能下载文件的方法 Response.WriteFile实现下载
protected void Button2_Click(object sender, EventArgs e) { //可以在这里加是否登录的判断 string fileName = "c ...