3.Verify the custom local URL redirect message by opening a browser and entering the following website:

http://<YOUR_WEB_SERVER_IP>/non-exist

The following message appears:

The page you request does not exist! Local redirects example

Customizing External URL Redirect Responses

The URL redirect feature allows you to trap a missing link error (404 error) in a browser on a local server, display a message, and then redirect it to a URL on an external server. The following steps illustrate how to customize external URL redirect responses. The process requires the use of two servers; one that acts as local server, another that acts as an external server. Use the following procedure to customize external URL redirect responses:

1.Edit the following configuration file:

/etc/apache2/errors.conf

In the preceding file, change (or add, if it does not exist already) the following line:

ErrorDocument 404 http://<EXTERNAL_WEB_SERVER_IP>/missing.html

2.Create the following HTML file:

/srv/www/htdocs/missing.html

Populate the preceding file with the following lines:

<HTML>

<HEAD>

</HEAD>

<BODY DIR="LTR">

<P ALIGN=CENTER STYLE="margin-bottom: 0cm"> <FONT FACE="Times New Roman, serif">

<FONT SIZE=6>The page you request does not exist! External redirects example</FONT></FONT></P> </BODY>

</HTML>

3.Verify the custom external URL redirect message by opening a browser and entering the following website:

http://<YOUR_WEB_SERVER_IP>/non-exist

The following message appears:

The page you request does not exist! External redirects example

Using Per-User Web Directories

Using the UserDir function, each user is allowed to have a personal website in their home directory on servers that have multiple users. Visiting a URL with its name in the form http://example.com/~username displays the contents of the home directory of the user.

The following is an example for configuring per-user web directories:

1.Add a user named tester to your server by entering the following commands:

# useradd -m tester

2.Create an HTML file named /home/tester/public_html/index.html that contains the following lines:

<HTML>

<HEAD>

</HEAD>

<BODY DIR="LTR">

26

Page 26
Image 26
HP 5991-5565 manual Using Per-User Web Directories, Populate the preceding file with the following lines