Have Apache listen to multiple ports

Filed Under mercialleasing.com |

  • How can I configure Apache 1.3.x listen to both port 80 and some other port?


  • Woohoo, it worked :D A point for eva!


  • http://httpd.apache.org/docs/bind.html


    Listen can be used instead of BindAddress and Port. It tells the server to accept incoming requests (to listen) on the specified port or address-and-port combination. If the first format is used, with a port number only, the server listens on the given port on all interfaces marked as up, instead of the port given by the Port directive. If an IP address is given as well as a port, the server will listen on the given port and interface.

    Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.

    For example, to make the server accept connections on both port 80 and port 8000, use:

    Listen 80
    Listen 8000
    To make the server accept connections on two specified interfaces and port numbers, use
    Listen 192.170.2.1:80
    Listen 192.170.2.5:8000


  • /etc/rc.d/init.d/httpd stop
    /etc/rc.d/init.d/httpd start

    should work


  • Originally posted by filburt1
    Woohoo, it worked :D A point for eva! no probs :D


  • Okay, now for the hard part ;)

    How can I shut down the server to make the changes to httpd.conf, then restart it? This is Unix (Mac OS X which I'm SSHing into).







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Have Apache listen to multiple ports , Please add it free.

    Comments