如何在IIS服务器上使用React js项目部署Ruby on Rails

问题描述 投票:0回答:1

我在 IIS 服务器上部署带有 React.js 项目的 Ruby on Rails 时遇到问题。

我正在配置一个 IIS 服务器,我在其中设置了项目路径、定义了 URL、配置了 FTP、建立了 Fast CGI 并配置了处理程序映射。请指导我部署该项目的后续步骤

reactjs ruby-on-rails ruby deployment iis-7
1个回答
0
投票

您可以按照以下步骤在 iis 上部署 Ruby on Rail 应用程序:

  1. 下载并安装 iis 的 HttpPlatformHandler https://www.iis.net/downloads/microsoft/httpplatformhandler

  2. 安装扩展后重启iis

  3. 在iis中添加新网站添加网站绑定和ruby项目文件夹路径:

  4. 在站点根文件夹中创建 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:\Ruby32-x64\bin\ruby.exe" arguments="&quot;C:\Ruby32-x64\bin\rails&quot; server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1">
             <environmentVariables>
                 <environmentVariable name="foo" value="bar"/>
             </environmentVariables>            
         </httpPlatform>
     </system.webServer>
    

然后浏览网站。确保您已为站点根文件夹和 rubby 文件夹分配了 iis_iusrs 和 iusr 完全控制权限。

© www.soinside.com 2019 - 2024. All rights reserved.