Httpd ServerName: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
If the host does not have a registered DNS name, use the IP address here.
If the host does not have a registered DNS name, use the IP address here.


<tt>ServerName</tt> is also used to configure <tt><VirtualHosts></tt>. It is best to always explicitly list a <tt>ServerName</tt> in every name-based virtual host. If a <tt><VirtualHosts></tt> doesn't specify a ServerName, a server name will be inherited from the base server configuration. If no server name was specified globally, one is detected at startup through reverse DNS resolution of the first listening address. In either case, this inherited server name will influence name-based virtual host resolution, so it is best to always explicitly list a ServerName in every name-based virtual host.
<tt>ServerName</tt> is also used to configure <tt><VirtualHosts></tt>.  
 
It is best to always explicitly list a <tt>ServerName</tt> in every name-based virtual host. If a <tt><VirtualHosts></tt> doesn't specify a ServerName, a server name will be inherited from the base server configuration. If no server name was specified globally, one is detected at startup through reverse DNS resolution of the first listening address. In either case, this inherited server name will influence name-based virtual host resolution, so it is best to always explicitly list a ServerName in every name-based virtual host.

Revision as of 05:27, 6 January 2016

Internal

Overview

ServerName specifies the name and port that the server uses to identify itself. This can often be determined automatically, but it is recommended to be specified explicitly in the configuration file to prevent problems during startup.

If the host does not have a registered DNS name, use the IP address here.

ServerName is also used to configure <VirtualHosts>.

It is best to always explicitly list a ServerName in every name-based virtual host. If a <VirtualHosts> doesn't specify a ServerName, a server name will be inherited from the base server configuration. If no server name was specified globally, one is detected at startup through reverse DNS resolution of the first listening address. In either case, this inherited server name will influence name-based virtual host resolution, so it is best to always explicitly list a ServerName in every name-based virtual host.