Listen
- The Listen directive instructs Apache to listen to more than one IP address or port; by default it responds to requests on all IP
interfaces, but only on the port given by the Port directive.
- Listen can be used instead of BindAddress and Port. It tells the server to accept incoming requests on the specified port or
address-and-port combination. If the first format is used, with a port number only, the server listens to the given port on all
interfaces, 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.
- Note that you may still require a Port directive so that URLs that Apache generates that point to your server still work.
- 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:
- 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
<VirtualHost>
- <VirtualHost> and </VirtualHost> are used to enclose a group of directives which will apply only to a particular virtual host.
Any directive which is allowed in a virtual host context may be used. When the server receives a request for a document on a
particular virtual host, it uses the configuration directives enclosed in the <VirtualHost> section. Addr can be
- The IP address of the virtual host
- A fully qualified domain name for the IP address of the virtual host.
- Example:
- <VirtualHost 10.1.2.3>
ServerAdmin webmaster@host.foo.com
DocumentRoot /www/docs/host.foo.com
ServerName host.foo.com
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost>
|