惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
L
LangChain Blog
D
Docker
G
Google Developers Blog
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
I
InfoQ
博客园 - 【当耐特】
The Cloudflare Blog
P
Proofpoint News Feed
GbyAI
GbyAI
博客园 - 司徒正美
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Jina AI
Jina AI
量子位
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
有赞技术团队
有赞技术团队
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
大猫的无限游戏
大猫的无限游戏
F
Full Disclosure
雷峰网
雷峰网
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - Zealic

Windows 下使用 Nginx+Mono 部署 ASP.Net 一种版本化的数据库脚本管理机制 Visual Studio 使用的 ProjectTypeGuids MSBuild 简解 CCNet 的 Build 流程 发散性碎片(2008-12-29) Google Toolbar 5 简析 Google Gadget 的数据丢失原因 乱弹用户资源 职业·病 SVN 简单备份与还原 发散性碎片(2008-11-14) 动态链接库重定向技术 SilverLight 与移动平台 Linux 下的 Apache + FastCGI 部署 ROR 应用 Live Writer 12.0.1370.325 + SyntaxColor4Writer 0.27 ICE 编译器环境集合 Subversion and .Net 好用的 Abyss Web Server
Windows 下的 Apache + FastCGI 部署 ROR 应用
Zealic · 2008-05-17 · via 博客园 - Zealic

系统需求

  • Apache
  • Ruby
  • Rails

安装 Ruby 建议使用 Ruby 1.8.6 One-Click Installer,而不要使用 Ruby 1.8.6 Binary ,因为后者不包含 FCGI 模块,即使使用 gem install fcgi 安装也必须编译才能使用。如果没有 FCG 模块,则 Apache 启动 FastCGI 进程可能会报以下错误:

The pipe has been ended.  : mod_fcgid: get overlap result error

安装 Rails : gem install rails

安装 Apache Http Server

获得 mod_fcgid,该模块依赖 Visual C++ 2008 Redistributable Package;解压 mod_fcgid.so 到 Apache 目录的 modules 子目录下。fcgid 进程默认只有一个 _FCGI_SHUTDOWN_EVENT_ 环境变量,而 Windows DNS 解析必须有一些特定的环境变量,否则会导致无法解析 DNS,应用报以下错误:

  getaddrinfo: no address associated with hostname.

下面的配置描述了如何解决该问题。

我们这里作一些假设:

  • ROR 应用目录:D:/WebRoot/redmine/
    初始化数据库 :rake db:migrate

配置 Apache,添加以下脚本:

LoadModule fcgid_module et/mod/mod_fcgid.so
DefaultInitEnv RAILS_ENV production
# 设置以下环境变量以保证 DNS 解析正确
# 如果不设置,则会报 getaddrinfo: no address associated with hostname.
DefaultInitEnv PATH "C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
DefaultInitEnv TMP "C:/WINDOWS/TEMP"
DefaultInitEnv windir "C:/WINDOWS"

Alias "/redmine" "D:/WebRoot/redmine/public/"

<Directory "D:/WebRoot/redmine/public/">
  Options Indexes ExecCGI FollowSymLinks
  AllowOverride all
  Order Deny,Allow
  Allow from All
</Directory>

<Location /redmine/>
    AddHandler fcgid-script .fcgi
    FCGIWrapper "C:/ruby/bin/ruby.exe D:/WebRoot/redmine/public/dispatch.fcgi" .fcgi
    RewriteEngine on
    RewriteBase /redmine
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.fcgi?$1 [QSA,L]
</Location>

2008-5-16 Zealic