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
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com







Recent comments
20 hours 22 min ago
21 hours 50 min ago
1 day 1 hour ago
1 day 4 hours ago
1 day 7 hours ago
1 day 7 hours ago
1 day 8 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 10 hours ago