HP Open Source Middleware Stacks Blueprints: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES
The following message appears:
This is www.website1.com
In a second browser, enter the following URL:
http://www.website2.com
The following message appears:
This is www.website2.com
Using Apache HTTP Server URL Redirection
The following procedure illustrates the use of the URL redirection feature which allows you to
configure the Apache HTTP server to send requests for one URL to another URL. This requires
the use of two servers that are both running Apache HTTP server.
1. On the first server, create the following directory: /srv/www/htdocs/testdir
2. On the second server, create the following HTML file: /srv/www/htdocs/test.html
3. Add the following lines to the file you created in Step 2:
<HTML>
<HEAD>
</HEAD>
<BODY DIR="LTR">
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif">
<FONT SIZE=6>The URL redirect is successful!</FONT>
</FONT></P>
</BODY>
</HTML>
4. Edit the following configuration file: /etc/apache2/default-server.conf
Add the following line to the preceding file:
Redirect permanent /testdir http://<ANOTHER_WEB_SERVER_IP>/test.html
5. Use the following command to restart your Apache HTTP server, for the preceding changes
to take effect:
# /etc/init.d/apache2 restart
6. Verify that the URL redirect configuration is correct by opening a browser and entering the
following website:
http://<YOUR_WEB_SERVER_IP>/testdir
The following message appears:
The URL redirect is successful!
Using Apache HTTP Server Proxy Features
The proxy features within the Apache HTTP server enable your server to act as a Proxy server
(a network gateway).
The following procedure illustrates the use of URL redirection. The procedure requires the use
of three systems that are all running identical Linux distributions. The first system functions as
an Apache HTTP server, the second functions as the Apache Proxy server, and the third system
is a web client.
1. Start the Apache HTTP server on the first system.
2. On the second system, which acts as the Apache Proxy server, modify the /etc/
sysconfig/apache2 file by appending the following string to the APACHE_MODULES
definition:
proxy proxy_connect proxy_ftp proxy_http
16