多应用托管策略及相关注意事项
1. 多应用托管策略概述
托管多个应用程序有多种策略可供选择,选择哪种策略主要取决于系统的用户数量。当用户众多且有长 HTTP 请求(如文件上传)时,需要通过增加后端进程来解决扩展问题。传统做法是增加 FastCGI 进程数量,现在也可以在集群中添加另一个 Mongrel 实例。
2. 小型应用托管策略
2.1 使用 IIS 和 Mongrel 托管多个小型应用
这是一种简单的方法,每个应用程序作为 Windows 服务安装,Mongrel 在不同端口上运行。然后使用 IIS 结合 ISAPI_Rewrite 和 reverse_proxy_fix 插件,将每个应用挂载到 IIS 内的各自 URL。例如:
http://www.yourdomain.com/app1 ⇒ http://localhost:4001
http://www.yourdomain.com/app2 ⇒ http://localhost:4002
http://www.yourdomain.com/app3 ⇒ http://localhost:4003
ISAPI_Rewrite 规则如下:
RewriteProxy /app1(.*) http\://localhost:4001$1 [I,U]
RewriteProxy /app2(.*) http\://localhost:4002$1 [I,U]
RewriteProxy /ap
超级会员免费看
订阅专栏 解锁全文
445

被折叠的 条评论
为什么被折叠?



