Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 11-25-2006, 09:29 PM   #1
Senior Member
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
[apache] Chroot or mod_security?

Doing more learning on security for Apache, and have been reading up securing a box that is running Apache for a web server.

There seems to be two ways to secure it: Chroot and mod_security

I've noticed that Chroot is alot of steps but there is plenty of documentation, via Google.

While researching Chroot, I found an Apache module called mod_security and of course web documentation:

What are most people doing to secure their Apache web server?

What are the pros/cons of Chroot Vs mod_security?

Old 11-26-2006, 03:49 AM   #2
Senior Member
Registered: Mar 2004
Location: Wales, UK
Distribution: Debian, Ubuntu
Posts: 1,075

Rep: Reputation: 45
I hadn't looked at mod_security before, but it appears to do something totally different to chroot. With chroot you construct a restricted environment to run the chosen software in, and the rest of the system is "invisible" to the application.

This is time-consuming to setup, and the restricted application can escape the chroot if it gets root privileges. It's probably better to use SELinux, which is the default for current releases of Fedora Core and RHEL. On an SELinux system every secured service is effectively under chroot, because the SELinux policy absolutely prevents them from accessing other parts of the system. People complain about SELinux because it is *too* effective at restricting unsafe behavior out-of-the-box .

My personal Web server runs an older distro, and I opted for a low-maintenance approach: it runs the AIDE intrusion detection system so that I can see if a change occurs which I didn't make myself, and I set the security options in PHP to restrict the one remaining PHP application that I use. Long-term I'll migrate from that application to a Rails equivalent, turn off PHP altogether, and switch from Apache to lighttpd. One of the advertised features of lighttpd is that it chroots well.


apache, chroot, webserver

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Secure Your Apache With mod_security LXer Syndicated Linux News 0 07-13-2006 08:33 AM
chroot jail for apache dcdbutler Linux - Networking 3 04-02-2006 02:04 PM
Chroot Apache nistelrooy Linux - Security 1 06-18-2005 10:18 AM
mod_security for apache zsoltrenyi Linux - Security 0 02-08-2005 06:36 AM
Apache mod_security logging everything? ridertech Linux - Security 2 08-13-2004 01:10 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration