Alaik
Alaik

Reputation: 1

Using IIS to host a rails server

I am currently hosting a rails server. When I go to http://localhost:3000 I can view the application and everything.

Now I am trying to set it up as a website that can be viewed from the outside world using IIS. I dragged it into c:\inetpub\wwwroot but when Iright click on browse in IIS it tells me that "The website declined to show this webpage." Note that I do allow anonymous access.

Is there some other step to setting up a rails application this way? The only experience I have is hosting an asp.net application.

Upvotes: 0

Views: 1261

Answers (3)

Majid Hosseini
Majid Hosseini

Reputation: 1096

You can use HttpPlatformHandler

install it with Web Platform Installer and add web.config in root of rails application directory.

input this in web.config

<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:\RailsInstaller\Ruby2.1.0\bin\ruby.exe"
                  arguments="&quot;C:\RailsInstaller\Ruby2.1.0\bin\rails&quot; server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1">
            <environmentVariables>
                <environmentVariable name="foo" value="bar"/>
            </environmentVariables>            
        </httpPlatform>
    </system.webServer>
</configuration>

You want to see Announcing: Running Ruby on Rails on IIS8 (or anything else, really) with the new HttpPlatformHandler

Upvotes: 1

Ben Kreeger
Ben Kreeger

Reputation: 6344

You'll want to check out Ruby On Rails for IIS. It leverages a few community technologies to run your Rails application inside of an IIS site.

It's still kinda ugly though!

Upvotes: 1

MrDanA
MrDanA

Reputation: 11647

I would recommend using Heroku. It's free to use (but you can pay for some better stuff) and comes with an easy gem to work with it. It's read only though, so if you do any file uploading try using Amazon S3. It's pretty easy to set up with a domain name too.

Upvotes: 0

Related Questions