Red Hat ENTERPRISE LINUX 5 - DEPLOYMENT Deployment Manual page 368

Hide thumbs Also See for ENTERPRISE LINUX 5 - DEPLOYMENT:
Table of Contents

Advertisement

Chapter 22. Apache HTTP Server
Redirect
When a webpage is moved, Redirect can be used to map the file location to a new URL. The format
is as follows:
Redirect /<old-path>/<file-name> http://<current-domain>/<current-path>/<file-name>
In this example, replace <old-path> with the old path information for <file-name> and
<current-domain> and <current-path> with the current domain and path information for
<file-name>.
In this example, any requests for <file-name> at the old location is automatically redirected to the
new location.
For more advanced redirection techniques, use the mod_rewrite module included with the
Apache HTTP Server. For more information about configuring the mod_rewrite module, refer to
http://httpd.apache.org/docs/2.2/mod/
the Apache Software Foundation documentation online at
23
mod_rewrite.html
.
ScriptAlias
The ScriptAlias directive defines where CGI scripts are located. Generally, it is not good practice
to leave CGI scripts within the DocumentRoot, where they can potentially be viewed as text
documents. For this reason, a special directory outside of the DocumentRoot directory containing
server-side executables and scripts is designated by the ScriptAlias directive. This directory is
known as a cgi-bin and is set to /var/www/cgi-bin/ by default.
It is possible to establish directories for storing executables outside of the cgi-bin/ directory. For
AddHandler
and Directory.
instructions on doing so, refer to
ServerAdmin
Sets the ServerAdmin directive to the email address of the Web server administrator. This email
address shows up in error messages on server-generated Web pages, so users can report a problem
by sending email to the server administrator.
By default, ServerAdmin is set to root@localhost.
A common way to set up ServerAdmin is to set it to webmaster@example.com. Once set, alias
webmaster to the person responsible for the Web server in /etc/aliases and run /usr/bin/
newaliases.
ServerName
ServerName specifies a hostname and port number (matching the Listen directive) for the server.
The ServerName does not need to match the machine's actual hostname. For example, the Web
server may be www.example.com, but the server's hostname is actually foo.example.com. The
value specified in ServerName must be a valid Domain Name Service (DNS) name that can be
resolved by the system — do not make something up.
The following is a sample ServerName directive:
23
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
342

Advertisement

Table of Contents
loading

Table of Contents