I took a decision to use the excellent CMS, DotClear, because it is light (which for me means it will run on Lighty without MySQL) and feature rich (which for me means it can handle multiple websites).
This document sets out how to configure Lighty to work with multiple DotClear blogs/sites based on the DotClear blog id. This saves a great deal of time and effort. The DotClear documentation covers how to do it for Apache, here is the method for Lighty. Actually setting up DotClear is not covered here. Please see the documentation on the DC site for that.
Ensure that the “mod_setenv” module is enabled under the modules section of your Lighty config file. With Debian it's /etc/lighttpd/lighttpd.conf:
server.modules = (
"mod_access",
"mod_alias",
...
"mod_setenv",
)
Also ensure that the following modules: auth, cgi, and fastcgi are enabled. In Debian use lighttpd-enable-mod for that, for example:
# lighttpd-enable-mod fastcgi
Install DotClear and ensure it works. In our example we'll assume it's installed in /var/www/htdocs/dotclear.
Once it is installed and the main site works you may add a new site by first creating a symlink in your document root to the DotClear folder:
# ln -s /var/www/htdocs/dotclear /var/www/htdocs/blog1
Add something like this to the host section of your Lighty config file (/etc/lighttpd/lighttpd.conf in Debian):
$HTTP["host"] == "blog1.yoursite.com" {
server.document-root = "/var/www/htdocs/blog1"
accesslog.filename = "/some/place/wwwlogs/blog1.yoursite.access.log"
setenv.add-environment = ( "DC_BLOG_ID" => "blog1" )
}
You may also want to add support for DotClear's clean URLs (see full howto here) so that it looks like this:
$HTTP["host"] == "blog1.yoursite.com" {
server.document-root = "/var/www/htdocs/blog1"
accesslog.filename = "/some/place/wwwlogs/blog1.yoursite.access.log"
setenv.add-environment = ( "DC_BLOG_ID" => "blog1" )
var.dc_base = ""
url.rewrite-once = (
"^/(admin)/(.*)$" => "/$1/$2",
"^/(xmlrpc|category|post)/(.*)$" => "/index.php/$1/$2",
"^/(sitemap.xml|urllist.txt)$" => "/index.php/$1",
"^/([^\?]*)\.(.*)" => "/$0",
"^/(.*)$" => "/index.php/$1"
)
}
Create a new blog in DotClear in the admin area under SYSTEM:Blogs: then choose “Creat new blog”.
In the “Blog ID” field put the same value you had entered for the “DC_BLOG_ID” value in the “setenv.add-environment” section above, in our case that would be “blog1”.
Next choose your blog name in the “Blog name” field.
Then put your URL in the “Blog URL” field, in our case: “blog1.yoursite.com”
Next click “save” and your new blog should be working.
Repeat steps two to four with new values as needed. Such as:
In step two create a symlink:
# ln -s /var/www/htdocs/dotclear /var/www/htdocs/coolblog
In step three:
$HTTP["host"] == "coolblog.yoursite.com" {
server.document-root = "/var/www/htdocs/coolblog"
accesslog.filename = "/some/place/wwwlogs/coolblog.yoursite.access.log"
setenv.add-environment = ( "DC_BLOG_ID" => "coolblog" )
And in step four:
put “coolblog” in the “Blog ID” field and “coolblog.yoursite.com” in the “Blog URL” field and save.