1. Lighttpd works fine so long as you provide a custom config. Add the following to lighttpd.conf BEFORE installing Silverstripe. Replace “yoursite.com” and ”/home/yoursite/public_html/” below.
$HTTP["host"] == "yoursite.com" {
server.document-root = "/home/yoursite/public_html/"
# Disable directory listings
dir-listing.activate = "disable"
# Deny access to template files
url.access-deny += ( ".ss" )
static-file.exclude-extensions += ( ".ss" )
# Deny access to Sapphire command-line interface
$HTTP["url"] =~ "^/sapphire/cli-script.php" {
url.access-deny = ( "" )
}
# Disable FastCGI in assets directory (so that PHP files are not executed)
$HTTP["url"] =~ "^/assets/" {
fastcgi.server = ()
}
# Rewrite URLs so they are nicer
url.rewrite-once = (
"^/.*\.[A-Za-z0-9]+.*?$" => "$0",
"^/(.*?)(\?|$)(.*)" => "/sapphire/main.php?url=$1&$3"
)
# Show SilverStripe error page
server.error-handler-404 = "/sapphire/main.php"
}
Rewrite rules do not check for file existence as they do on Apache. There is a ticket about it for Lighttpd: http://redmine.lighttpd.net/issues/985.
2. Extract the SilverStripe software to your lighttpd installation, and run http://yoursite.com/install.php and the installation should proceed normally.
Running multiple installations of Silverstripe on the same host is a bit more tricky, but not impossible. I would recommend using subdomains instead if you can, for exampe: site1.yourdomain.com and site2.yourdomain.com, it makes things a lot simpler, as you just use two of the above host example blocks. But if you really must run multiple copies of Silverstripe on the same host, you can use something like this (be warned, it's quite nasty):
$HTTP["host"] == "yoursite.com" {
url.rewrite-once = (
"(?i)(/copy1/.*\.([A-Za-z0-9]+))(.*?)$" => "$0",
"(?i)(/copy2/.*\.([A-Za-z0-9]+))(.*?)$" => "$0",
"^/copy1/(.*?)(\?|$)(.*)" => "/copy1/sapphire/main.php?url=$1&$3",
"^/copy2/(.*?)(\?|$)(.*)" => "/copy2/sapphire/main.php?url=$1&$3"
)
$HTTP["url"] =~ "^/copy1/" {
server.error-handler-404 = "/copy1/sapphire/main.php"
}
$HTTP["url"] =~ "^/copy2/" {
server.error-handler-404 = "/copy2/sapphire/main.php"
}
}
Note: It doesn't work properly if the directory name copy1 or copy2 on your server has a dot in it, and you then open the image editor inside admin, I found that out the hard way when using a directory name of silverstripe-v2.2.2 after directly unzipping the Silverstripe tarball leaving the name as is. I haven't found a solution for that yet, but for now this method still works properly if you just don't use dots in the directory names.
Learn more about the lighttpd webserver at http://www.lighttpd.net/
Please use comments for notes, tips and corrections about the described
functionality.
Use the Silverstripe Forum to
ask questions.