chrooting apache troubles mysql

Protecting your Linux box

chrooting apache troubles mysql

Postby ghulam yaseen » Tue Mar 02, 2010 4:39 pm

Hello All,

I have successfully implemeted the chroot enviorment for the Apache, the webpages work fine without involving mysql. But when i run a mysql related webpage it gives me error

Not connected to MySql...Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Any fix for this issue?
ghulam yaseen
Naik
 
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

Postby lambda » Tue Mar 02, 2010 4:49 pm

think about what "chroot" means. if apache is chrooted to /www (for example), the scripts will try to connect to /www/var/lib/mysql/mysql.sock. to the scripts, it will be /var/lib/mysql/mysql.sock.

configure mysql to use the new location for its socket, or configure your scripts (in php.ini, perhaps) to use tcp for db connections.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby ghulam yaseen » Mon Mar 08, 2010 3:04 pm

thanks lambda, php.ini is a good option for apache security
ghulam yaseen
Naik
 
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi


Return to “%s” Security

Who is online

Users browsing this forum: No registered users and 1 guest