http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx
If we manage get Rails easily working with IIS Express, running Rails
in corporate IIS 7 could be easy.
IIS Express includes FastCGI. I know is not Passenger or mongrel, but
is something. Is old, but doesn't mean is bad ;-)
Getting fastcgi compiled and getting Ruby FastCGI extension working
with MinGW is not complicated, just need to be done.
Please avoid any existing binary on this subject (roriis, rubyforiis I
believe) since their binaries are old, compiled with Visual Studio and
highly unlikely remain maintained.
Since setting a Rails application with IIS can't be automated (I
believe, highly likely I'm wrong), I think once fastcgi and ruby fcgi
is solved, perhaps someone can write a tutorial?
Ok, leaving this now for you guys to explore, I put the building blocks ;-)
Cheers,
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
AFAIK Is Managed Code, we can't use it.
It need to be an extension that is either C++ or something and talks
to Rack, that will be great.
The problem is also starting the application. Seems this needs to be
something like passenger where the extension loads the application.
Then we have things like manage how many processes, etc.
I will try give a whirl to FastCGI express this weekend and see how it goes.
> It's been a long time since I attempted this, but what the Java solutions do
> is use an ISAPI filter to intercept requests to IIS and kick them over to a
> backend. I have successfully used Helicon's ISAPI_REWRITE plugin to kick
> these over to Mongrel as a service. We use this in production now, but I
> don't think the mongrel_service stuff works anymore so we're on a very old
> version.
ISAPI filters do not work or are present in latest IIS.
mongrel_service does work, what doesn't work is Rails.
We can turn mongrel service into thin service pretty easily, and thing
works with Rails 3.
I already emailed about FreeTDS, now IIS:
http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx
If we manage get Rails easily working with IIS Express, running Rails
in corporate IIS 7 could be easy.
IIS Express includes FastCGI. I know is not Passenger or mongrel, but
is something. Is old, but doesn't mean is bad ;-)
Getting fastcgi compiled and getting Ruby FastCGI extension working
with MinGW is not complicated, just need to be done.
ISAPI filters do not work or are present in latest IIS.
We run IIS 7 in prod with ISAPI filters. Which IIS are you talking about?
mongrel_service does work, what doesn't work is Rails.
We can turn mongrel service into thin service pretty easily, and thing
works with Rails 3.
Yes, it works, dunno how you set it up, but I know it works :-)
Now, did some test:
fcgi 2.4.0, latest release do not compile with DevKit (extract,
configure, make process)
It contains hardcoded "SYSTEM" in configure (unix). Changed to win32,
and it failed:
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c fcgio.cpp -MT
fcgio.lo -MD -MP -MF .deps/fcgio.TPlo -DDLL_EXPORT -DPIC -o
.libs/fcgio.lo
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50:14: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70:72: error: 'EOF' was not declared in this scope
fcgio.cpp:75:14: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86:18: error: 'EOF' was not declared in this scope
fcgio.cpp:87:41: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()':
fcgio.cpp:107:35: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory
`/c/Users/Luis/Projects/_sandbox/fastcgi/fcgi-2.4.0/libfcgi'
Due missing #include <cstdio> in fcgio.h
Then, it failed due export symbols in the link library, quite common
for shared/static libraries and Windows (dllexport and dllimport), no
matter if I used static or shared library.
This is something I encountered in several libraries like libssh2, but
can{t find the link to libssh2-devel where I discussed this :-(
So, replaced the whole DLLAPI definition fcgi had with this:
#ifdef _WIN32
# ifdef DLL_EXPORT
# define DLLAPI __declspec(dllexport)
# else
# ifdef DLL_IMPORT
# define DLLAPI extern __declspec(dllimport)
# endif
# endif
#endif
#ifndef DLLAPI
# define DLLAPI extern
#endif
As documented by autoconf.
http://sourceware.org/autobook/autobook/autobook_255.html
http://sourceware.org/autobook/autobook/autobook_254.html#SEC254
Now is only complaining of missing libraries:
../libfcgi/.libs/libfcgi.a(libfcgi_la-os_win32.o): In function `OS_SetFlags':
c:\Users\Luis\Projects\_sandbox\fastcgi\fcgi-2.4.0\libfcgi/os_win32.c:1873:
undefined reference to `ioctlsocket@12'
c:\Users\Luis\Projects\_sandbox\fastcgi\fcgi-2.4.0\libfcgi/os_win32.c:1875:
undefined reference to `WSAGetLastError@0'
../libfcgi/.libs/libfcgi.a(libfcgi_la-os_win32.o): In function `OS_LibShutdown':
c:\Users\Luis\Projects\_sandbox\fastcgi\fcgi-2.4.0\libfcgi/os_win32.c:585:
undefined reference to `WSACleanup@0'
It needs ws2_32 linking and some other...
Not enough time to hack on this so:
https://github.com/luislavena/fcgi
Steps:
> devkitvars.bat
> git clone git://github.com/luislavena/fcgi.git
> cd fcgi
> sh -c "autonconf"
> mkdir build
> cd build
> sh ../configure --disable-shared --enable-static
> make
[hack]