imapera
imapera

Reputation: 21

Httpd, myslqd and SELinux

Im running put of patient with SELinux and that stuff...

I have httpd and myslqd running on the same machine with CentOs 6, and both services have their configuration files in a nfs directory exported from another machine.

Everything works fine with Selinux disabled... but when I set it to enforcing, PHP scripts can not communicate with mysql service. Httpd service works fine and mysqld too, if I run "mysql -u root" I can make queries to the database perfectly, but php scripts can not.

I think I'm missing some sebool that allows php to use mysql or something like that, but i can not find the key... some help?

Upvotes: 1

Views: 185

Answers (1)

Linuxfabrik
Linuxfabrik

Reputation: 148

You can set the following flag to allow Apache to connect to a database.

setsebool -P httpd_can_network_connect_db on

The -P option makes the change persist across reboots. You may need sudo to execute this command.

Upvotes: 1

Related Questions