Forum Discussion
How to Host a Rails App on IIS: Seeking a Simple Approach
You can use HttpPlatformHandler, it is an IIS Module, which manages the process of http listeners. It could be any process that can listen on a port for http requests e.g. Tomcat, Jetty, Node.exe, Ruby etc. Checkout this article for more details HttpPlatformHandler Configuration Reference | Microsoft Learn.
- Lobby1625Sep 26, 2024Copper Contributor
HridayDutta Thanks for your reply ! I tried to make this method working but I got :
HTTP Error 502.3 - Bad Gateway There was a connection error while trying to route the request.
I've found some examples of web.config for rails on the web (very old), but I'm pretty sure i'm missing something. Here is my configuration :
<?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" processesPerApplication="1" startupTimeLimit="200" processPath="C:\Ruby32-x64\bin\ruby.exe" arguments=""C:\Ruby32-x64\bin\puma" -env test -dir c:\inetpub\wwwroot\myapp -p %HTTP_PLATFORM_PORT% -w0"></httpPlatform> </system.webServer> </configuration>
Additionnaly, I've found on this https://www.hanselman.com/blog/announcing-running-ruby-on-rails-on-iis8-or-anything-else-really-with-the-new-httpplatformhandler talking about "SysInternals Process Explorer application" that show me processes under IIS and I can see ruby running for a second then disappear. I can't find anything about this have you got an idea ?
Thank you for your help !
- Lobby1625Oct 01, 2024Copper ContributorI found the problem. It was about puma service not running because of misconfiguration. Now my rails app run perfectly on IIS
- PradeepSharmaOct 01, 2024
Microsoft
It’s always a good practice to check the status of dependent services on your server.
For IIS, you can run the command
IISRESET /status
to view the status of installed IIS services.