Apache
  Home arrow Apache arrow Page 2 - Putting Apache in Jail
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

Putting Apache in Jail
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-01-31

    Table of Contents:
  • Putting Apache in Jail
  • Finishing touches for Apache jail preparation
  • Preparing PHP to work in jail
  • Taking care of small jail problems
  • Using mod_security or mod_chroot

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Putting Apache in Jail - Finishing touches for Apache jail preparation


    (Page 2 of 5 )

    The walls of the jail are now up. Though the following files are not necessary, experience shows that many scripts require them. Add them now to avoid having to debug mysterious problems later.

    Construct special devices after using ls to examine the existing /dev folder to learn what numbers should be used:

      # mkdir /chroot/apache/dev
      # mknod -m 666 /chroot/apache/dev/null c 1 3
      # mknod -m 666 /chroot/apache/dev/zero c 1 5
      # mknod -m 644 /chroot/apache/dev/random c 1 8

    Then, add a temporary folder:

      # mkdir /chroot/apache/tmp
      # chmod +t /chroot/apache/tmp
      # chmod 777 /chroot/apache/tmp

    Finally, configure the time zone and the locale (we could have copied the whole /usr/ share/locale folder but we will not because of its size):

      # cp /usr/share/zoneinfo/MET /chroot/apache/
    etc/localtime
     
    # mkdir
    -p /chroot/apache/usr/lib/locale
     
    # set | grep LANG
     
    LANG=en_US.UTF-8
      LANGVAR=en_US.UTF-8
      #
    cp -dpR /usr/lib/locale/en_US.utf8 /chroot/ apache/usr/lib/locale  

    More Apache Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Apache Security," published by O'Reilly....
     

    Buy this book now. This article is excerpted from chapter two of Apache Security, written by Ivan Ristic (O'Reilly; ISBN: 0596007248). Check it out today at your favorite bookstore. Buy this book now.

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway