1. Installation
apt-get install php4-cgi lighttpd phpmyadmin
2. Enable PHP
To get PHP working, run the following command
lighty-enable-mod fastcgi3. Get phpmyadmin running
To configure phpmyadmin, add the following to your lighttpd.conf
alias.url = ( "/phpmyadmin" => "/usr/share/phpmyadmin" )Please note there are no trailing slashes, which enables us to reach phpmyadmin from both of these:
example.com/phpmyadmin
example.com/phpmyadmin/
4. Configure vhosts
I want my site to be reachable from www.example.com and example.com. I also want my users to be able to reach their personal pages, located in ~/public_html, from username.example.com.
This was my solution:
$HTTP["host"] =~ "^(www\.)?example\.com$" {Note I have moved the configuration for phpmyadmin so it can not be reached from the users' subdomains.
evhost.path-pattern = "/var/www/"
alias.url = ( "/phpmyadmin" => "/usr/share/phpmyadmin" )
}
else $HTTP["host"] =~ "example\.com" {
evhost.path-pattern = "/home/%4/public_html/"
}
5. SSL
For added security, run the following in the directory /etc/lighttpd.
lighty-enable-mod sslHope this helps.
openssl req -new -x509 -keyout server.pem \
-out server.pem -days 365 -nodes