Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to make it so my apache web pages will be in a chroot jail. I have set up my chroot jail as according to https://wiki.ubuntu.com/ModChroot. However when i restart apache i get the following error logged:

[error] No such file or directory: could not create /var/chroot/apache/var/run/apache2.pid [error] apache2: could not log pid to file /var/chroot/apache/var/run/apache2.pid

/var/chroot/apache/var/run/apache2.pid is there with 777 permissions

If i dissable mod_chroot web pages are delivered correctly from the /var/chroot/apache/var/www directory.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

My guess would be that Apache is trying to write the PID file after it's done the chroot - i.e. when Apache think's it's trying to write to /var/chroot/apache/var/run/apache2.pid, it's actually trying to write to /var/chroot/apache/var/chroot/apache/var/run/apache2.pid

Check the Apache config files to see what PidFile is set to - it probably should be just

PidFile /var/run/apache2.pid

See http://core.segfault.pl/~hobbit/mod_chroot/apache20.html for other config tweaks you may need to do to use mod_chroot with Apache 2.x

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.