`
huihua
  • 浏览: 62141 次
  • 性别: Icon_minigender_1
  • 来自: 珠海
文章分类
社区版块
存档分类
最新评论

Apache2 Mongrel-Cluster Configuration

阅读更多

$ wget http://apache.justdn.org/httpd/httpd-2.2.4.tar.gz
($ sudo apt-get install apache2 is NOT recommended)

$ sudo gem install mongrel –include-dependencies
$ sudo gem install mongrel_cluster –include-dependencies
$ sudo /usr/sbin/adduser -r mongrel (creating a user for mongrel running)

cd httpd-2.2.4
./configure –prefix=/etc/apache2 –enable-cache –enable-mem-cache \
–enable-deflate –enable-proxy –enable-proxy-html –enable-proxy-balancer \
–enable-rewrite –enable-headers –enable-filecache –enable-ssl \

make
make install

–Note
# Apache and mongrel could work together in two ways, single instance and cluster
# We will describe both of them as follows:

1 — single mongrel instance
–enter your application’s path
$ mongrel_rails start -d -p 8000

–enter your apache2 httpd.conf, usually /etc/apache2 , and add these scripts

<virtualhost></virtualhost>
ServerName localhost
ServerAlias http://localhost

ProxyPass / http://localhost:8000/
ProxyPass /images !
ProxyPass /stylesheets !
#continue with other static files that should be served by apache

#continue with aliases for static content

ProxyPassReverse / http://localhost:8000/
ProxyPreserveHost on
2 — mongrel cluster
$ sudo gem install daemons gem_plugin mongrel mongrel_cluster –include-dependencies
$ sudo /usr/sbin/adduser -r mongrel

$ cd /path/to/yourapps
$ sudo mongrel_rails cluster::configure -e production \
-p 8000 -N 3

[NOTE! please make sure there’re only one mongrel_cluster.yml file in your system.]

You could test now:
—————
$ sudo mongrel_rails cluster::start
$ sudo mongrel_rails cluster::stop
—————

$ sudo mkdir /etc/mongrel_cluster
$ sudo ln -s /path/to/yourapp/config/mongrel_cluster.yml \
/etc/mongrel_cluster/yourapp.yml
$ cd /etc/init.d/
$ sudo cp /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.1/resources/mongrel_cluster mongrel_cluster
$ sudo chmod +x /etc/init.d/mongrel_cluster

make sure these configuration is uncommented in httpd.conf
NOTE, if you have these modules buit-in, you may ignore it.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so

DocumentRoot /path/to/yourapp/public

Edit httpd.conf:

<proxy></proxy> BalancerMember http://localhost:8000
BalancerMember http://localhost:8001
BalancerMember http://localhost:8002<virtualhost></virtualhost>
ServerName yourapp.com
ServerAlias http://yourapp.com
ServerAdmin yourapp@yourapp.com

 

DocumentRoot “/path/to/yourapp/public”
RewriteEngine On

ProxyPass /images balancer://yourCluster/images

ProxyPass /stylesheets balancer://yourCluster/stysheets
ProxyPass /javascripts balancer://yourCluster/javascripts

ProxyPass / balancer://yourCluster/

ProxyPassReverse / balancer://yourCluster/
ProxyPreserveHost on

分享到:
评论

相关推荐

    mongrel-1.1.4-x86-mswin32-60.gem

    mongrel-1.1.4-x86-mswin32-60.gem 的gem包

    mongrel-1.1.5.gem

    Mongrel是一种快速的针对Ruby的Http 服务器,专门为部署发布rails应用而产生的。 可以替代mod_ruby/fastcgi,可以用于生产部属环境。

    mongrel_service 安装包

    相信安装Redmine时会用到它们 win32-service-0.5.2.gem gem_plugin-0.2.3.gem mongrel_service-0.3.4-i386-mswin32.gem

    Web服务器Mongrel2.zip

    Mongrel2是一个基于ZeroMQ的Web服务器,语言独立,可以用17种语言编写应用,还有更多非常奇特的地方:What makes Mongrel2 special is how it satisfies these requests in a language agnostic andasynchronous way...

    Mongrel

    Mongrel

    基于Ubuntu Nginx Mongrel Mysql部署rails monit-5.0

    基于Ubuntu Nginx Mongrel Mysql部署rails monit-5.0

    Linux系统上配置Nginx Mongrel cluster

    绍linux系统上配Nginx Mongrel cluster方法和步骤。

    RailsWithApacheAndMongrel.pdf

    Rails With Apache And Mongrel

    mongrel2:Mongrel2 Web服务器项目

    Mongrel2:与语言无关的Web服务器Mongrel2是与应用程序,语言和网络体系结构无关的Web服务器,其重点是使用现代浏览器技术的Web应用程序。特征语言不可知论者,带有一个简单的后端协议,支持Mongrel2粉丝编写的17种...

    nim-mongrel2:Mongrel2 Web服务器的处理程序框架

    nim-mongrel2:Mongrel2 Web服务器的处理程序框架

    m2php:Mongrel2 PHP 的东西

    m2php - 在 PHP 中开发 Mongrel2 处理程序的库Mongrel2: ://mongrel2.org Mongrel2 Python 库: ://sheddingbikes.com/posts/1279007133.html要求ZeroMQ 2.0.7 或更高版本: ://... 只需为您的项目创建一个 composer....

    Rails 中mongrel的安装

    NULL 博文链接:https://ilstar.iteye.com/blog/370808

    net.sf.mongrel_1.0.0.zip

    Mongrel 是一个 Eclipse 插件,用来在 Eclipse 环境中开发和运行基于 Tomcat 的Web应用。可方便进行配置、调试 Tomcat 会话,基于 Sysdeo Tomcat 插件开发。 安装方法:下载后将压缩包解压到 Eclipse 的 plugins ...

    seraph:[废弃] 用 PHP 为 Mongrel2 编写处理程序的框架

    我认为处理程序是长时间运行的应用程序,它发布对使用几个ØMQ套接字从 Mongrel2 服务器拉出的请求的响应。 我写Seraph是因为我想强调的是,在 Mikko Koppanen 的“php-zmq”PHP 扩展的帮助下,PHP 不再受 Apache ...

    m2net:用于开发 Mongrel2 处理程序的 .NET 库

    帮助您开发 Mongrel2 处理程序。 它还带有 ASP.NET Web 服务器的粗略端口,用于使用 m2net 而不是套接字。 金块 该库在上。 依赖关系 .NET 框架 4.0 执照 m2net 在 3 条款下获得。 m2net.asp 是根据获得,因为它源自...

    instant-rails-2.0.7z

    集成了ruby 、rails 、apache 、mongrel、mysql(phpmyadmin),绿色免安装,解压即可。 内带示例程序cookbook和Typo.注意IIS服务器和迅雷等都可能占用80端口,要防止冲突。不仅可以作为rails程序运行环境,开发也非常...

    httpd-2.4.58.tar.gz

    nginx 是一个小巧且高效的HTTP服务器,也可以做一个高效的负载均衡反向代理,通过它接受用户的请求并分发到多个Mongrel进程可以极大提高Rails应用的并发能力tomcat 技术先进、性能稳定,而且免费IIS(windows)安全...

    xbreed:通过 Mongrel2 的 OCaml web 迷你框架的开始

    XBreed Martin Keegan 和 Alistair Turnbull 的最小 OCaml Web 框架。 名字读作“杂交”。 取决于 Zed Shaw 的 Mongrel2。 许可证:Apache 2.0 质量:pre-alpha

    Nginx+Mongrel实践过程

    公司的系统部署的实践过程,参考了许多网上前辈的经验

    deprec:deprec的主存储库-capistrano的部署配方

    Deprec-2.x是对项目的完整重写,可以实现以下目的: 支持Capistrano 2 生成的配置文件存储在本地以启用编辑和版本控制支持更多服务(心跳,nagios,nginx,ntp,postfix等) 多个Rails部署选项(Passenger + Apache...

Global site tag (gtag.js) - Google Analytics