Apache mod_chroot

Apache, Lighttpd, nginx, Cherokee
AWOHille
Posts: 271
Joined: 2011-09-05 09:00

Apache mod_chroot

Post by AWOHille » 2011-11-18 23:33

Hallo,

ich wollte den Apachen in einer chroot Umgebung ausühren lassen. Dazu habe ich das Paket libapache2-mod-chroot installiert und dann per a2enmod mod_chroot aktiviert. Anschließend

Code: Select all

mkdir -p /var/www/var/run
chown -R root:root /var/www/var/run


/etc/apache2/apache2.conf

Code: Select all

ChrootDir /var/www


Nun in der /etc/apache2/httpd.conf entsprechend den DocumentRoot geändert z.B /var/www/domain1 in /domain1 usw.

Neustart Apachen. Anschließend kann die Seite aber nicht angezeigt werden. Hier der error-log

Code: Select all

[Fri Nov 18 23:19:39 2011] [notice] ModSecurity for Apache/2.5.12 (http://www.modsecurity.org/) configured.
[Fri Nov 18 23:19:39 2011] [notice] Original server signature: Apache/2.2.16 (Debian)
[Fri Nov 18 23:19:39 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Nov 18 23:19:39 2011] [notice] Digest: done
[Fri Nov 18 23:19:40 2011] [notice] mod_chroot: changed root to /var/www/.
[Fri Nov 18 23:19:40 2011] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Nov 18 23:19:40 2011] [alert] (2)No such file or directory: Can't chdir to /var/www/
[Fri Nov 18 23:19:40 2011] [alert] (2)No such file or directory: Can't chdir to /var/www/
[Fri Nov 18 23:19:40 2011] [alert] (2)No such file or directory: Can't chdir to /var/www/
[Fri Nov 18 23:19:40 2011] [alert] (2)No such file or directory: Can't chdir to /var/www/
[Fri Nov 18 23:19:40 2011] [notice] Apache/2.2.16 (Debian) mod_ssl/2.2.16 OpenSSL/0.9.8o Apache/2.2.0 (Fedora) mod_chroot/0.5 configured -- resuming normal operations
[Fri Nov 18 23:19:40 2011] [alert] Child 6558 returned a Fatal error... Apache is exiting!
[Fri Nov 18 23:19:40 2011] [alert] (2)No such file or directory: Can't chdir to /var/www/


Das Verzeichnis /var/www hat den Eigentümer www-data:root; 750

Wo liegt mein Fehler?

Gruß Hille

jan10001
Anbieter
Posts: 727
Joined: 2004-01-02 12:17

Re: Apache mod_chroot

Post by jan10001 » 2011-11-19 11:19