Configure Multiple Instances of Apache (HTTPD) on Same Server

Posted: Wednesday, August 20, 2014 by జగదేశ్ in Labels:
0

There are many cases where I need to work with multiple instances of Apache Server. This article tells you on how to configure multiple instances of Apache on the same server.

1. Duplicate the Http Configuration File
    cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd1.conf

2. Duplicate the conf.d location
    cp -pr /etc/httpd/conf/conf.d/  /etc/httpd/conf/conf.d2/

3. Change the PID file Name, Listen port number and include the conf.d2 location
    Change PidFile run/httpd.pid to run/httpd.pid2
    Listen 80 to Listen 81
    Include conf.d2/*.conf

4. Start the Second Instance using
    httpd -f /etc/httpd/conf/httpd1.conf -k start

5. Start the First Instance using
     Start httpd start

We can confirm using “netstat –tulpn | grep 80|81” Or we can access the localhost:80 , localhost:81


More to come, happy learning J