I ran into some trouble trying to install seafile behind lighttpd (as opposed to nginx or apache). Just so other people have a reference I will write up what I did.
First: as far as I can tell almost everything works:
- Webinterface up and downloading for encrypted and unencrypted libraries
- Linux 2.0 and Macos 1.8 desktop clients with encrypted and unencrypted libraries
- Android client for unencrypted libraries or encrypted libraries that are currently open in a browser
What does not work:
- Android for encrypted libraries that are not currently open in a browser.
I used the following configuration, seafile runs on the vhost "seafile.mail", which is also added to the seafile and ccnet config files as in the apache tutorial. For rewriting together with proxying there needs to be an additional vhost running on another port because lighttpd 1.4.28 does not support rewrite-then-conditional-proxy natively.
For lighttpd I converted the apache configs as best I could to lighttpd. I came up with the following config for seafile. You should also load the proxy, fastcgi, rewrite modules in your lighttpd config. Hope my results help somebody to get it setup more quickly than I did.
For rewrite:
$HTTP["host"]=~"seafile.mail" {
url.rewrite-once += (
"^/seafhttpd(.*)$" => "$1",
)
url.rewrite+= (
"^(media.*)$" => "$1"
)
url.rewrite-if-not-file += (
"^(.*)$" => "/seahub.fcgi$1"
)
}
For fastcgi:
$HTTP["host"]=~"seafile.mail" {
fastcgi.server+=( "/seahub.fcgi" =>
(( "host"=>"127.0.0.1",
"port"=>"8000",
"check-local"=>"disable",
"allow-x-send-file"=>"enable"
))
)
}
For alias:
$HTTP["host"]=~"seafile.mail" {
alias.url += (
"/media" => "<dir of seafile server>/seahub/media",
)
}
For proxy (notice the dirty fix for the rewriting):
$HTTP["host"]=~ "seafile.mail" {
accesslog.filename= "/var/log/lighttpd/accesslog_seafile"
$HTTP["url"] =~ "(^/seafhttp)" {
proxy.server = ( "" => (
"webapp:80" => # name
( "host" => "127.0.0.1",
"port" => 81
)
)
)
}
}
# Part for proxy listening on port 81
$SERVER["socket"] == ":81" {
url.rewrite-once = ( "^/seafhttp(.*)$" => "$1" )
proxy.server = ( "" => (
"webapp:81" => # name
( "host" => "127.0.0.1",
"port" => 8082
)
)
)
}
Finally as I want to use SSL:
$HTTP["scheme"] == "http" {
$HTTP["host"]=~ ".*" {
url.redirect += ("^/sea.*" => "https://%0$0")
}
}