Configure HTTPD to Listen Multiple Ports

by Vivek Gite on February 4, 2008 · 2 comments

Q. How do I configure Apache HTTPD to listen multiple ports under RHEL / Fedora / CentOS Linux Server?

A. Multiple ports can be configured via Listen directive under Apache web server. By default httpd listens on TCP port 80.

How to configure httpd to listen multiple ports?

Open configure file /etc/httpd/conf/httpd.conf and modify the Listen directive tells the server to accept incoming requests on the specified port. Multiple Listen directives may be used to specify a number of ports to listen to.
# vi /etc/httpd/conf/httpd.conf
Find line that read as follows:
Listen 80
Force httpd to listen to port 81:
Listen 81
Force httpd to listen on both port 80 and 81:
Listen 80
Listen 81

Save and close the file. Restart httpd:
# /etc/init.d/httpd restart

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 2 comments… read them below or add one }

1 Tanweer March 18, 2009

so what difference it makes? both port requires root privilege, how can we configure it as a non-root user.
say i want to listen it to port 8888 and a non-root user wants to start stop apache?

Reply

2 Nesrine June 8, 2011

After adding Listen 8000 to /etc/httpd/conf/httpd.conf
and restart httpd service httpd restart
I had this error

Démarrage de httpd :(98)Address already in use: make_sock: could not bind to address 192.168.1.3:80
no listening sockets available, shutting down
Unable to open logs

can someone help me please.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 5 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: