Reduce Apache's Load With lighttpd On Debian Etch
|
Submitted by axman (Contact Author) (Forums) on Thu, 2008-02-07 12:32. :: Debian | Apache | Lighttpd
Reduce Apache's Load With lighttpd On Debian EtchLighttpd, sometimes pronounced "Lighty", is a lightweight HTTP server that can help alleviate Apache's load by serving static content. Since Lighttpd uses less resources per request than Apache, it generally serves most static content faster than Apache. This tutorial shows how to install Lighttpd behind Apache via Apache´s proxy module. No guarantee that this will work for you!
1 RequirementsTo install such a system you will need the following:
2 Setting up lighttpdOnce Lighttpd is installed, you'll have to modify the configuration file to use it vi /etc/lighttpd/lighttpd.conf #bind to port (Default: 80) server.port = 81 # bind to localhost (recommended for proxy behind Apache, otherwise comment this out for all) server.bind = "localhost"This is not a full listing of the configuration file, but rather a highlight of the most important parts. Notice that we've set the server port to 81. By doing this, we're making sure it doesn't clash with Apache listening on port 80. If you wanted to let Lighttpd power your entire site instead of Apache, you can set this to port 80, or comment it out to accept the default. Then we restart Lighttpd: /etc/init.d/lighttpd restart
3 Setting up Apache's proxyTo let Apache take the output of Lighttpd on port 81 and map it to your website,
you'll need to make sure the Proxy module of Apache is loaded.
a2enmod proxy_http If you are using virtual hosting, you will want to use the following code to
set up a proxy between the applicable ProxyRequests Off ProxyPreserveHost On ProxyPass /media http://0.0.0.0:81/ ProxyPassReverse / http://0.0.0.0:81/ Then we restart Apache: /etc/init.d/apache2 reload
4 Final notice In the above example, Lighttpd will serve up your media folder, leaving Apache
to do the rest. Set this to any folder that has static content in it and Lighttpd
will serve it, instead of Apache. Another good use of Lighttpd would be to serve
up multimedia files, taking the load off of Apache. The increase of performance
you'll gain is dependent on many factors. If you only have Lighttpd serve up
your images, it probably won't help too much. You can put all of your static
content, including HTML and PDF files, images, and movies in a folder called
/static and then set the ProxyPass variable to that for a slightly better performance.
5 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning







Recent comments
5 hours 24 min ago
7 hours 25 min ago
10 hours 37 min ago
12 hours 56 min ago
14 hours 6 min ago
15 hours 24 min ago
19 hours 28 min ago
23 hours 1 min ago
23 hours 13 min ago
1 day 14 hours ago