Installation / Can't reach site / Not functioning

Topics: User Forum
Jan 21, 2007 at 12:24 AM
Hi there,

I am very hopeful for this IIS Fast-CGI program. It sounds great and like it will really streamline the whole process of setting up a RoR's site with Windows server. Great job to you guys who have made this.

However, that being said I am having some problems getting our RoR's app to run on the Windows 2003 server that we have set up.

I had installed ruby and installed rails, generated our site and it worked through webrick. Then I installed the Rails for IIS Fast-CGI. When I navigate to our site I just get a blank white page.

One question, when the program creates the new site in the IIS should we have the "Default site" disabled?

I would sincerely appreciate any assistance or direction to get this resolved. Any deep documentation I could go through? Thanks again!

Darren
Jan 22, 2007 at 7:46 PM
I'm using IIS 6.0/Windows Server 2003

After installing either manually or using the latest version of the installer, all I get is a directory listing of the application's public directory. FCGI/Ruby is being completely ignored.

I really need this rails app to work under IIS, please help :(.

Mike
Coordinator
Jan 22, 2007 at 11:31 PM
Assuming your application works in webrick, do the following tasks:

1) Open up your TaskManager (TaskMgr.exe)
2) Restart IIS
3) Open up a web browser pointed to your application.
4) Look in the task manager, verify that FCGI starts N rubyw.exe processes where N is the number in the registry key HKLM/Software/FastCGI/.fcgi

If you do not see any rubyw.exe processes spawned, there could be a few things wrong.
1) Under IIS MMC snapin -> Web Service Extensions, verify the Isapi-FCGI extension's status is "allowed" (only applicable to server 2003)
2) If your application writes log files, make sure the NETWORK SERVICE account has write privledges to the file(s).
3) Verify the .fcgi extension mapping exists for the newly created website and is pointing to your C:\WINDOWS\system32\inetsrv\isapi_fcgi.dll file.
4) Verify the rewrite isapi filter is pointing to C:\WINDOWS\system32\inetsrv\isapirewrite4.dll file.
5) Make sure your NETWORK SERVICE account has execute permissions for both isapi_fcgi.dll and isapirewrite4.dll.
6) Make sure the file C:\WINDOWS\system32\libfcgi.dll exists and has execute permissions for NETWORK SERVICE.
7) Verify both C:\WINDOWS\system32\msvcp71.dll and C:\WINDOWS\system32\msvcr71.dll exists.

Another thing to try is putting a simple index.htm file containing a single line "test IIS works" and trying to browse to just a standard html file, if this doesn't work, I won't be able to help you much because it would seem IIS wasn't even running.

Hope this helps guys,
Brent
Feb 21, 2007 at 12:56 AM
Making sure that the your rails application log directory can be written to by the NETWORK SERVICE seemed to have fixed a similar problem for me.

I might also recommend Process Explorer to see if rubyw.exe is running:

http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx

I couldn't see it properly in the regular task manager.
Coordinator
Feb 21, 2007 at 8:24 PM
After restarting IIS, open up task manager and click the processes tab.
Open up a browser and query your website http://localhost:port etc.
You should see rubyw.exe processes spawn in the process list of task manager. If those processes dissapear, consult the documentation for manual IIS configuration. I am in the process of getting this update on the wiki for this site.
B
Apr 2, 2007 at 1:54 AM
Brent,

Hi there. Found your utility a couple of days ago -- looked like exactly what I was searching for! I tried installing (both manually and via the wizard), but am running into the dreaded "Server Error, unable to connect to fastcgi server" problem.

My configuration is:

Laptop running Win XP SP2
MS IIS 5.1 clean install right off the XP CD
Rails 1.2
Ruby 1.8.5

What does work:

IIS can serve up content prior to the install - I tested it.
After the install IIS can still serve up a simple static HTML page I created in \public
My simple 2 page Rails app (no database access) does run on Mongrel/Webrick

What I see happening (by looking at task manager) is that when I try to run a page in the rails app thru IIS, I see the 3 rubyw.exe processes start up, climb up to about 28mg of memory usage and then disappear and I receive the Server Error, unable to connect to fastcgi server message. Looking thru your earlier posts and those of DorjeM at http://dorjem.blogspot.com/2007/02/to-setup-rails-on-iis-and-enable-it-for.html everything points to permissions problem, but I cannot seem to get past it.

On the \log and \tmp directories I added the NETWORK SERVICE account and gave it "full control" -- by right clicking on the folder, selecting the security tab, clicking add, advanced, find now and selecting NETWORK SERVICE from the list. However, when I tried using the same procedure to add execute privileges to the DLLs (libfcgi.dll, isapifcgi.dll and IsapiRewrite4.dll) again, by clicking on the dll, drilling down to select NETWORK SERVICE, that account does not appear in the list(?). I did go ahead and add the IWAMPCG account and gave it full control (I think this is the account IIS installs to run a process under). Anyway, it still did not fix the problem.

Any thoughts, ideas, things to try? I would REALLY appreciate any help!

Thanks,

Joe


Coordinator
Apr 17, 2007 at 9:48 PM
Hey Joe,

First off, let me appologize for not getting back quicker, I have been pretty busy and haven't checked the site in a while (Codeplex Feature Request - global thread post setting that enables admins to register for ALL thread posts by default)

Hmmm, the first thing I would check is in the task manager, look to see which account the w3svc.exe "World Wide Web Publishing" service is running under. On windows server 2003, IIS runs by default as Network Service account. On win xp, I believe it runs as local system or "SYSTEM" account.

Do you have access to a server 2003 box to test this out? It sounds like you tried everything that I would have suggested. By default the system account should automatically have access to write to the log directory of your rails app.

I am at a loss at this point. If you send me your email (I think you can do so securly by creating a codeplex account and drilling down from "People" tab in this project) and will agree to send me your code, I will try to reproduce your problem and get a solution for you.

Part of the problem with running under IIS with a Fast-CGI isapi filter is we are limited to the fcgi implementation which is basically a black box so to speak. At some point I may be writing or modifying Shanes implementation to be more robust. FCGI just wasn't designed to run under IIS...

MS has an fcgi implementation that is beta2 but only works for server 2003 located at: http://mvolo.com/blogs/serverside/archive/2007/02/18/10-steps-to-get-Ruby-on-Rails-running-on-Windows-with-IIS-FastCGI.aspx

Thanks,
Brent