Apache SCGI Config Instructions

datePosted on 15:48, May 18th, 2007 by Peter Fitzgibbons

Configuring Apache and SCGI on Win2003

  1. Assuming your’e doing this on a virgin server : install ruby and rails and your rails app.. .test on webrick.
  2. Install Apache 2 (follow the directions, etc.)… test it for basic functionality “You were expecting your site but you got this page instead”.
  3. Go to Zed Shaw’s SCGI Rails Runner Howto site.
  4. Get the scgi gem and install it.
  5. Get the mod_scgi binary and copy to /modules (that link is assuming Apache 2… Zed has Apache 1 on the site as well.
  6. Configure /conf/httpd.conf according to the howto. This includes a LoadModule line and a configuration.
  7. Get srvany.exe kit from vbRad. Expand it to a simple location like C:\srvanykit.
  8. Run C:\srvanykit\instsrvw.exe. Follow the wizard. The PATH TO THE APPLICATION.EXE IS : C:\srvanykit\srvany.exe. THIS IS REQUIRED. You will configure the actual path to scgi_server in a minute.
  9. Run regedit. Find the key for your service at :
    HKLM/System/CurrentControlSet/Services/
  10. Add a new key : /Parameters
  11. Add a new string value : Parameters/Application.
    Value = (path-to-ruby) (path-to-scgi_server)
    Ie “C:\ruby\bin\ruby.exe C:\ruby\bin\scgi_server”
  12. Add a new string value : Parameters/AppDirectory.
    Value = (path-to-rails-app-root)
    Ie “D:\rails_apps\cookbook”
  13. Open Service control panel (Start -> Control Panel -> Adminstrative Tools -> Services). Find your service. Start it… should be running!
  14. Test the rails app: Go to http://localhost.
  15. If you have a routes issue it needs to be addressed now.