ServerName Directive

Top - Docs - General - Server - Resource - Access - FAQ - Tutorials

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.


Virtual Host

This directive is valid in virtual host configuration.


Default

If you do not specify a ServerName, HTTPd attempts to retrieve 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.


[Back] Return to Server Configuration File Overview
NCSA HTTPd Development Team / httpd@ncsa.uiuc.edu / 10-02-95