nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Lighttpd Chroot jail, [again]

This is a discussion on Lighttpd Chroot jail, [again] within the Web servers forums, part of the Mastering Servers category; ok last time i was doing it way wrong, this time i know i got it right, here is my ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 29-01-2010, 07:47 AM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 0
maxBirdy is on a distinguished road
Default Lighttpd Chroot jail, [again]

ok last time i was doing it way wrong, this time i know i got it right, here is my error log.

HTML Code:
2010-01-28 16:57:57: (log.c.166) server started 
2010-01-28 16:57:57: (mod_compress.c.223) can't stat compress.cache-dir /var/cache/lighttpd/compress/ No such file or directory 
2010-01-28 16:57:57: (server.c.931) Configuration of plugins failed. Going down.
<<fixed the above, it was a dir problem.


the below is unfixed, i think ive seen people have similar problems but i didnt bookmark the pages.
HTML Code:
2010-01-28 17:01:58: (log.c.166) server started 
2010-01-28 17:01:58: (mod_fastcgi.c.1104) the fastcgi-backend /usr/bin/php-cgi failed to start: 
2010-01-28 17:01:58: (mod_fastcgi.c.1108) child exited with status 2 /usr/bin/php-cgi 
2010-01-28 17:01:58: (mod_fastcgi.c.1111) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags. 
2010-01-28 17:01:58: (mod_fastcgi.c.1399) [ERROR]: spawning fcgi failed. 
2010-01-28 17:01:58: (server.c.931) Configuration of plugins failed. Going down.
Reply With Quote
  #2 (permalink)  
Old 29-01-2010, 11:32 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Before get into php problem, just comment out all fastcgi and php lines. And try to start server. if it started than you can easily debug php problem as well. This is on Gentoo or Debian?
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 29-01-2010, 09:28 PM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 0
maxBirdy is on a distinguished road
Default

my os is debian

lighty-disable-mod fastcgi
Available modules: auth cgi fastcgi proxy rrdtool simple-vhost ssi ssl status userdir
Already enabled modules: fastcgi
Disabling fastcgi
Run /etc/init.d/lighttpd force-reload to enable changes
> /etc/init.d/lighttpd force-reload
Reloading web server configuration: lighttpd.

doing this made the server work, i can now connect to it.

//edit, just put index.htm and some jibberish in it, into the jail, opened it in browser, works great, now i just need help on figuring out why php wont work.

Last edited by maxBirdy; 29-01-2010 at 09:33 PM.
Reply With Quote
  #4 (permalink)  
Old 04-02-2010, 07:40 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Did you installed php5-cgi package?
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 05-02-2010, 02:49 AM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 0
maxBirdy is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
Did you installed php5-cgi package?
yes it is.

Code:
apt-get install lighttpd php5-cgi php5-cli php5-mysql mysql-server
this is what i have installed.
Reply With Quote
  #6 (permalink)  
Old 05-02-2010, 10:06 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Did you copied /usr/bin/php5-cgi and all its files (libs) to the directory set by server.chroot directory. If any files all not copied there will be problem. You need to use l2chroot script and edit base directory as specified in article.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #7 (permalink)  
Old 05-02-2010, 09:17 PM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 0
maxBirdy is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
Did you copied /usr/bin/php5-cgi and all its files (libs) to the directory set by server.chroot directory. If any files all not copied there will be problem. You need to use l2chroot script and edit base directory as specified in article.
damnit, i made a huge post on what ive done and i checked back here to see it didnt post, DAMN!!

im not even going to bother trying to remember what i wrote.

nixcraft, ive done everything in the chroot tut for lighttpd, everything!!, i havnt missed a single step, not one, ive followed it till my eyes hurt from staring so hard at it, ive copied all the files, ive installed everything, ive used the l2chroot, ive made sure all my directories are correct, all the directories put out by the "dpkg -L php5-mysql" i used those directories for php that it put out.

ive done nothing different other than what the tutorial told me to do, and ive followed it line by line.

i havnt a clue what to do, im only an intermediate linux user,

maybe i need to put "/webroot/usr/bin/php5-cgi" in the mod-enabled-fast-cgi.conf??
Reply With Quote
  #8 (permalink)  
Old 07-02-2010, 11:32 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Fine. Stop lighttpd and turn on fastcgi.

Next start lighttpd as follows from command prompt and note down errors:
Code:
lighttpd -D -f /etc/lighttpd/lighttpd.conf
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #9 (permalink)  
Old 07-02-2010, 09:52 PM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 0
maxBirdy is on a distinguished road
Default

Quote:
2010-02-07 07:08:23: (log.c.166) server started
2010-02-07 07:08:23: (mod_fastcgi.c.1104) the fastcgi-backend /usr/bin/php-cgi failed to start:
2010-02-07 07:08:23: (mod_fastcgi.c.110 child exited with status 2 /usr/bin/php-cgi
2010-02-07 07:08:23: (mod_fastcgi.c.1111) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2010-02-07 07:08:23: (mod_fastcgi.c.1399) [ERROR]: spawning fcgi failed.
2010-02-07 07:08:23: (server.c.931) Configuration of plugins failed. Going down.
so i get the problem now
there is no php-cgi bin in the jail, just a php5-cgi and php5 bin. , so in "10-fast-cgi.conf" i edit php-cgi to>> php5-cgi, now i get a whole new mess of errors, or missing libs for php, well i know where those are and i just transfered them to the jail, now im left with one error, it seems to have something to do with GCC??

Quote:
libgcc_s.so.1 must be installed for pthread_cancel to work
now i looked in my root folders /usr/lib/ folder, there is no "libgcc_s.so" , im assuming i dont have the package that this file comes with, if you could help me out with what it is i think that might just fix my problem
Reply With Quote
  #10 (permalink)  
Old 07-02-2010, 09:58 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,709
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Are you on 32bit or 64bit Debian? Take a look at /lib, /usr/lib/, /usr/lib64 and /lib64 directory. You will find file in one of those dir.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply

Tags
chroot , debian , fastcgi , gentoo , lighttpd , linux , php , unix


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
FreeBSD Jails -- use 'jexec' to execute multiple commands within a jail? gigglesworth All about FreeBSD/OpenBSD/NetBSD 6 20-01-2010 06:16 PM
Lighttpd Chroot maxBirdy Web servers 6 06-01-2010 12:36 PM
How to jail php raj Web servers 2 08-12-2008 01:39 PM
Linux Questions About BoF and Chroot shanthiavari Linux software 1 14-06-2008 11:52 AM
Minisendmail chroot get.the.MaX Web servers 2 17-01-2008 11:58 PM


All times are GMT +5.5. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38