ruby-on-railsiis-8windows-server-2012-r2httpplatformhandler

RoR not loading on Windows Server 2012 with IIS 8 and HttpPlatformHandler


Navigating to 127.0.0.1/rails spawns ruby.exe when looking through the Process Explorer, they quickly disappear and the page never loads. Leads me to believe that there is something wrong with my config file.


I am following along with Running Ruby on Rails on IIS8 with HttpPlatformHandler and I hit a wall.

I have verified that Rails can run a application under the local WEBrick server. However, I cannot figure out why a application will not launch under IIS8. I am hoping someone out there can help me verify a few things or point me in the right direction. In the blog, Scott is running Windows 8. So, perhaps there are some differences that I am missing by using Windows Server 2012.

Windows Features

In the blog, Scott simply turns Internet Information Services on. On the server, it seems a bit more involved. I have installed:

  1. Application Server:
    • .NET Framework 4.5
    • Web Server (IIS) Support
  2. Web Server (IIS)
    • Web Server
      • Common HTTP Features
      • Application Development

Perhaps someone out there could verify that I am not missing anything in that section. I can elaborate further if necessary.

web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
        <httpPlatform stdoutLogEnabled="true" stdoutLogFile="rails.log" startupTimeLimit="20" processPath="c:\Ruby22-x64\bin\ruby.exe"
                  arguments="&quot;C:\Ruby22-x64\bin\rails&quot; server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1">
        </httpPlatform>
    </system.webServer>
</configuration>

Thank you for taking a look! Any input would be very much appreciated! I realize serving a Rails application on Windows is not ideal. However, I am not left with any other choice...


Solution

  • I believe that my original problem boiled down to user account control issues. But that was taking to long to get resolved, so I took a different path.

    I ended up using Apache. This answer to this question was very helpful.

    Rough outline of steps I took:

    1. Install Ruby, DevKit, Rails and make sure they run
      • Make sure your application can run locally
    2. Create .bat files that start your server. Convert them to .exe's. Then create a service start them with nssm.
    3. Setup and configure Apache
      • Edit your httpd.conf file
        • Make sure you have the necessary modules installed. You can use Apache error logs to troubleshoot this step.
        • Include vhosts if you opt to use that.
          • Edit vhosts file so it points to your application.