Hi Guys,
I hope someone can help me out. I am trying to configure two
applications to run on lighttpd and each app will have its own domain.
My machine is running on Fedora. When I run my lighttpd with the
following conf file, I get no error but when I check out my app, it
dishes out a 404 error- the 404 being served isn’t the 404 inside the
railsapp/public folder.
Do hope someone can help me out what’s wrong with my conf. Here it is:
server.bind = “0.0.0.0”
server.port = 8282
server.modules = ( “mod_rewrite”, “mod_accesslog”,
“mod_fastcgi”, “mod_compress”, “mod_expire” )
server.pid-file = “/var/run/lighttpd.pid”
url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” =>
“$1.html” )
#commenting the line below gives out an error that says: “a default
document-root has to be set”
server.document-root = “/path/to/rails/app1/public/”
compress.filetype = ( “text/plain”, “text/html”, “text/css”,
“text/javascript” )
#I temporarily commented out the compress and expire methods
#compress.cache-dir = CWD + “/tmp/cache”
#expire.url = ( “/favicon.ico” => “access 3 days”,
“/images/” => “access 3 days”,
“/stylesheets/” => “access 3 days”,
“/javascripts/” => “access 3 days” )
Change *-procs to 2 if you need to use Upload Progress or other tasks
that
need to execute a second request while the first is still pending.
mimetype.assign = (
“.css” => “text/css”,
“.gif” => “image/gif”,
“.htm” => “text/html”,
“.html” => “text/html”,
“.jpeg” => “image/jpeg”,
“.jpg” => “image/jpeg”,
“.js” => “text/javascript”,
“.png” => “image/png”,
“.swf” => “application/x-shockwave-flash”,
“.txt” => “text/plain”
)
Making sure file uploads above 64k always work when using IE or Safari
For more information, see http://trac.lighttpd.net/trac/ticket/360
$HTTP[“useragent”] =~ “^(.MSIE.)|(.AppleWebKit.)$” {
Server.max-keep-alive-requests = 0
server.max-keep-alive-requests = 128
server.max-keep-alive-idle = 30
server.max-read-idle = 60
server.max-write-idle = 360
server.max-fds = 2048
}
$HTTP[“host”] =~ “(^|.)mysite1.com$” {
server.document-root = “/path/to/rails/app1” #notice the public folder
wasn’t stated here
server.errorlog = “/var/log/lighttpd/mysite1.com/error.log”
accesslog.filename = “/var/log/lighttpd/mysite1.com/lighttpd.access.log”
compress.cache-dir = “/path/to/rails/app1/tmp/cache”
server.error-handler-404 = “/dispatch.fcgi”
fastcgi.server = ( “.fcgi” => ( “localhost” => (
“min-procs” => 1,
“max-procs” => 1,
“socket” => “/path/to/rails/app1/tmp/sockets/fcgi.socket”,
“bin-path” => “/path/to/rails/app1/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “development” )
) ) )
}
$HTTP[“host”] =~ “(^|.)mysite2.com$” {
server.document-root = “/path/to/rails/app2”
server.errorlog = “/var/log/lighttpd/mysite2.com/error.log”
accesslog.filename = “/var/log/lighttpd/mysite2.com/lighttpd.access.log”
server.error-handler-404 = “/e404.html”
#compress.cache-dir = “/tmp/cache”
#fastcgi.server = ( “.fcgi” => ( “localhost” => (
“min-procs” => 1,
“max-procs” => 1,
“socket” => “/path/to/rails/app2/tmp/sockets/fcgi.socket”,
“bin-path” => “/path/to/rails/app2/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “development” )
#) ) )
}