Hello.
Since two days I am trying to set up two rails-apps on a vserver-host so
that I can access from work
I tried all I can imagine and what Google/MSN teached me: FastCGI, SCGI,
Lighttpd, Apache, Alias, Vhosts,âŚ
But nothing really works. I am on Debian 3.1 with Ruby 1.8.4, Rails
1.1.2, FastCGI 2.4.0, mod_fastcgi 2.4.2, ruby_fcgi 0.8.6, ruby_gems
0.8.11, Apache 2.0.54, Lighttpd 1.4.11
At last I was really near my favorite solution. So that I can reach:
http://my.server.net/BlackJax
http://my.server.net/tracks
But both Apache AND Lighttpd showed the same problem: Images (and
partly) Stylesheets are not shown. The technique as such works fine.
Interesting: Both show the same errors (example from lighttpd-log,
apache shows the equivalent):
2006-06-04 20:57:10: (response.c.451) â handling physical path
2006-06-04 20:57:10: (response.c.452) Path :
/var/www/images/deck/2d.gif
2006-06-04 20:57:10: (response.c.492) â file not found
I am using Fastcgi/Fcgid while getting this error, SCGI seemed even
messier to me (I only tried SCGI with Apache). For whatever reason it
seems that images are not taken from the (i.e.)
/opt/railsapps/BlackJax/public-folder, but from the servers doc-root.
btw: I did not miss to put
ActionController::AbstractRequest.relative_url_root = â/Blackjaxâ
at the end of environment.rb, I also checked .htaccess
Here the important part of my lighttp.conf:
server.port = 80
server.modules = (âmod_aliasâ, âmod_rewriteâ,
âmod_accesslogâ, âmod_fastcgiâ )
server.document-root = â/var/www/â
url.rewrite = ( â^/$â => âindex.htmlâ, â^([^.]+)$â =>
â$1.htmlâ )
$HTTP[âurlâ] =~ â^/BlackJaxâ {
server.document-root = â/opt/railsapps/BlackJax/public/â
alias.url = ( â/BlackJaxâ => â/opt/railsapps/BlackJax/publicâ )
server.error-handler-404 = â/dispatch.fcgiâ
server.errorlog =
â/opt/railsapps/BlackJax/log/lighttpd.error.logâ
accesslog.filename =
â/opt/railsapps/BlackJax/log/lighttpd.access.logâ
server.indexfiles = ( âdispatch.fcgiâ, âindex.htmlâ )
fastcgi.server = ( â.fcgiâ =>
((
âsocketâ => â/opt/railsapps/BlackJax/log/code.socketâ,
âmin-procsâ => 2,
âmax-procsâ => 2,
âbin-pathâ => â/opt/railsapps/BlackJax/public/dispatch.fcgiâ,
âbin-environmentâ => ( âRAILS_ENVâ => âdevelopmentâ )
)))
}
And here the important part of my http.conf:
NameVirtualHost *:80
FastCgiServer /var/www/BlackJax/public/dispatch.fcgi -initial-env
RAILS_ENV=development -processes 1 -idle-timeout 60
VirtualHost *>
ServerName my.server.net
DocumentRoot /var/www/
RewriteCond %{REQUEST_URI} !^/BlackJax/public
RewriteRule ^/BlackJax(/.*)?$ /BlackJax/public$1
<Directory /var/www/BlackJax/public/>
#ErrorLog /var/www/BlackJax/log/error.log
#CustomLog /var/www/BlackJax/log/access.log combined
SetEnv RAILS_ENV development
AddHandler fcgid-script .fcgi
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
I also tried to take away the rewrite-directives, but without success. I
am lost now⌠The only solution I can see would be to start two
lighttpd on different ports, cause that works
any help is appreciated!
Best regards,
hans-dampf