</BODY>
</HTML>
4.Edit the following configuration file:
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.Modify the /etc/sysconfig/apache2 file by appending the following string to the APACHE_MODULES definition:
proxy proxy_connect proxy_ftp proxy_http
The APACHE_MODULES definition should now look like the following:
APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user authn_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php5 info status proxy proxy_connect proxy_ftp proxy_http"
3.On the second system, which acts as the Apache Proxy server, edit the following file:
Add the following lines to the preceding file:
ProxyRequests On ProxyVia On
<Proxy *>
Order deny,allow Deny from all Allow from all
</Proxy>
4.Restart the Apache HTTP server, so the Apache Proxy server will take effect on the second system, by entering the following:
#/etc/init.d/apache2 restart
5.Using the benchmarking tool, test the Apache Proxy server using the third system, which acts as the web client:
#ab2
http://<YOUR_WEB_SERVER_IP>/test.html
24