Friday, September 28, 2007

How to setup Lighttpd/PHP/MySQL (Ubuntu)

Lighttd is a small memory efficient web server. It is very easy to install, just 6 steps :). These directions are for Ubuntu Linux (Feisty), though should work with any Debian based distro

1) Run:

apt-get install lighttpd php5-cgi php5-mysql mysql-server mysql-client
2) create /etc/lighttpd/conf-available/10-php.conf
server.modules += ( "mod_fastcgi" )
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket",
)))
3) Run:
/usr/sbin/lighty-enable-mod php

4) edit
 /etc/lighttpd/lighttpd.conf
Change
server.bind = "localhost"
to
#server.bind = "localhost"

5) edit /etc/php5/cgi/php.ini
Add
cgi.fix_pathinfo = 1
to the end of the file

6) Run:
/etc/init.d/lighttpd force-reload

No comments: