LinuxQuestions.org
Visit Jeremy's Blog.
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 08-01-2001, 12:24 PM   #1
simon
LQ Newbie
 
Registered: Jul 2001
Posts: 23

Rep: Reputation: 15
chroot jail


I'm trying to set up a chroot jail to run Apahe from. So far everything seems to have worked but when I try to run apache (I'm using apachectl to start/stop apache) I get
"/usr/sbin/apachectl: /chroot/httpd/: is a directory
/usr/sbin/apachectl start: httpd started"

When I use ps the httpd process is not running. The page does not load in my browser and when I try to stop apache it tells me that it isn't running. The line in apachectl that specifies where httpd is located is "HTTPD=chroot /chroot/httpd/ /usr/sbin/httpd -DSSL"

Anyone have any ideas for what I can try?
 
Old 08-01-2001, 01:24 PM   #2
simon
LQ Newbie
 
Registered: Jul 2001
Posts: 23

Original Poster
Rep: Reputation: 15
I got it sort of working by putting the chroot command and its parameters in quotes. Now the error message I get is

"chroot: cannot execute /usr/sbin/httpd: No such file or directory
/usr/sbin/apachectl start: httpd could not be started"

httpd is in /usr/sbin in my chroot area. When I try to run it from there directly I get errors saying that it couldn't open the config file. This is because its looking for the config file in the wrong place (because when I run it it doesn't think its in the / directory). How can I get chroot to recognize that httpd is there and run it?
 
Old 08-01-2001, 03:16 PM   #3
simon
LQ Newbie
 
Registered: Jul 2001
Posts: 23

Original Poster
Rep: Reputation: 15
I found some info on the net that suggested that a possible cause was that I didn't have all of the shared libraries I needed in the chroot directory. For some reason when I run ldd I get this error

"httpd: error in loading shared libraries: httpd: cannot open shared object file: No such file or directory"

ldd was working properly yesterday. I tried it on other programs outside the chroot directory and it has the exact same problem. Any suggestions would be greatly appreciated.
 
Old 08-05-2001, 08:21 PM   #4
r3b00t
Member
 
Registered: May 2001
Distribution: OpenBSD 3.0-beta
Posts: 50

Rep: Reputation: 15
Get and build lsof. Start your httpd normally (eg. not rooted), and do lsof -p <pid of httpd> to get a listing of all open files httpd needs.

Rereate this set of files, devices and all that is needed by httpd (eg. the lsof output) in the /chroot/httpd directory. Once you have done this, try to start httpd. If you copied all the needed files in place, httpd should be running (if you're that lucky...). Probaby there will be some paths in your configfile pointing to the wrong position, but that's easily fixed.

After that, youre done....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Chroot jail Gimpy Linux - Software 10 05-07-2010 01:30 PM
Chroot jail pachanga Linux - General 12 09-26-2008 05:15 AM
Jail and chroot rogk Linux - Security 2 10-16-2005 02:20 AM
chroot jail etc. f1uke Linux - Security 5 08-24-2005 03:12 AM
Setting up a chroot jail jayanth Linux - Security 1 05-06-2005 12:31 AM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration