2.3.130 ServerName
ServerName specifies the server name and the port number of the web server.
Description
ServerName specifies the server name and the port number of the web server.
According to the specified value in the UseCanonicalName directive, the server name that can be accessed from the client must be specified because requests such as those using image maps or those that have a directory specified without a forward slash (/) at the end are sent back to the client when a redirect is ordered from the web server and the redirect destination is set to the Location header. This directive must be specified.
Syntax
ServerName server_name[:port_number]
Specifiable values
- server_name
-
Specify a FQDN (fully qualified domain name) or an IP address.
For server_name, you can also specify an IPv6 address or a FQDN that corresponds with an IPv6 address.
If an IPv6 address is specified, and if you want to specify the port number, enclose the IPv6 address in square brackets ([ ]).
- port_number
-
Specify the port number of the web server.
When the port number is omitted, the default port number is set (80 when SSL is disabled, and 443 when SSL is enabled).
Locations where it can be written
httpsd.conf, <VirtualHost>
Example
ServerName www.example.com ServerName 2001::123:4567:89ab:cdef ServerName [2001::123:4567:89ab:cdef] ServerName [2001::123:4567:89ab:cdef]:8080