Apache isn't just the planet's most popular Web server - it'salso one heck of a proxy server. This article explores the process ofinstalling and configuring Apache to act as a proxy server for yournetwork, demonstrating how it can be used to cache frequently-accessedWeb sites, log Internet access and block offensive domains, in additionto serving up Web content. Talk about getting two servers for the priceof one!
If you're in charge of running a small office network, you might find Apache's built-in proxy server and caching features fairly useful, especially if all you're looking for is a simple, efficient solution.
The proxy server is great for enabling Internet connection sharing across multiple networked workstation, and can also add to your peace of mind by providing an additional layer of security to your network. It also provides you with more control over Internet usage, allowing you to restrict access to "bad" sites, and control which workstations have access to the Internet. Finally, its logging facilities allow you to monitor Internet usage, providing you with useful feedback on the performance of your network.
The caching features can also come in handy, especially if your users tend to visit the same set of sites on a regular basis. By using the cached copies, Apache's proxy server can reduce bandwidth consumption, enhance user perception of network performance, and reduce Internet costs.
Of course, when all is said and done, the Apache proxy server will always play second fiddle to the Web server, which still gets the lion's share of the attention. If you're looking for a practical, robust and efficient solution, and your requirements aren't too complicated, Apache's proxy server will probably work for you. If, on the other hand, you're looking for more advanced features (like access control lists, more detailed logging and so on), you should consider using squid, which has to be one of the most powerful, full-featured proxy servers out there today.
I'll be discussing squid in a separate article soon - but, until then, feast on the following links:
Note: All examples in this article have been tested on Linux/i686 with Apache 1.3 and Apache 2.0. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!