How to Create a compact multiple daemon apache daemon

Discussion in 'Apache' started by danmartjoe, May 21, 2010.

  1. #1
    Hello Users,

    I am working with emulation software which create virtual nodes with unique IP addresses that bind to the physical server file system.

    I was hoping someone has some ideas of the best way to create a multiple instance apache daemon running inside a emulated virtual host.

    So far I have this:



    custom-post-config-commands {
    #!/bin/sh
    mkdir /tmp/e0_n0/usr
    chmod 777 /tmp/e0_n0/usr
    mkdir /tmp/e0_n0/usr/local
    chmod 777 /tmp/e0_n0/usr/local
    mkdir /tmp/e0_n0/usr/local/etc
    chmod 777 /tmp/e0_n0/usr/local/etc
    mkdir /tmp/e0_n0/usr/local/etc/apache22
    chmod 777 /tmp/e0_n0/usr/local/etc/apache22
    mkdir /tmp/e0_n0/usr/local/sbin
    chmod 777 /tmp/e0_n0/usr/local/sbin
    mkdir /tmp/e0_n0/usr/local/lib
    chmod 777 /tmp/e0_n0/usr/local/lib
    cp -r /usr/local/www /tmp/e0_n0/usr/local/www
    cp /usr/local/etc/apache22/httpd.conf.emulation /tmp/e0_n0/usr/local/etc/apache22/httpd.conf
    cp -r /usr/local/etc/apache22/envvars.d /tmp/e0_n0/usr/local/etc/apache22/envvars.d
    cp -r /usr/local/lib/* /tmp/e0_n0/usr/local/lib
    cp /usr/local/sbin/httpd /tmp/e0_n0/usr/local/sbin/httpd
    cp /usr/local/sbin/envvarsemulation /tmp/e0_n0/usr/local/sbin/envvars
    cp /usr/local/sbin/apachectlemulation /tmp/e0_n0/usr/local/sbin/apachectl
    }

    A startup script that copies the
    /usr/local/www directory
    a special custom usr/local/etc/apache22/httpd.conf file
    /usr/local/etc/apache22/envvars.d directory
    /usr/local/lib/* library files
    /usr/local/sbin/httpd httpd binary file
    /usr/local/sbin/envars envars file
    /usr/local/sbin/apachectl and apache startup script

    I have edited httpd.conf, envars, and apachectl script with my emulated node information then attempt to start apache by
    apachectl start

    So my goal was to create a separate apache deamon inside my emulated virtual node. I am confident this can be done. But there is no documentation I have found to do this so I was hoping someone has ideas how I can make apache compact and do this. I have also tried create a virtual host where my virtual node shares the same apache server as the physical server but that did not work right either.

    Thanks,

    Dan
     
    danmartjoe, May 21, 2010 IP