Chapter 22. Apache HTTP Server
342
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
the Apache Software Foundation documentation online at
http://httpd.apache.org/docs/2.2/mod/
mod_rewrite.html
23
.
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
instructions on doing so, refer to
AddHandler
and
Directory
.
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
. 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
Содержание ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION
Страница 22: ...xxii ...
Страница 28: ......
Страница 36: ...10 ...
Страница 40: ...14 ...
Страница 96: ...70 ...
Страница 116: ...90 ...
Страница 144: ...118 ...
Страница 146: ......
Страница 158: ...132 ...
Страница 165: ...Installing and Removing Packages 139 Figure 11 7 Installing and removing packages simultaneously ...
Страница 166: ...140 ...
Страница 172: ...146 ...
Страница 178: ......
Страница 228: ...202 ...
Страница 264: ...238 ...
Страница 318: ...292 ...
Страница 330: ...304 ...
Страница 388: ...362 ...
Страница 428: ...402 ...
Страница 452: ......
Страница 458: ...432 ...
Страница 476: ...450 ...
Страница 478: ...452 ...
Страница 494: ...468 ...
Страница 498: ...472 ...
Страница 530: ...504 ...
Страница 536: ...510 ...
Страница 544: ...Chapter 36 Log Files 518 Figure 36 7 Log file contents after five seconds ...
Страница 546: ......
Страница 550: ...524 ...
Страница 576: ......
Страница 584: ...558 ...
Страница 608: ......
Страница 776: ...750 ...
Страница 796: ...770 ...
Страница 800: ...774 ...
Страница 804: ......
Страница 806: ...780 ...
Страница 808: ...782 ...
Страница 816: ...790 ...
Страница 820: ...794 ...
Страница 822: ...796 ...
Страница 830: ...804 ...
Страница 836: ...810 ...
Страница 844: ...818 ...
Страница 848: ...822 ...