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 ...
随机推荐
- 为什么wait()和notify()属于Object类
关于wait()暂停的是持有锁的对象,所以想调用wait()必须为:对象.wait(); notify()唤醒的是等待锁的对象,调用:对象.notify(); 如下: Object obj = new ...
- 如何在Mac上安全彻底的卸载软件?
文章来源:知乎 收录于:风云社区(SCOEE)[提供mac软件下载] 更多专题,可关注小编[磨人的小妖精],查看我的文章,也可上[风云社区 SCOEE],查找和下载相关软件资源. (一)综合类: 新买 ...
- mac crontab调用python时出现ImportError: No module named XXX的问题
写了一个监控mq的脚本,把这个脚本加入crontab里进行时刻监控,于是#crontab -e,添加语句: * * * * * cd /目录 && python mq脚本名.py &g ...
- flask 过滤器
作用的对象是jinja2模版中的变量({{}}) 参考链接: http://jinja.pocoo.org/docs/2.9/templates/#builtin-filters 内置过滤器 字符串操 ...
- c++ hash_map/unordered_map 使用
C++中有很多中key-value形式的容器,map/hash_map/unordered_map/vector_map.下面讲述各个map的使用及其区别. map: #include <ios ...
- 从Paxos到Zookeeper分布式一致性原理与实践 读书笔记之(一) 分布式架构
1.1 从集中式到分布式 1 集中式特点 结构简单,无需考虑对多个节点的部署和节点之间的协作. 2 分布式特点 分不性:在时间可空间上随意分布,机器的分布情况随时变动 对等性:计算机之间没有主从之分 ...
- Program License Agreement updated/The updated Apple Developer Program License Agreement needs to be reviewed.
Apple APP添加新APP时提示The updated Apple Developer Program License Agreement needs to be reviewed. 解决办法 登 ...
- 065、容器在Weave中如何通信和隔离?(2019-04-08 周一)
参考https://www.cnblogs.com/CloudMan6/p/7491831.html 在host2上执行如下命令: weave launch host1_ip 必须 ...
- C#窗口编程时TextBox中的换行
注意Windows下的换行符是\r\n.只使用\n是无法完成换行的
- Ajax和Json实现自动补全
1.index.jsp <%@ page language="java" import="java.util.*" pageEncoding=" ...