LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-30-2005, 07:58 PM   #1
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Using mod_chroot with MySQL?


Hi!

I recently installed mod_chroot and after a bit of troubleshooting got it up and working. Now I am having problems running pages that request info from a mysql db. It seems (and makes sense) that apache cannot call above the new chroot directory, which would include making mysql calls.

Looking over any documentation, I see:
Quote:
If your mySQL/PostgreSQL accepts connections on a Unix socket which is outside of your chroot jail, reconfigure it to listen on a loopback address (127.0.0.1).
However, I need mysql on this server to be able to communicate with other servers on the local network, and am concerned that this will remove that ability.

Am I just nuts?

If not, does anyone have any suggestions?

Thanks!
 
Old 06-01-2005, 11:36 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Kind of an ugly hack, but have you tried configuring mySQL to listen on 127.0.0.1 and then DNATing the incoming remote mySQL traffic to 127.0.0.1? It might work the other way around, but I've never tried rerouting a local Unix Socket like that and it might cause problems.

You could also try including the necessary networking libs into the chroot or using a second instance of mySQL, but I think both of those options are less than desirable.
 
Old 06-02-2005, 12:47 PM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Original Poster
Rep: Reputation: 69
Thanks for the response!

I may try that, but have now realized I need other things that are also outside my chroot, such as connection with the IMAP service.

I am considering other options right now regarding securing apache as chroot really doesn't seem to be the most desirable for me ATM.

I'll plug through other threads, google and the linux security web refrences and see what I can find on locking it down without using chroot.

Thanks again!

Cool
 
Old 06-12-2005, 02:00 PM   #4
hobbicik
LQ Newbie
 
Registered: Jun 2005
Posts: 1

Rep: Reputation: 0
Please note that documentation refers to mySQL listening on a local Unix socket (/tmp/mysql.sock, /var/run/mysql.sock etc). This socket probably won't be available inside chroot jail - that's why documentation suggests reconfiguring mySQL to listen on local INET socket (127.0.0.1). This way, the database is still available only from local machine, but works with mod_chroot.
If your mySQL is already configured to listen on external INET socket, mod_chroot won't break anything. You'll find your mySQL client to work flawlessly inside chroot jail (but please read the documentation on DNS lookups).

Marek Gutkowski
 
  


Reply



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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
mod_security SecChrootDir mod_chroot super_mouse Linux - Security 1 08-19-2005 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:41 AM.

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