Lighttpd

HOWTO: Lighttpd + PHP
Install the packages we need: (this may not be all, but these two will automatically download the rest as dependencies)

sudo aptitude install lighttpd php5-cgi

Enable the fastcgi module and the php configuration with

sudo lighty-enable-mod fastcgi sudo lighty-enable-mod fastcgi-php

Reload the lighttpd daemon

sudo service lighttpd force-reload

To test if it's working create the file /var/www/index.php with the following contents:



Thanks - https://wiki.ubuntu.com/Lighttpd+PHP

HOWTO: SSL Secure Certificate
$SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = var.confdir + "/STAR_domain_com.pem" ssl.ca-file = var.confdir + "/BundleCA.crt" ssl.use-sslv2 = "disable" ssl.use-sslv3 = "disable" ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" }
 * 1) ssl.use-compression = "disable"
 * 1) ssl.honor-cipher-order = "enable"
 * 2) ssl.cipher-list = "AES256+EECDH:AES256+EDH:!aNULL:!eNULL"

HOWTO: Password Protect Directory
Add the authentication module...

"mod_auth",

Add the following lines to your main configuration file or separate virtual host file...

$HTTP["remoteip"] !~ "(127.0.0.1|192.168.0.*)" { auth.debug = 2 auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/etc/lighttpd/.htpasswd" auth.require = ( "/webmail/" =>               ( "method" => "basic", "realm" => "Webmail Access", "require" => "valid-user", )             ) }
 * 1) $HTTP["remoteip"] !~ "(127.0.0.1)" {

HOWTO: Allow Directory Listing
Add the following line to your main configuration file or separate virtual host file...

server.dir-listing = "enable"

...or...

$HTTP["url"] =~ "^/files($|/)" { server.dir-listing = "enable" }

Official Web Page - http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModDirlisting

Thanks - http://www.cyberciti.biz/tips/howto-lighttpd-enable-disable-directory-listing.html

HOWTO: Set File Mime Type For Downloads
mimetype.assign += ( ".log" => "text/plain" )