|
|
How to set up multiple apache daemons on sparate IP's
These are the steps I used to set up apache using 2 daemons on 2 IP's. In the example i set up a separe QA environemt to test websites.
Basic steps
Copy config directory
cp -r /etc/httpd /etc/httpd-qa Edit /etc/httpd-qa/conf/httpd.conf
vi /etc/httpd-qa/conf/httpd.conf
Find the following lines in the file and edit to suit your environment.
ServerRoot "/etc/httpd-qa"
PidFile run/httpd-qa.pid Listen 192.168.163.99:80 DocumentRoot "/var/www-qa/html" edit ssl.conf/etc/httpd/conf.d/ssl.confListen 192.168.163.102:443 test by running httpd -fhttpd -f /etc/httpd-qa/conf/httpd.conf
copy the httpd executablecp /usr/lib/httpd /usr/lib/httpd-qaor you could link it ln –s /usr/lib/httpd /usr/lib/httpd-qa copy pidcp /var/run/httpd.pid /var/run/httpd-qa.pidcopy apachectlcp /usr/sbin/apachectl /usr/sbin/apachectl-qaedit apachectlfind this line and add the path to the new config fileHTTPD='/usr/sbin/httpd-qa -f /etc/httpd-qa/conf/httpd.conf' copy startup scriptcp /etc/init.d/httpd /etc/init.d/httpd-qaedit /etc/init.d/httpd-qaif [ -f /etc/sysconfig/httpd-qa ]; then. /etc/sysconfig/httpd-qa fi apachectl=/usr/sbin/apachectl-qa httpd=${HTTPD-/usr/sbin/httpd-qa -f /etc/httpd-qa/conf/httpd.conf} httpd2=${HTTPD-/usr/sbin/httpd-qa} prog=httpd-qa pidfile=${PIDFILE-/var/run/httpd-qa.pid} lockfile=${LOCKFILE-/var/lock/subsys/httpd-qa} check13 () { CONFFILE=/etc/httpd-qa/conf/httpd.conf start() { echo -n $"Starting $prog: " check13 || exit 1 LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd -f /etc/httpd/conf/httpd-qa.conf $OPTIONS stop() { echo -n $"Stopping $prog: " killproc -p ${pidfile} -d 10 $httpd2 # killproc -p ${pidfile} -d 10 /usr/sbin/httpd-qa |
|
||