Chroot Apache

By: DamianMyerscough

March 28, 2008 5:55 am





Chroot Apache the simple way


The process of chrooting the Apache web server is very tedious having to find all dependencies that Apache relies on, However, this process can be much simpler using the Apache module mod_security. The article for installing mod_security can be found at [1] website.

Please note that this process is mainly for static content i.e. No PHP/Perl/Python scripts.


The solution to this tedious problem is simple, the Apache module mod_security provides a basic chroot feature which is great if you are only serving static pages. The directive that mod_security uses is “SecChrootDir”. This directive takes a directory which the web server will be chrooted to, for example to set the chroot directory to “/srv/www” you would simple use the “SecChrootDir” directive as shown in Figure 1.

SecChrootDir /srv/www

Figure 1: Chroot Apache web server.



0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Tags: , ,
Categories: Enterprise Linux, Technical Solutions

Disclaimer: As with everything else in the SUSE Blog, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.