Forum: Rails deployment Deploying on Windows with IIS, ISAPIRewrite, Mongrel, Pen an

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F52969c9d4838c5c01002f8e33a4d9a4?d=identicon&s=25 andre in LA (Guest)
on 2007-03-20 20:52
(Received via mailing list)
This is a description of a simple setup based on the "Integrate Rails
into an Existing IIS Web infrastructure using Mongrel" PDF at

I am having trouble with the last step: runnung Pen as a service in
Cygwin environment on a win2k server.

First, the setup:

- Followed all steps from the PDF - installed ISAPIRewrite, created
the httpd.ini file

RewriteProxy (.*) http://localhost:3000$1 [I,U]

and saved it in the folder served by IIS.

Installed 2 mongrel instances as services on consequent ports (see )

c:>mongrel_rails service::install -N myapp3000 -c c:\railsapp_root -p
3000 -e production
c:>mongrel_rails service::install -N myapp3001 -c c:\railsapp_root -p
3001 -e production

Then started them using the services control panel.

At this point, the app runs OK but slowly with occasional timeouts.
ISAPIRewrite proxies to the first mongrel instance at port 3000 and
the second mongrel instance is never used.

I installed cygwin (if you do so, make sure to add cygrunsrv in the
admin application list in the setup menu -- it is not included by
default) from and then downloaded the windows builds
of pen from (click on the Download Source link and
you'll see pen-0.17.1.exe and pen-0.17.1a.exe in the list).

Then started cygwin and ran pen:

$ /cygdrive/c/path-to-pen/pen-0.17.1a.exe -H 4000 localhost:3000

then edited the ISAPIRewrite httpd.ini file to proxy to port 4000
instead of 3000

RewriteProxy (.*) http://localhost:4000$1 [I,U]

The rails app responded much better and remained online when I stopped
the mongrel on port 3000 so pen was using both instances of mongrel.

The setup, however, is on a remote server and leaving an pen running
in a cygwin terminal is not an option. I have to install and run pen
as a service.

So, I stopped pen (the one running in the console) and installed it as
a service using cygrunsrv (cygrunsrv readme is at

In a cygwin console:

$cygrunsrv --install myapp_pen4000_3000-1 -p /cygdrive/c/path-to-pen/
pen-0.17.1a.exe -a "-H 4000 localhost:3000 localhost:3001"

The service appeared in the Windows services panel. Unfortunately
every attempt to run it ends with an error:

from the cygwin console:
$ cygrunsrv --start myapp_pen_4000_3000-1
cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error
1062: The service has not been started.

Running it from the Services panel results in:
Can not start myapp_pen_4000_3000-1 on Local Computer.
The service did not return an error. This could be an internal Windows
error or an internal Service error. If the problem persists, contact
your system administrator.

The event viewer shows:
The description for Event ID ( 0 ) in Source ( pen ) cannot be found.
The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. The
following information is part of the event: pen: can't bind local

Does anyone have experience / solution for this?

Thank you!

-- Andre
F52969c9d4838c5c01002f8e33a4d9a4?d=identicon&s=25 andre in LA (Guest)
on 2007-03-20 22:07
(Received via mailing list)
One more thing, cygserver needs to be installed for cygwin programs to
run as service. On win2k, run

cygserver-config in a cygwin console. This will install CYGWIN
cygserver as a service

Also, make sure you add -e "CYGWIN=server" to the parameters of

Details here:

-- Andre
0938272623e1b07c8adf883d6c54a358?d=identicon&s=25 K. Rajesh (Guest)
on 2007-03-30 10:16
(Received via mailing list)
I remember seeing in the Deployment section of Agile, a caution
explicitly stating "Dont deploy in Windows". Has this since caution
been removed?

This topic is locked and can not be replied to.