I have a rails app on a debian server running lighttpd and I’m trying to
set up typo so that it also works (with a different url). I have 4 URLs
running – let’s call them foo.com, bar.com, www.typo.com and
php.typo.com
I am starting lighttpd by going into the directory where my foo.com app
is and typing either ruby script/server or script/server -e production
– either way the results I get are:
foo.com works (rails app)
bar.com works (non rails app … just html but will have a rails app
later)
php.typo.com works (phpmyadmin for mysql)
www.typo.com shows me foo.com with broken images instead of typo
Not sure why that’s happening… can somebody help? I am posting my
lighttpd.conf file but I’m not sure if this is where my error is. FWIW
I have already set up a database called typo using php.typo.com.
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_proxy",
"mod_accesslog",
"mod_access",
"mod_fastcgi",
"mod_compress",
"mod_accesslog" )
server.document-root = "/var/www"
server.bind = "0.0.0.0"
server.port = 80
server.pid-file = "/var/run/lighttpd.pid"
server.tag = "lighttpd"
accesslog.filename = "/var/log/lighttpd.access.log"
server.errorlog = "/var/log/lighttpd.error.log"
server.indexfiles = ( "index.php", "index.html", "index.htm",
"default.
htm" )
url.access-deny = ( "~", ".inc" )
$HTTP["host"] == "php.typo.com" {
accesslog.filename = "/var/log/lighttpd.php.access.log"
server.document-root = "/var/www/phpmyadmin"
server.indexfiles = ( "index.php", "index.html",
"index.htm", "def
ault.htm" )
fastcgi.server = (
".php" =>
( "localhost" =>
(
"socket" => "/tmp/php4-fcgi.socket",
"bin-path" => "/usr/bin/php4-cgi -c
/etc/php4/cgi/php.ini",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "32",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
}
# Rails site, I want this on www or no www
$HTTP["host"] == "www.bar.com" {
server.port = 80
server.document-root = "/var/www/bar/public"
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "index.php", "index.html", "index.htm",
"defaul
t.htm" )
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
fastcgi.server = (
".fcgi" => (
"localhost" => (
"socket" => "log/fcgi.socket",
"bin-environment" => ( "RAILS_ENV" => "development" ),
"bin-path" => "public/dispatch.fcgi",
# "max-load-per-proc" => 4,
"min-procs" => 1,
"max-procs" => 4,
# "idle-timeout" => 60
)
)
)
}
# Railfood vhost
$HTTP["host"] == "www.foo.com" {
server.port = 80
server.document-root = "/var/www/foo/public"
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "index.php", "index.html", "index.htm",
"defaul
t.htm" )
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
fastcgi.server = (
".fcgi" => (
"localhost" => (
"socket" => "log/fcgi.socket",
"bin-environment" => ( "RAILS_ENV" => "development" ),
"bin-path" => "public/dispatch.fcgi",
# "max-load-per-proc" => 4,
"min-procs" => 1,
"max-procs" => 4
# "idle-timeout" => 60
)
)
)
}
$HTTP["host"] == "www.typo.com" {
server.port = 80
server.document-root = "/var/www/typo/public"
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "index.php", "index.html", "index.htm",
"defaul
t.htm" )
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
fastcgi.server = (
".fcgi" => (
"localhost" => (
"socket" => "log/fcgi.socket",
"bin-environment" => ( "RAILS_ENV" => "production" ),
"bin-path" => "public/dispatch.fcgi",
# "max-load-per-proc" => 4,
"min-procs" => 1,
"max-procs" => 4
# "idle-timeout" => 60
)
)
)
}
mimetype.assign = (
".pdf" => "application/pdf",
".css" => "text/css",
".gif" => "image/gif",
".htm" => "text/html",
".html" => "text/html",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".js" => "text/javascript",
".png" => "image/png",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".txt" => "text/plain"
)