Installing lighttpd + php5

> apt-get install lighttpd php5-cgi
> /etc/lighttpd/lightly-enable-mod fastcgi [1]
> /etc/init.d/lighttpd restart [4]
Now we can proceed to create a skeleton for your domains. This is so you can reuse it when you are adding new domains. Ignore this if you have just 1 domain.
> cd /etc/skel
> mkdir -p {backup,logs,private,public/uploads} [5]
now every time you create a new domain user, this will create a new structure. If you go to your domain from any browser http://123.45.67.89 you should see a lighttpd page.
> cd /etc/skel/public/uploads
> nano index.html
add in the following:
<h1>Site under maintenance, please come back later</h1> [press crtl-x to exit nano]

Notes:

  1. [1]some blogs say that we should add fastcgi-server={… config. The above was done without problems. perhaps bug fixed.]
  2. so where are my http files? its at /var/www/
  3. some blogs report memory leaks of lightly like a seive. Bahh. add in weekly cron server restart
  4. [4] this will stop 403 errors when you try to access phpmyadmin remotely
  5. [5] if you make a mistake you can use > rm -r xxxx to remove the xxxx directory.