I ran down the rabbit hole for all of the following configurations :
- Cygwin/lighttpd SCGI/FastCGI: compiling errors on both my dev machine and vmware test.
- InstantRails / SCGI : well, after figuring out how to run production-mode scgi_server as a windows service (details below), I still have trouble getting InstantRails to run as a “service” itself. This is not the fault of InstantRails, and Curt, you get KUDOS KUDOS KUDOS for the work in gettting InstantRails to work at all! (see below for some details on how to auotmate the scgi-as-a-service installation, when you get InstantRails running as a service itself (or at least the apache/mysql servers).
- IIS / FastCGI : 404 error every time. With no log output, there’s nothign to see and nothing to do.. except look elsewhere for a solution!
Here’s the final solution :
- Assuming your’e doing this on a virgin server : install ruby and rails and your rails app.. .test on webrick.
- Install Apache 2 (follow the directions, etc.)… test it for basic functionality “You were expecting your site but you got this page instead”.
- Go to Zed Shaw’s SCGI Rails Runner Howto site.
- Get the scgi gem and install it.
- Get the mod_scgi binary and copy to /modules (that link is assuming Apache 2… Zed has Apache 1 on the site as well.
- Configure /conf/httpd.conf according to the howto. This includes a LoadModule line and a configuration.
- Get srvany.exe kit from vbRad. Expand it to a simple location like C:srvanykit.
- Run C:srvanykitinstsrvw.exe. Follow the wizard. The PATH TO THE APPLICATION.EXE IS : C:srvanykitsrvany.exe. THIS IS REQUIRED. You will configure the actual path to scgi_server in a minute.
- Run regedit. Find the key for your service at :
HKLM/System/CurrentControlSet/Services/ - Add a new key : /Parameters
- Add a new string value : Parameters/Application.
Value = (path-to-ruby) (path-to-scgi_server)
Ie “C:rubybinruby.exe C:rubybinscgi_server” - Add a new string value : Parameters/AppDirectory.
Value = (path-to-rails-app-root)
Ie “D:rails_appscookbook” - Open Service control panel (Start -> Control Panel -> Adminstrative Tools -> Services). Find your service. Start it… should be running!
- Test the rails app: Go to http://localhost.
- If you have a routes issue it needs to be addressed now.
I’ll edit this post with updates as they are necessary.