我需要在 Windows Server 2019 计算机上迁移现有的 Rails 应用程序 (Redmine)。已要求使用 Apache 作为 Web 服务器。该应用程序通过 webrick 在本地主机上正确运行,但我在提供服务时遇到了困难。
我尝试使用本指南,但是我无法下载 mongrel_service-0.3.4-i386-mswin32.gem,因为链接已失效并且在其他地方找不到它。
尝试运行“gem install mongrel_service”返回此错误:
ERROR: Error installing mongrel_service:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/fastthread-1.0.7/ext/fastthread
C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20190607-7092-128t9mk.rb extconf.rb
extconf.rb:13:in `block in <main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
from extconf.rb:12:in open'
from extconf.rb:12:in <main>'
extconf failed, exit code 1
我尝试按照以下方法运行这指南(目前在端口 80 上,不使用 Bitnami 堆栈而是使用常规 Apache),但不使用其他任何东西,我可以看到 /public 目录列表,但应用程序无法正常工作。
Phusion Passenger 在 Windows 上不存在,并且架子如果我没记错的话,它似乎不支持开箱即用的 Apache。
我怎样才能让它正确运行?任何帮助都将不胜感激。
Apache 版本:2.4.35 Ruby 版本:2.5.3p105 Rails 版本:4.2.11 Bundler 版本:1.17.3
我的虚拟主机文件:
# Virtual Hosts
#
# Required modules: mod_log_config
<VirtualHost *:80>
ServerName redmine
DocumentRoot "c:/Apache24/htdocs/redmine"
<Directory "c:/Apache24/htdocs/redmine/public" >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# <Proxy *>
# Order allow,deny
# Allow from all
# </Proxy>
# <Proxy balancer://thin_cluster>
# BalancerMember http://127.0.0.1:3001
# BalancerMember http://127.0.0.1:3002
# </Proxy>
# ProxyPass http://127.0.0.1:80/
#ProxyPassReverse / balancer://thin_cluster/
#ProxyReserveHost on
# RewriteEngine On
# Redirect all non-static requests to Rails server,
# but serve static assets via Apache
# RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
# RewriteRule ^/(.*)$ balancer://thin_cluster%{REQUEST_URI} [P,QSA,L]
# # Support for far-futures expires header
# <LocationMatch "^/assets/.*$">
# Header unset ETag
# FileETag None
# # RFC says only cache for 1 year
# ExpiresActive On
# ExpiresDefault "access plus 1 year"
# </LocationMatch>
</VirtualHost>