<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d4684235500622716427\x26blogName\x3dCaiwangqin\x27s+blog\x26publishMode\x3dPUBLISH_MODE_HOSTED\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://blog.caiwangqin.com/search\x26blogLocale\x3dzh_CN\x26v\x3d2\x26homepageUrl\x3dhttp://blog.caiwangqin.com/\x26vt\x3d3393395200455623441', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Caiwangqin's blog

Focus on Cloud Service, Smart Hardware, Architecture, Technic and beyond…

Try Phusion Passenger/mod_rails

2008年4月25日星期五

chinaonrails.com上看到 bd7lx 发布的 简化部署插件 乘客搭上阿帕奇Phusion Passenger (a.k.a. mod_rails for Apache), 对其部署的简单和性能都欣喜不已,但官方的文章不一定真实可靠,特自行测试一番,Let’s go.


测试环境如下:





Linux p1 2.6.24-1-amd64 #1 SMP Mon Feb 11 13:47:43 UTC 2008 x86_64 GNU/Linux


按官方的安装步骤进行,这里有一视频



apt-get install apache2


apt-get install apache2-prefork-dev


apt-get install libapr1-dev


apt-get install apache2-mpm-prefork


gem install passenger


passenger-install-apache2-module


我的 httpd.conf 文件



LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /var/lib/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby1.8


<VirtualHost *:80>
ServerName dailybuild.p1.cn
DocumentRoot /home/yay/delta/project1/current/public


<Directory “/home/yay/delta/project1/current/public”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>



问题:



  1. mod_rails 还不支持所有的plugin , 如: file_column.

  2. 对 public/ 目录下的静态文件,需要多一点配制,不要把思维停止在好看的视频上。

  3. 要用于 production 环境,需要做更多的测试,如: httperf。更多测试数据稍后分享。


标签:

posted by Jesse Cai, 上午4:46

0 Comments:

发表评论

订阅 帖子评论 [Atom]

<< 主页