Configuring a Default IP-based Virtual Host


<VirtualHost _default_ > ServerName default.example.com DocumentRoot /usr/local/apache/sites/default </VirtualHost>


The special _default_ syntax allows you to define a virtual host that will serve requests for addresses and port combinations not covered by other virtual hosts. You can also specify a port number in combination with the _default_ keyword, as in the following example, taken from the default Apache mod_ssl configuration. It specifies a virtual host that will listen for requests on that particular port, in all addresses not explicitly handled by other virtual hosts:

<VirtualHost _default_:443> SSLEngine on ServerName secure.example.com:443 DocumentRoot /usr/local/apache/sites/default ... </VirtualHost>





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