LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   Chroot and php.ini (http://www.litespeedtech.com/support/forum/showthread.php?t=2882)

yulia 04-17-2009 10:41 PM

Chrooting
 
I'm currently playing around with the chroot function, but can't seem to figure out how to load php.ini

I've tried lots of ways, none worked yet. Is there a trick? Current build:

Code:

./configure'  '--prefix=/opt/lsws/chroot/usr' '--with-litespeed' '--with-config-file-path=../php' ...
EDIT: Figured it out.

yulia 04-18-2009 07:54 AM

New problem... How do you get MySQL to work in a chroot environment?

yulia 04-20-2009 09:40 AM

Well after some research I found you can change the MySQL sock to the tmp location in the chroot, but can't get MySQL to restart. Is it typically better to reinstall MySQL in the chroot?

mistwang 04-20-2009 10:30 AM

Changing the MYSQL socket location wont make MySQL to fail.
I think it is not a easy task to install MySQL in chroot, and it is not necessary.

yulia 04-21-2009 02:10 PM

is there a certain location i should change the MySQL sock to? I've been setting it in the tmp under the chroot, but MySQL like fails to start when i change it.

mistwang 04-21-2009 04:55 PM

check your mysql server log for errors. maybe a permission problem?

yulia 04-22-2009 08:41 AM

Code:

host:~# ls -la /opt/lsws/chroot/tmp
total 304
drwxrwxrwt  3 root  root    4096 Apr 22 12:44 .
drwxr-xr-x 11 root  root    4096 Apr 22 12:38 ..
drwx------  3 lsws  lsws    4096 Apr 22 12:50 lshttpd
srwxrwxrwx  1 mysql mysql      0 Apr 22 12:40 mysqld.sock

my.cnf
Code:

[client]
port            = 3306
#socket          = /var/run/mysqld/mysqld.sock
socket          = /opt/lsws/chroot/tmp/mysqld.sock
[mysqld]
port            = 3306
#socket          = /var/run/mysqld/mysqld.sock
socket          = /opt/lsws/chroot/tmp/mysqld.sock

(only error I can really find)
When attempting to log in via phpMyAdmin:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

Viz0n 04-22-2009 09:22 AM

You actually solved the problem in your first post. Think chroot. ;)

Basically, what we need to do is tell php how to connect to MySQL in the chroot.

Open your php.ini and scroll down looking for [MySQL] and set the following:
Code:

mysql.default_socket = /tmp/mysqld.sock
mysql.default_host = localhost

Should work just fine.

yulia 04-22-2009 09:31 AM

Thanks, worked.

On a side note, I guess if you compiled PHP after I changed the socked location then I would not need to make the php.ini edit?


All times are GMT -7. The time now is 05:25 AM.