Httpd ServerName: Difference between revisions
No edit summary |
|||
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
<tt>ServerName</tt> 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. | <tt>ServerName</tt> 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. | ||
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>. | <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. | 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. |
Latest revision as of 17:18, 5 January 2017
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.