Showing posts with label lighttpd. Show all posts
Showing posts with label lighttpd. Show all posts

Saturday, April 11, 2009

Traffic Shaping with Lighttpd + PHP

Here's how I manage traffic on my web site that's served over a basic cable connection. The site has a forum and an area for register members to download stuff from. Having a very limited upload capacity I have to make sure members don't suck everything and make the forum unresponsive.

So here's how my lighttpd.conf file is setup:

# this limits the amount of connection a user can make to the server
evasive.max-conns-per-ip = 10

# then on my site configuration I use a combination of connection.kbytes-per-secon and evasive.max-conns-per-ip to throttle user connections to the download script
$HTTP["host"] =~ "sitegeisha\.dyndns\.dk" {
connection.kbytes-per-second = 64
$HTTP["url"] =~ "dl\.php" {
connection.kbytes-per-second = 32
evasive.max-conns-per-ip = 3
}
}

This configuration allows me to limit the number of simultaneous downloads they can make, if they go over 3 they get a 403 error message.

Tuesday, November 11, 2008

Youtube Cache with Squid + Lighttpd on Ubuntu

This summary is not available. Please click here to view the post.

Tuesday, October 14, 2008

Lighttpd - light and fast web server

I've used IIS, then Apache on windows, then switched to LAMP and now I'm on LLMP and couldn't be much happier! Lighttpd lives up to its name, it is fast and easy on server resources. Learning it wasn't so bad, I actually found plenty of resources on the web and the configuration is actually much simpler than apache, also I didn't have to rely on webmin to configure it now.

Here's how I configured Lighttpd to run on Ubuntu 8.10 Intrepid Ibex with xcache, memcache and mysql.

To be continued...