Skip to content

Need to disable SELinux on web #1

@sourcedelica

Description

@sourcedelica

I spent a boatload of time trying to figure out why my web page couldn't connect to the DB.

First I realized that I needed to use an IP address in both the Mysql user permissions and the mysqli_connect call.

But it was still giving me this error on the web page.

2003:Can't connect to MySQL server on '192.168.86.54' (13)  

I tried installing MySQL on the web server and was able to connect using the mysql client.

Finally I found this Stackoverflow article which said to set

setsebool -P httpd_can_network_connect_db=1

That worked. I ended up using this in my playbook.

- selinux:
  state: disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions