Changing the Address and Port Apache Uses


Listen 192.168.200.4:80 Listen 8080


Apache needs to know in which IP addresses and ports to listen for incoming requests. You can specify those using the Listen directive. The Listen directive takes a port to listen to and (optionally) an IP address. If no IP address is specified, Apache will use all available IP addresses. In this example, Apache will listen for requests on port 80 at the IP address 192.168.200.4 and on port 8080 at all available addresses. You can use multiple Listen directives to specify multiple IP addresses and ports to listen to.

You can also use Port to specify the port Apache listens to, but if a Listen directive is specified, the Port directive will not have an effect. Please refer to Chapter 4 for information on how the Port directive is also used for constructing self-referential URLs.

There is more configuration involved when you need to support name-based virtual hosts. Please see Chapter 5 for details.

In addition to Listen, Apache 1.3 provides a related directive, BindAddress. It is obsolete and its use is discouraged.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net