【问题标题】:How should I set up SELinux to allow my apache to remotely access postgresql?我应该如何设置 SELinux 以允许我的 apache 远程访问 postgresql?
【发布时间】:2021-03-28 20:26:43
【问题描述】:

这是我的数据库RiceLncPedia。当我不更改SElinux(默认启用)时,一些需要远程posgresql的页面会出现Permission denied(如this)。当我使用sudo setenforce 0关闭SElinux后,这些页面都可以正常访问了。

但是为了安全起见,我想在不关闭SElinux的情况下满足数据库的正常访问。我需要改变什么吗?

我的系统:

[yxu@localhost js]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

【问题讨论】:

    标签: linux apache selinux


    【解决方案1】:

    您需要允许 apache 访问您的数据库:

    setsebool httpd_can_network_connect_db 1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-05
      • 1970-01-01
      • 2013-09-01
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      • 2018-01-06
      相关资源
      最近更新 更多