200
13.3.27 ServerName
You can use ServerName to set a hostname for your server which is different from your host's real
name. For example, you might want to use www.your_domain.com when your server's real name is
actually foo.your_domain.com. Note that the ServerName must be a valid Domain Name Service
(DNS) name that you have the right to use (do not just make something up).
If you do specify a ServerName, be sure its IP address and server name pair are included in your
/etc/hosts file.
13.3.28 DocumentRoot
The DocumentRoot is the directory which contains most of the HTML files which will be served in
response to requests. The default DocumentRoot for both the non-secure and secure Web servers
is /var/www/html. For example, the server might receive a request for the following document:
http:// your_domain /foo.html
The server will look for the following file in the default directory:
/var/www/html/foo.html
If you want to change the DocumentRoot so that it is not shared by the secure and the non-secure
Web servers, see Section 13.5, Using Virtual Hosts.
13.3.29 Directory
<Directory /path/to/directory> and </Directory> tags are used to enclose a group
of configuration directives that are meant to apply only to that directory and all of its subdirectories.
Any directive which is applicable to a directory may be used within <Directory> tags. <File>
tags can be used in the same way, to apply to a specific file or files.
By default, very restrictive parameters are applied to the root directory, using the Options (see Sec-
tion 13.3.30, Options ) and AllowOverride (see Section 13.3.31, AllowOverride ) direc-
tives. Under this configuration, any directory on your system which needs more permissive settings
has to be explicitly given those settings.
Using Directory tags, the DocumentRoot is defined to have less rigid parameters, so that HTTP
requests can be served from it.
The cgi-bin directory is set up to allow the execution of CGI scripts, with the ExecCGI option. If
you need to execute a CGI script in another directory, you will need to set ExecCGI for that directory.
For example, if your cgi-bin is /var/www/cgi-bin, but you want to execute CGI scripts from
within /home/my_cgi_directory, add an ExecCGI directive to a set of Directory direc-
tives like the following to your httpd.conf file:
Chapter 13:Apache
Need help?
Do you have a question about the LINUX 7.2 and is the answer not in the manual?