LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot connect to localhost after selinux install (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-connect-to-localhost-after-selinux-install-879088/)

MasterMatt 05-05-2011 07:53 PM

Cannot connect to localhost after selinux install
 
I'm in the process of setting up a new Debian box as a web server. It needs to be as secure as I can get it. I had apache2 and mysql set up and all of the SSl taken care of.

After installing selinux I noticed that my browser and ftp in the terminal wont connect to localhost, other computers on my network can connect to the apache server via a global ip, but it wasn't pulling database info. When I checked, I found that mysql was stopped. When I try to start it, it times out.

After some googling and trying a bunch of setsebools I finally just disabled selinux in /etc/selinux/config. I rebooted and confirmed selinux was disabled, but still the same issues.

What is the best way to debug this?

If it helps the error php throws when trying to connect to mysql is "can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"

btmiller 05-06-2011 01:06 AM

If SELinux is disabled, it sounds like it's not the (proximate) cause of the problem. Have you checked that mysqld is running and that the file /var/run/mysqld/mysqld.sock actually exists? If it does, are its permissions set right?

I suppose it's possible that SELinux is somehow preventing MySQL from starting up right. Have you tried starting SELinux up in permissive mode, so that it logs what actions it would take, but does not actually enforce them? This might give you a clue if there is a SELinux related problem.

MasterMatt 05-09-2011 02:59 PM

Thanks for the reply.

the .sock file does not exist. After some googling, I gather that the .sock file is created when mysqld is started, but selinux changed some permissions around so that the mysql user couldn't create the sock file.

I didn't explore the problem too far as this project as become more of an learning experience for me and I've decided to start again from scratch to see how much of what I've learned stuck.


All times are GMT -5. The time now is 06:42 AM.