Comment 18 for bug 1251939

Revision history for this message
In , Gravatar (gravatar) wrote :

I have set my chroot directory as shown below.

ChrootDir /var/www

When started with the above chroot setting, apache2 exits with the following error

[Sat Nov 16 10:20:54.241556 2013] [unixd:alert] [pid 12802] (2)No such file or directory: AH02158: Cannot chroot when not started as root

NOTE: apache2 is started as 'root' user. It looks like the call to check geteuid() is made after apache2 lowers its privilege to APACHE_RUN_USER?

I am not sure this is a bug or configuration issue. This directory (/var/www) mentioned above was setup with everything needed for chroot'ed environment with libapache2-mod-chroot and was working fine for many years running under apache 2.2. Recently, I upgraded to 2.4.6 and wanted to switch to apache2's native Chroot since mod_chroot is no longer maintained and I am now stuck with the above error.