PDA

View Full Version : Have Apache listen to multiple ports


filburt1
Fri 27th Sep '02, 11:44am
How can I configure Apache 1.3.x listen to both port 80 and some other port?

eva2000
Fri 27th Sep '02, 11:48am
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

filburt1
Fri 27th Sep '02, 12:28pm
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).

eva2000
Fri 27th Sep '02, 12:32pm
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

should work

filburt1
Fri 27th Sep '02, 12:37pm
Woohoo, it worked :D A point for eva!

eva2000
Fri 27th Sep '02, 12:49pm
Originally posted by filburt1
Woohoo, it worked :D A point for eva! no probs :D