Httpd VirtualHost: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:


* [[httpd Configuration#Directives]]
* [[httpd Configuration#Directives]]
* [[httpd Virtual Host Configuration]]


=Overview=
=Overview=
Line 13: Line 14:
=Syntax=
=Syntax=


<tt>
<pre>
<VirtualHost IP:port>
<VirtualHost IP:port>
     ServerName example.novaordis.com
     ServerName example.novaordis.com
Line 19: Line 20:
     ErrorLog "logs/example.novaordis.com-error_log"
     ErrorLog "logs/example.novaordis.com-error_log"
</VirtualHost>
</VirtualHost>
</tt>
</pre>
 
=IP:port Pair=
 
<font color=purple><tt>IP</tt> could be *</font>
 
==_default_==
 
Any virtual that includes the _default_ wildcard is given the same ServerName as the main server.

Latest revision as of 19:08, 6 January 2016

External

Internal

Overview

<VirtualHost> and </VirtualHost> are used to enclose a group of directives that only apply to a particular virtual host.

Syntax

<VirtualHost IP:port>
    ServerName example.novaordis.com
    DocumentRoot "/var/www/example.novaordis.com"
    ErrorLog "logs/example.novaordis.com-error_log"
</VirtualHost>

IP:port Pair

IP could be *

_default_

Any virtual that includes the _default_ wildcard is given the same ServerName as the main server.