Apr
23
2009

Streamlining a web server on Debian

Just some notes in case I need to do it again (likely!)

Apache can start taking up too much memory if it’s not tuned correctly as it’ll start spawning processes to handle the load. For one of my websites hosted on a Debian Lenny server I needed something that didn’t take up much space and did the basics as part of a LAMP stack.

Enter lighttpd…

apt-get install lighttpd php5-cgi

Make sure the following is in /etc/lighttpd/lighttpd.conf:

server.modules = (

“mod_fastcgi”,

)

..and this is in /etc/lighttpd/conf-available/10-fastcgi.conf

fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php-cgi”,
“socket” => “/tmp/php.socket”,
“max-procs” => 1,
“idle-timeout” => 20,
“broken-scriptfilename” => “enable”,
“bin-environment” => (
“PHP_FCGI_CHILDREN” => “1″,
“PHP_FCGI_MAX_REQUESTS” => “10000″
)
)))
# Allow you to get information on whether the
# server is being over loaded
#
status.statistics-url=”/server-counters”

… and make sure that it’s enabled by putting a symbolic link in /etc/lighttpd.conf-enabled:
ln -s ../conf-available/10-fastcgi.conf

Written by cus in: News |

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Theme: TheBuckmaker.com Professional WordPress Themes | Cheap Hosting, PHP Skript Index