Home / VPS & Dedicated / Running Apache on Another Port

Running Apache on Another Port

Apache featherQuestion: I have one instance of Apache running on the standard port 80, but I would like to run another on port 8080 for a different web application. Is this possible?

Answer: Yes, it is possible, and it is actually easier than you may think. Rather than creating a new install of Apache, all you have to do is create a virtual host that runs on the alternative port.

The first thing you need to do is open your Apache configuration file. On CentOS it is in /etc/httpd/conf/httpd.conf.

You should see the default “Listen” like that looks something like:

Listen 80

This tells Apache to listen to all addresses on port 80. You will want to create virtual hosts and have one of them on port 8080. Many web-based control panels have tools to make it easier. If not, simply make the configuration look like this:

NameVirtualhost 192.168.0.1:80
NameVirtualhost 192.168.0.1:8000

Servername main.servername.com
Serveralias servername.com www.servername.com
DocumentRoot /home/path/documents1/

Servername main.otherservername.com
Serveralias otherservername.com www.otherservername.com
DocumentRoot /home/path/documents2/

Check Also

Uk data center

Professional Data Centres In The UK

A professional data centre is a location in which various pieces of hardware are located …