Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-05-2011, 08:53 PM   #1
LQ Newbie
Registered: May 2011
Posts: 5

Rep: Reputation: 0
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)"
Old 05-06-2011, 02:06 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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.
Old 05-09-2011, 03:59 PM   #3
LQ Newbie
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't connect to anything other than localhost Virtual Circuit Debian 4 02-18-2010 04:28 AM
Can't connect to localhost? kwikness Linux - Networking 15 05-22-2006 12:48 PM
How to connect to http://localhost:631 to install CUPS ch.keller Linux - Hardware 3 06-07-2005 10:25 PM
can't connect to localhost acidblue Fedora 0 12-05-2004 08:20 PM
Can't connect to localhost Brendon Linux - Networking 11 07-30-2002 11:13 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration