How to Run Multiple Apache On Single Host

If you want  to run two Apache instances on single Linux host you can do it easily by following the steps as shown below.

We already have one Apache installed and serving the static content. The Apache is installed at the following location:


Let`s copy the directory /etc/httpd to /etc/new_httpd

  cp -pr /etc/httpd  /etc/new_httpd

Now, as we have copied the old Apache web-server to a new location /etc/new_httpd. We need to make the changes to the configuration file.

cd  /etc/new_httpd and open the httpd.conf file in a vi editor and make changes to the following values:

ServerRoot “/etc/httpd”  TO ServerRoot “/etc/new_httpd”

Listen 80 TO Listen 82

PidFile run/ TO PidFile run/

Save and close the file.

In the next step we are going to copy the RHEL httpd configuration file.

 cp -pr /etc/sysconfig/httpd  /etc/sysconfig/new_httpd

In the next step, let`s copy the script /etc/init.d/httpd  TO /etc/init.d/new_httpd

 cp -pr  /etc/init.d/httpd   /etc/init.d/new_httpd

In this step, Link the /usr/sbin/httpd TO /usr/sbin/new_httpd

 ln -s  /usr/sbin/httpd   /usr/sbin/new_httpd

Open the file new_httpd under /etc/sysconfig/ and enter the following lines:



OPTIONS=”-f /etc/new_httpd/conf/httpd.conf”



Open the new_httpd file under /etc/init.d and replace httpd to new_httpd.

The command used to start/stop httpd and new_httpd service could be:

  • /etc/init.d/httpd {start|stop|restart}
  • /etc/init.d/new_httpd {start|stop|restart}

About Manish Jha

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in Iono,Inc as Cloud Solutions Architect. I have around 8 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in Server Configuration. Bookmark the permalink.

3 Responses to How to Run Multiple Apache On Single Host

  1. Jose says:

    Thank you very much for this post, I have followed the steps you mentioned and I’m able to start two instances of httpd, but I have a problem when I try to stop the new_httpd instance, everytime I try to stop it, I get a FAILED message. Did you experience this problem? Thank you.



  2. deepak says:

    The issue is with file location. Please edit belwo path of new_httpd under /etc/sysconfig/ as

    and Create a new folder new_httpd under /var/run.

    Thsi wouold resolve the issue.


  3. deepak says:

    If thsi above doesnot work the hard code absolute path of PidFile in new httpd.conf file as

    PidFile /var/run/new_httpd/

    Issue is coming because while stoping apache using “/etc/init.d/new_httpd stop”, it searching pid file under “/var/run/new_httpd/” but its created by default under /var/run/ By hardcoding pidfile path it resolves the issue.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s