ServerName directive


Purpose

The ServerName directive sets the hostname httpd should return when creating redirection URLs.

This directive should be used on systems where gethostbyname may not work on the local host, or where the hostname returned should be a DNS alias such as www.widget.com.


Syntax

ServerName FQDN

Where FQDN is the full hostname (including domain name) to be returned as the server address.

Only one ServerName directive is allowed in the server configuration file.


Default

If you do not specify a ServerName, httpd retrieves it through system calls.


Example

ServerName www.widget.com

This would set the server's hostname as www.widget.com, as opposed to monster.widget.com as would be returned from the gethostname system call.


Return to Server Configuration File Overview

httpd@ncsa.uiuc.edu