我在 IIS 服务器上部署带有 React.js 项目的 Ruby on Rails 时遇到问题。
我正在配置一个 IIS 服务器,我在其中设置了项目路径、定义了 URL、配置了 FTP、建立了 Fast CGI 并配置了处理程序映射。请指导我部署该项目的后续步骤
您可以按照以下步骤在 iis 上部署 Ruby on Rail 应用程序:
下载并安装 iis 的 HttpPlatformHandler https://www.iis.net/downloads/microsoft/httpplatformhandler
安装扩展后重启iis
在站点根文件夹中创建 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=""C:\Ruby32-x64\bin\rails" server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1">
<environmentVariables>
<environmentVariable name="foo" value="bar"/>
</environmentVariables>
</httpPlatform>
</system.webServer>
然后浏览网站。确保您已为站点根文件夹和 rubby 文件夹分配了 iis_iusrs 和 iusr 完全控制权限。