Using Apache As A Proxy Server (
Page 1 of 7 )
Apache isn't just the planet's most popular Web server - it's
also one heck of a proxy server. This article explores the process of
installing and configuring Apache to act as a proxy server for your
network, demonstrating how it can be used to cache frequently-accessed
Web sites, log Internet access and block offensive domains, in addition
to serving up Web content. Talk about getting two servers for the price
of one!Unless you've been cryogenically frozen for the last twenty years, you probably
already know what Apache is. It's the planet's most popular Web server, with a
humongously-high number of Web sites relying on it to serve up content in a
reliable and efficient manner. It has an enthusiastic fan following, an active
development community, and the love and loyalty of millions of Webmasters all
over the planet.
The cool thing about Apache, though, is that it's not
just a Web server. It can do lots of other things too - and of its more
interesting (though less well-known) capabilities includes the ability to act as
a proxy server for both HTTP and FTP connections over a network.
If you
didn't know about this, but are intrigued by the possibilities it opens up, or
if you just want to take your Apache skills to the next level ("hey, Joe, did
you know that you could use Apache to restrict certain machines on your network
from accessing playboy.com?"), you've come to the right place. Over the next few
pages, I'll be exploring Apache's proxy module, guiding you through the process
of installing, configuring and using it. Keep reading.{mospagebreak title=A
Little Drool} First of all, the basics. What's a proxy, and why do you
care?
A proxy is a piece of software that supports sending and receiving
data on behalf of another application. It's an intermediate layer on your
network that receives requests from within the networks, forwards them to the
appropriate host, reads the response, and sends the response back to the
requesting host or application within the network.
By functioning as a
gateway to the public Internet, a proxy makes for more secure networks, and also
allows multiple hosts on a network to share a single public IP address. So, if
you have an office network consisting of multiple workstations, but only a
single Internet connection, you can use a proxy to provide Internet access to
all the workstations using the single IP address and single
connection.
Since a proxy effectively carries the weight of serving all
Internet traffic for a network, it can also be used to do a couple of other
things. The first (and most interesting) is that it can substantially speed up
your Internet activity by caching, or locally saving, copies of
frequently-accessed Web pages, and using these cached copies to serve client
requests. This reduces latency, cuts down on Internet connectivity charges, and
results in a more positive user experience - all usually considered good
things.
A proxy can also be used to monitor Internet traffic flowing in
and out of a network, logging all requests in order to gain a better
understanding of how the Internet is being used; this data can be very useful,
especially in corporate environments. And in the event that the data analysis
reveals that most of the employees are goofing off, wasting time and Internet
packets on online comic strips or mind-numbing MUDs, a proxy can even be
configured to block access to certain sites, or block certain workstations for
accessing the Web.
If you're a network administrator, the thought of all
this power probably has you drooling. Wipe it up, and let's get
started.