20/01/10 To configure, edit httpd.conf - Directives and comments - After editing, restart server to take effect Basic set of directives - Listen: specifies IP address(es) and/or port number(s) - ServerName: in simplest case, specifies the hostname Why does the server need to know the server name? - clients can include the name in requests for name-based virtual hosts - server can inlude the name in responses for redirects. If omitted, server will automatically ask DNS to perform reverse DNS lookup: from server's IP address to hostname. But there may be problems with this (e.g. if server has more than one IP address, or if DNS is down). Hence, better to specify it explicitly. - User, Group E.g. User webserv Group webserv In practice, server is run as root. But this gives it full privileges, which is risky (e.g. if a module is buggy or malicious). So it starts as root, then creates child processes to handle requests. The child processes run as this User and Group (e.g. webserv), which has lower privileges. - ServerAdmin Email address that can be included in Apache error pages. - ServerRoot If Apache hasn't been installed in default location (/usr/local/apache/), this directive says where it has been installed. - ErrorLog, TransferLog A relative pathname (relative to ServerRoot) where logs will be kept. - DocumentRoot Common to move the web site out of ServerRoot to some other part of the filesystem. This directive says where it is. When a client request arrives, the pathname in the URL is translated into an actual pathname in the filesystem by prepending the DocuemtRoot.