Hi,
In addition to Miguel's script I wanted to add support for serving static files (images, javascript etc) directly through lighttpd rather than through WAFileLibrary derived objects within Gemstone. I tried to replicate the Apache setup document in the Seaside book:
http://book.seaside.st/book/advanced/deployment/deployment-apache/serving-files If I understand correctly, the configuration makes Apache first look in the file system for the file, if it doesn't find it there it will pass the request on to Seaside.
Unfortunately I couldn't replicate that setup with lighttpd, my best attempt enables me to serve files out of a specified directory - "/files/" - which I think will be adequate. I'm also using lighttpd to prevent access to /config and /tools/ unless the request comes from localhost. By this means I can prevent general access to /config and /tools, but when I connect via an ssh tunnel (see
http://selfish.org/blog/easy%20remote%20gemstone) to my server I can browse localhost and access "/config" and "/tools/"
Here's my configuration - it's mostly based on the defaults. I'm very interested to hear if anyone has other thoughts on static file serving:
server.modules = ( "mod_access", "mod_alias", "mod_accesslog", "mod_fastcgi", "mod_compress")
server.document-root = "/var/www/"
server.errorlog = "/var/log/lighttpd/error.log"
index-file.names = ( "index.html")
accesslog.filename = "/var/log/lighttpd/access.log"
#debug.log-request-handling = "enable"
url.access-deny = ( "~", ".inc" )
server.port = 80
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")
$HTTP["url"] !~ "^/files/" {
# fastcgi.debug=1
fastcgi.server = ("/" =>(
("host" => "127.0.0.1", "port" => 9001, "check-local" => "disable"),
("host" => "127.0.0.1", "port" => 9002, "check-local" => "disable"),
("host" => "127.0.0.1", "port" => 9003, "check-local" => "disable")
)
)
}
$HTTP["url"] =~ "^/config|^/tools/" {
# only allow access if coming through ssh tunneling
$HTTP["remoteip"] != "127.0.0.1" {
url.access-deny = ( "" )
}
}
----
Nick