What Is IP-based Virtual Hosting?


<VirtualHost 192.168.200.4:80> (...) </VirtualHost>


The easiest way to provide virtual hosting is based on the IP address/port combination that the client connects to. We can configure Apache to support IP-based virtual hosting using <VirtualHost> sections. Each <VirtualHost> contains configuration directives that will be applied for requests addressed to the IP address (and optionally port number) specified in the opening tag. Of course, the server Apache is running on must have been configured with those IP addresses.

Note

If you are listening on nonstandard ports, make sure to provide a Listen directive for each one of them. Just listing them on the <VirtualHost> section will not cause Apache to listen for request in those ports.


IP-based virtual hosting has the drawback of having to assign a different IP address to each different virtual host.




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