LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > Chroot and php.ini

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2009, 10:41 PM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
Default 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.

Last edited by yulia; 04-18-2009 at 10:18 AM..
Reply With Quote
  #2  
Old 04-18-2009, 07:54 AM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
New problem... How do you get MySQL to work in a chroot environment?

Last edited by yulia; 04-18-2009 at 10:19 AM..
Reply With Quote
  #3  
Old 04-20-2009, 09:40 AM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
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?
Reply With Quote
  #4  
Old 04-20-2009, 10:30 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #5  
Old 04-21-2009, 02:10 PM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
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.
Reply With Quote
  #6  
Old 04-21-2009, 04:55 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
check your mysql server log for errors. maybe a permission problem?
Reply With Quote
  #7  
Old 04-22-2009, 08:41 AM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
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)
Reply With Quote
  #8  
Old 04-22-2009, 09:22 AM
Viz0n Viz0n is offline
New Member
 
Join Date: Mar 2009
Posts: 1
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.

Last edited by Viz0n; 04-22-2009 at 09:25 AM..
Reply With Quote
  #9  
Old 04-22-2009, 09:31 AM
yulia yulia is offline
Member
 
Join Date: Oct 2008
Posts: 27
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?
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:06 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.