![](https://seccdn.libravatar.org/avatar/926aae47e9d1677af3799a66f39f330d.jpg?s=120&d=mm&r=g)
Hi, I have a tiny tiny problem, I am trying to set Apache on chrooted environment. -). I am stuck with the area where it gets to start the program meaning how to modify the /etc/init.d/apache part. I have modified the startproc part and I am using compartment instead of it compartment --chroot /jail/apache --user wwwrun --group root --verbose --fork compartment gives a message "Succesfully forked" and then I have httpd shouting :-( and apache does not start what is I am missing bad user name wwwrun Here are the steps I have done so far 1) Created a partion named jail and created a directory apache in it 2) ldd /usr/sbin/httpd to get the needed library files libm.so.6 => /lib/libm.so.6 (0x40032000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40051000) libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x40080000) libdb-3.1.so => /usr/lib/libdb-3.1.so (0x40086000) libdl.so.2 => /lib/libdl.so.2 (0x40103000) libmm.so.11 => /usr/lib/libmm.so.11 (0x40107000) libc.so.6 => /lib/libc.so.6 (0x4010c000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) copied these files to the relative location under $JAIL/apache 3) copied /etc/ld.so.conf to $JAIL/apache/etc and then run ldd -X -r $JAIL/apache/ 4) copied the entire apache files (excluding the documentation) to $JAIL/apache including the /etc/httpd/* 5)copied /etc/passwd and /etc/group files to $JAIL/apache/etc and edited them only to have wwwrun and nogroup lines. Copied /etc/resolv.cof nsswitch.conf localtime hosts to $JAIL/apache/etc also 6)made the directories mkdir $JAIL/apache/var $JAIL/apache/dev/ -m 755 7)made the directories under $JAIL/apache/var/run $JAIL/apache/var/lib and lib/httpd and lib/wwrun and var/log/httpd 8)chown wwwrun.root lib/httpd and lib/wwwrun 9) made $JAIL/apache/tmp with mkdir tmp -m 1755 10) added a -/jail/apache/dev/log to SYSLOG_PARAMETERS in /etc/rc.config
![](https://seccdn.libravatar.org/avatar/59cd6d40e323303576888b1dcf3fe23c.jpg?s=120&d=mm&r=g)
* Togan Muftuoglu
compartment gives a message "Succesfully forked" and then I have httpd shouting :-( and apache does not start what is I am missing
bad user name wwwrun
It's been a while since I played with this, but you may not have the
user specified in your httpd.conf file, as far as I remember, or I have
also done this whitout using this particular SuSE user (wwwrun).
Have a look at the changed Compartment script below; as far as I
remember it worked at some point, but have honestly no idea anymore...:
Joost
#!/bin/sh
# script being changed for apache...1/2001, by
![](https://seccdn.libravatar.org/avatar/926aae47e9d1677af3799a66f39f330d.jpg?s=120&d=mm&r=g)
* Joost van der Lugt;
Have a look at the changed Compartment script below; as far as I remember it worked at some point, but have honestly no idea anymore...:
Thanks, when I run it I have now "too many open files" shouting along with it :-( Altough I tweaked it for the correct paths and it is not working :-( -- Togan Myftuoglu
![](https://seccdn.libravatar.org/avatar/59cd6d40e323303576888b1dcf3fe23c.jpg?s=120&d=mm&r=g)
* Togan Muftuoglu
* Joost van der Lugt;
on 19 Jan, 2002 wrote: Have a look at the changed Compartment script below; as far as I remember it worked at some point, but have honestly no idea anymore...:
Thanks, when I run it I have now "too many open files" shouting along with it :-( Altough I tweaked it for the correct paths and it is not working :-(
That's a weird error..., guess maybe just use the script to adapt your own ;-), I may have a look myself sometime... Joost
![](https://seccdn.libravatar.org/avatar/926aae47e9d1677af3799a66f39f330d.jpg?s=120&d=mm&r=g)
* Joost van der Lugt;
with it :-( Altough I tweaked it for the correct paths and it is not working :-(
That's a weird error..., guess maybe just use the script to adapt your own ;-), I may have a look myself sometime...
Okay sorted out the idiotic typo problems. The "too many open files" came from strace which I was hoping will show me the problematic area ( a bit of irony.) I will put this to the FAQ as soon as I have the new server up. Now let's see how to get rsync daemon working with ssh :-) Thanks a lot for the script which helped a lot in understanding the whole process.
![](https://seccdn.libravatar.org/avatar/59cd6d40e323303576888b1dcf3fe23c.jpg?s=120&d=mm&r=g)
* Togan Muftuoglu
* Joost van der Lugt;
on 20 Jan, 2002 wrote: with it :-( Altough I tweaked it for the correct paths and it is not working :-(
That's a weird error..., guess maybe just use the script to adapt your own ;-), I may have a look myself sometime...
Okay sorted out the idiotic typo problems. The "too many open files" came from strace which I was hoping will show me the problematic area ( a bit of irony.)
OK, that sounds better ;-)
I will put this to the FAQ as soon as I have the new server up. Now let's see how to get rsync daemon working with ssh :-)
Thanks a lot for the script which helped a lot in understanding the whole process.
No, problem, if you want send me privately the changes you made, cheers, Joost
![](https://seccdn.libravatar.org/avatar/926aae47e9d1677af3799a66f39f330d.jpg?s=120&d=mm&r=g)
* Togan Muftuoglu;
![](https://seccdn.libravatar.org/avatar/926aae47e9d1677af3799a66f39f330d.jpg?s=120&d=mm&r=g)
* Togan Muftuoglu;
participants (2)
-
Joost van der Lugt
-
Togan Muftuoglu