PROJECT: MOD_CHROOT

Download Source Download Script Common building project
Download FILESOURCE
Download FILESCRIPT
  1. Download source and copy file in <LFSSystem>/build/src
    (e.g. cp <FILESOURCE> /usr/src/lfssystem/build/src)


  2. Download script and extract in <LFSSystem>/build/scripts/
    (e.g. tar -zxf <FILESCRIPT>.tgz -C /usr/src/lfssystem/build/scripts)


  3. Follow normal (Building System) with:
    make mrproper, make unpack and make menuconfig


  4. In make menuconfig check <PROJECT>


  5. Build process: make prepare build install iso dist
In menuconfig MOD_CHROOT is in: Networking|WWW

Final list of file:
/usr/lib/apache2/modules/mod_chroot.so


In /etc/apache2/httpd.conf:
  1. Uncomment and change:
    #LoadModule chroot_module  usr/lib/apache2/modules/mod_chroot.so
    in:
    LoadModule chroot_module  /usr/lib/apache2/modules/mod_chroot.so

  2. Add:
    ChrootDir "<CHROOTDIR>" ( e.g. ChrootDir "/home/apache2")
    LoadFile  "/lib/libnss_dns.so.2" (DNS resolution)

In /etc/apache2/ssl.conf:
  1. Change:
    #SSLSessionCache   none
    SSLSessionCache     dbm:/var/run/ssl_scache
    SSLSessionCacheTimeout 300
    in:
    SSLSessionCache      none
    #SSLSessionCache    dbm:/var/run/ssl_scache
    #SSLSessionCacheTimeout 300

  2. And change:
    SSLMutex  file:/var/run/ssl_mutex
    in:
    SSLMutex  sem


Important:
- In VirtualServer the DocumentRoot is relative to <CHROOTDIR>
- Perl, Php, Python etc.. don't work, use apache modules (mod-perl, mod_php, mod_python)
- MySQL/PostgreSQL work in loopback only (127.0.0.1)
- PHP mail() don't work, use PEAR mail, phphmailer (? I think) or SSMTP (sendmail clone)
- For problem, check project message archive (link on homepage)
- Apache don't install this module, two alternative workaround:
  • Before make iso execute this command:
    cp -dpR /usr/lib/apache2/modules/mod_chroot.so /build/tmp/ISO/cdtree/usr/lib/apache2/modules/
    After, in apache configuration, add (/etc/apache2/httpd.conf):
    LoadModule chroot_module  /usr/lib/apache2/modules/mod_chroot.so

  • Replace httpd script:
    cd <LFSSystem>/build/scripts (e.g. cd /usr/src/lfssystem/build/scripts)
    tar -zxf <PATH_TO_FILE>/httpd.tgz


Last modified:
Back to Index Alberto Benati