How Do I Configure Apache Server To Listen Multiple Ports ?

by lifeLinux on December 30, 2011

By default Apache server listens on TCP port 80 but I’d like an Apache Web Server to listen on port 80 and port 8080. The following article explains how do I configure Apache server to listen multiple ports under CentOS Linux Server?

To configure Apache server to listen multiple ports, you need to login as root and open configure file /etc/httpd/conf/httpd.conf and modify the Listen directive tells the server to accept incoming requests on the specified port.

# vi /etc/httpd/conf/httpd.conf

Find line that read as follows:

Listen 80

Force Apache server to listen on both port 80 and 8080:

Listen 80
Listen 8080

And find the VirtualHost portion for your website config and add *:8080 as shown below:

<VirtualHost *:80 *:8080>
...
</VirtualHost>

Save and close the file. Restart apache server:

# service httpd restart

Related Posts:

Previous post:

Next post: