<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>mod_rails &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/mod_rails/</link>
	<description>Feed of posts on WordPress.com tagged "mod_rails"</description>
	<pubDate>Fri, 04 Dec 2009 17:24:45 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Upgrade to passenger 2.2.x on centos 4]]></title>
<link>http://indierockmedia.wordpress.com/2009/10/07/upgrade-to-passenger-2-2-x-on-centos-4/</link>
<pubDate>Wed, 07 Oct 2009 19:21:27 +0000</pubDate>
<dc:creator>indierockmedia</dc:creator>
<guid>http://indierockmedia.wordpress.com/2009/10/07/upgrade-to-passenger-2-2-x-on-centos-4/</guid>
<description><![CDATA[If you&#8217;ve set all the APR/APU/APX paths and you are still having issues such as: In file inclu]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you&#8217;ve set all the APR/APU/APX paths and you are still having issues such as:<br />
<code><br />
In file included from ext/boost/config/no_tr1/utility.hpp:21,</p>
<p>from ext/boost/config/select_stdlib_config.hpp:20,</p>
<p>from ext/boost/config.hpp:40,</p>
<p>from ext/boost/thread/detail/platform.hpp:14,</p>
<p>from ext/boost/thread/tss.hpp:9,</p>
<p>from ext/oxt/system_calls.hpp:28,</p>
<p>from ext/common/Utils.cpp:26:</p>
<p>/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/utility:66:28: bits/c++config.h: No such file or directory</p>
<p>---- LOTS AND LOTS OF LINES ----</p>
<p>ext/boost/weak_ptr.hpp: At global scope:<br />
ext/boost/weak_ptr.hpp:70: error: expected `)' before '' token<br />
ext/boost/weak_ptr.hpp:85: error: expected primary-expression before "const"<br />
ext/boost/weak_ptr.hpp:86: error: declaration of `operator=' as non-function<br />
ext/boost/weak_ptr.hpp:86: confused by earlier errors, bailing out<br />
rake aborted!<br />
Command failed with status (1): [g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_...]<br />
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/Rakefile:172:in `define_common_library_task'<br />
(See full trace by running task with --trace)</p>
<p></code></p>
<p>You may need to run:</p>
<p><code>yum install libstdc++-devel </code></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sample nginx (with Phusion Passenger) configuration file to enable SSL]]></title>
<link>http://candidcode.com/2009/09/12/sample-nginx-with-phusion-passenger-configuration-file-to-enable-ssl/</link>
<pubDate>Sat, 12 Sep 2009 20:10:50 +0000</pubDate>
<dc:creator>praveendiangy</dc:creator>
<guid>http://candidcode.com/2009/09/12/sample-nginx-with-phusion-passenger-configuration-file-to-enable-ssl/</guid>
<description><![CDATA[Read my earlier post if you want Phusion Passenger to compile nginx with SSL support. If your nginx ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Read my earlier post if you want <a title="Phusion Passenger to compile nginx with SSL support" href="http://candidcode.com/2009/09/12/getting-phusion-passenger-to-install-nginx-with-ssl-support/">Phusion Passenger to compile nginx with SSL support</a>. If your nginx server already supports SSL, read on.</p>
<p>Phusion Passenger fills up most of the configuration in nginx.conf for you with a nice set of defaults. You just have to do a little more work if you want to modify the nginx configuration file to enable SSL on your site.</p>
<p>The first thing to do is purchase a SSL certificate and install it on your server. If you don&#8217;t know how, here&#8217;s a great post on <a title="Installing SSL on Ubuntu with nginx" href="http://open.emspace.com.au/article/installing-ssl-ubuntu-nginx" target="_blank">installing SSL on Ubuntu with nginx</a>. Once you&#8217;ve installed the certificate, you should be good to go.</p>
<p>Let&#8217;s say that you&#8217;ve got a domain name called mydomain.com and the root for your Ruby on Rails application is located at /home/mydomain/current/public on your server. The following shows a sample of the configuration required to get SSL enabled for your application:</p>
<pre class="brush: bash;">
server  {
    	       listen 80;
               server_name mydomain.com;
               root /home/mydomain/current/public;
               passenger_enabled on;
               rails_env production;
        }

# HTTPS server
server  {
               listen 443;
               server_name mydomain.com;
               root /home/mydomain/current/public;
               passenger_enabled on;
               rails_env production;

               ssl on;
               ssl_certificate /etc/ssl/certs/mydomain.com.crt;
               ssl_certificate_key /etc/ssl/private/mydomain.com.key;

               ssl_session_timeout  5m;
        }
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Getting Phusion Passenger to install nginx with SSL support]]></title>
<link>http://candidcode.com/2009/09/12/getting-phusion-passenger-to-install-nginx-with-ssl-support/</link>
<pubDate>Sat, 12 Sep 2009 17:15:27 +0000</pubDate>
<dc:creator>praveendiangy</dc:creator>
<guid>http://candidcode.com/2009/09/12/getting-phusion-passenger-to-install-nginx-with-ssl-support/</guid>
<description><![CDATA[Phusion Passenger or mod_rails has taken away almost all the pain once associated with deploying Rub]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="Phusion Passenger" href="http://www.modrails.com" target="_blank">Phusion Passenger or mod_rails</a> has taken away almost all the pain once associated with deploying Ruby on Rails applications. Phusion Passenger recently <a title="Support for nginx in Phusion Passenger" href="http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/" target="_blank">added support for the nginx web server</a>.  My application required SSL support, but Phusion Passenger does not by default compile nginx with SSL support. I&#8217;m new to System Administration and even newer to Unix, having used Windows Servers all my life, so I decided to document my steps to make it easier for others with the same problem.</p>
<h3>Step 1: Download and unzip the source code for OpenSSL</h3>
<p>Make sure to visit <a title="OpenSSL Source" href="http://www.openssl.org/source/" target="_blank">OpenSSL</a> to determine the name of the latest source code tarball to download. In my case it was openssl-1.0.0-beta3.tar.gz</p>
<pre class="brush: bash;">
cd /tmp
wget http://www.openssl.org/source/openssl-1.0.0-beta3.tar.gz
tar -xvzf openssl-1.0.0-beta3.tar.gz
</pre>
<h3>Step 2: Download and unzip the source code for nginx</h3>
<p>Make sure to visit nginx to determine the name of the latest source code tarball to download. In my case it was nginx-0.8.14.tar.gz</p>
<pre class="brush: bash;">
wget http://sysoev.ru/nginx/nginx-0.8.14.tar.gz
tar zxf nginx-0.8.14.tar.gz
</pre>
<h3>Step 3:Install and run Phusion Passenger</h3>
<pre class="brush: bash;">
gem install passenger
passenger-install-nginx-module
</pre>
<ul>
<li>Watch Phusion Passenger do its thing and when it asks you &#8220;Automatically download and install Nginx?&#8221;, answer 2</li>
<li>Specify the directory where you unzipped the nginx source code (/tmp/nginx-0.8.14 in my case)</li>
<li>Specify the directory where you want to install nginx to (/opt/nginx in my case)</li>
<li>When asked &#8220;Extra arguments to pass to configure script:&#8221;, reply with:</li>
</ul>
<pre class="brush: bash;">
--with-http_ssl_module --with-openssl=/tmp/openssl-1.0.0-beta3
</pre>
<p>Keep in mind that if you downloaded the latest version of the source code, your values might be slightly different from mine.</p>
<p>That&#8217;s it! I&#8217;ve also posted a <a title="Sample configuration file for nginx to enable SSL" href="http://candidcode.com/2009/09/12/sample-nginx-with-phusion-passenger-configuration-file-to-enable-ssl/">sample configuration file for nginx to enable SSL</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Plugin para Passenger no Webmin ]]></title>
<link>http://dannnylo.wordpress.com/2009/08/07/plugin-para-passenger-no-webmin/</link>
<pubDate>Fri, 07 Aug 2009 16:19:56 +0000</pubDate>
<dc:creator>Danilo Jeremias da Silva</dc:creator>
<guid>http://dannnylo.wordpress.com/2009/08/07/plugin-para-passenger-no-webmin/</guid>
<description><![CDATA[Estes dias estava instalando na empresa onde trabalho um servidor para desenvolvimento e testes, ent]]></description>
<content:encoded><![CDATA[Estes dias estava instalando na empresa onde trabalho um servidor para desenvolvimento e testes, ent]]></content:encoded>
</item>
<item>
<title><![CDATA[Phusion Passenger aka mod_rails]]></title>
<link>http://blog.brockbouchard.net/2009/07/29/phusion-passenger-aka-mod_rails/</link>
<pubDate>Wed, 29 Jul 2009 10:43:51 +0000</pubDate>
<dc:creator>Brock</dc:creator>
<guid>http://blog.brockbouchard.net/2009/07/29/phusion-passenger-aka-mod_rails/</guid>
<description><![CDATA[So I was revisiting how I deploy my rails site (brockbouchard.net) and I stumbled upon something cal]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So I was revisiting how I deploy my rails site (<a title="brockbouchard.net" href="http://brockbouchard.net">brockbouchard.net</a>) and I stumbled upon something called &#8220;Phusion Passenger&#8221;, also known as &#8220;mod_rails&#8221;.  I had been previously using Mongrel, but it turns out mod_rails makes deploying a Rails site as simple as placing the app in a directory on the web server.  No more ports or proxies or confusing Apache vhost files.  Check it out!</p>
<p><a title="mod_rails" href="http://www.modrails.com/">http://www.modrails.com/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[servidor-pirata em rede privada]]></title>
<link>http://jaderlan.wordpress.com/2009/04/01/servidor-pirata-em-rede-privada/</link>
<pubDate>Wed, 01 Apr 2009 22:03:12 +0000</pubDate>
<dc:creator>Jader Lançanova</dc:creator>
<guid>http://jaderlan.wordpress.com/2009/04/01/servidor-pirata-em-rede-privada/</guid>
<description><![CDATA[Depois de muitos problemas para levantar um servidor em meu pc para poder rodar algumas aplicações q]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Depois de muitos problemas para levantar um servidor em meu pc para poder rodar algumas aplicações que eu havia desenvolvido em rails e joomla, encontrei uma solução perfeita e também aprendi bastante sofrendo.</p>
<p>Descrição do sistema:Xubuntu, Apache 2</p>
<p>Solução:</p>
<p>Fechei a porta 80 e abri uma porta nova, de alto valor (acima de 1024), para cada aplicação que eu tinha:</p>
<p>#Listen 80</p>
<ol></ol>
<p>Listen 8080</p>
<p>Listen 8081</p>
<p>Listen 8082</p>
<p>etc</p>
<p>Criei um virtuahost para cada um, com sua respectiva porta *:8080, *:8081, etc</p>
<p>Pelos outros pcs da rede, chamava assim</p>
<p>http://10.68.40.72:8080</p>
<p>http://10.68.40.72:8081</p>
<p>http://10.68.40.72:8082</p>
<p>etc</p>
<p>Onde 10.68.40.72 é o ip do pc-servidor na rede (não é o ip do servidor web oficial-principal-autorizado da rede).</p>
<p>Da maneira acima, qualquer pc da rede pode acessar as aplicações rodando no meu pc.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[mod_rails, passenger, OSX Leopard: 5 minuti]]></title>
<link>http://operaomnia.wordpress.com/2008/12/26/mod_rails-passenger-osx-leopard-5-minuti/</link>
<pubDate>Fri, 26 Dec 2008 20:08:23 +0000</pubDate>
<dc:creator>Cisco</dc:creator>
<guid>http://operaomnia.wordpress.com/2008/12/26/mod_rails-passenger-osx-leopard-5-minuti/</guid>
<description><![CDATA[Cinque minuti, non di più per installare mod_rails correttamente su Leopard e avere allo stesso temp]]></description>
<content:encoded><![CDATA[Cinque minuti, non di più per installare mod_rails correttamente su Leopard e avere allo stesso temp]]></content:encoded>
</item>
<item>
<title><![CDATA[Passenger: Error message: No such file or directory - /nonexistent]]></title>
<link>http://dannnylo.wordpress.com/2008/12/18/passenger-error-message-no-such-file-or-directory-nonexistent/</link>
<pubDate>Thu, 18 Dec 2008 15:28:22 +0000</pubDate>
<dc:creator>Danilo Jeremias da Silva</dc:creator>
<guid>http://dannnylo.wordpress.com/2008/12/18/passenger-error-message-no-such-file-or-directory-nonexistent/</guid>
<description><![CDATA[Ontem ao instalar o sistema no servidor de um cliente, me deparei com o seguinte erro : Error messag]]></description>
<content:encoded><![CDATA[Ontem ao instalar o sistema no servidor de um cliente, me deparei com o seguinte erro : Error messag]]></content:encoded>
</item>
<item>
<title><![CDATA[Nova versão do mod_rails lançada]]></title>
<link>http://ggarnier.wordpress.com/2008/12/17/nova-versao-do-mod_rails-lancada/</link>
<pubDate>Wed, 17 Dec 2008 14:56:20 +0000</pubDate>
<dc:creator>ggarnier</dc:creator>
<guid>http://ggarnier.wordpress.com/2008/12/17/nova-versao-do-mod_rails-lancada/</guid>
<description><![CDATA[Recentemente foi lançada a versão 2.0.5 do Phusion Passenger, também conhecido como mod_rails. Esta ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Recentemente foi lançada a versão 2.0.5 do <a href="http://www.modrails.com/">Phusion Passenger</a>, também conhecido como mod_rails. Esta versão é compatível com Ruby 1.8.7 e Rails 2.3, que nem foi lançado ainda, além de incluir algumas melhorias na estabilidade e correção de bugs. Não testei nenhuma versão do mod_rails <a href="http://ggarnier.wordpress.com/2008/04/22/instalacao-do-mod_rails/">desde a primeira</a>, mas pela freqüência de lançamento de novas versões e pelo que tem evoluído a cada versão, parece que tem tudo para se tornar um padrão para deploy de aplicações Rails.</p>
<p>Mais detalhes no <a href="http://blog.phusion.nl/2008/12/05/phusion-passenger-205-released-mentioned-on-live37signalscom/">blog do Phusion Passenger</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Instalando mod_rails en debian, ahorrando RAM]]></title>
<link>http://gastonramos.wordpress.com/2008/12/09/instalando-mod_rails-en-debian/</link>
<pubDate>Tue, 09 Dec 2008 22:39:33 +0000</pubDate>
<dc:creator>Gastón Ramos</dc:creator>
<guid>http://gastonramos.wordpress.com/2008/12/09/instalando-mod_rails-en-debian/</guid>
<description><![CDATA[Hace un tiempo que me enteré que existe mod_rails y que tengo ganas de implementarlo en mi vps (dónd]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hace un tiempo que me enteré que existe <a href="http://www.modrails.com">mod_rails</a> y que tengo ganas de implementarlo en mi vps (dónde está alojado el sitio de <a href="http://www.rubylit.com.ar">rubylit </a>entre otros) El vps tiene 300 MB de RAM en total, y hasta ahora tenía nada más que 30MB libres ( cada instancia de mongrel me consumia unos 40MB aprox.)</p>
<p>Así que aquí vamos con la instalación de mod_rails.</p>
<p>Primero vamos a instalar <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a> cómo recomiendan los chicos de passenger (mod_rails), también podemos usar el ruby convencional.</p>
<p>Para esto nos bajamos el .tar.gz con los sources y lo descomprimimos:</p>
<pre>wget -c http://rubyforge.org/frs/download.php/47937/ruby-enterprise-1.8.6-20081205.tar.gz
tar -xvvzf ruby-enterprise-1.8.6-20080810.tar.gz</pre>
<p>Yo lo voy a instalar en /opt que es dónde se instalan los paquetes que no vienen con la distro entonces quedaría:</p>
<pre>/opt/ruby-enterprise-1.8.6-20080810/</pre>
<p>Instalamos las libs necesarias para compilar <strong>ruby EE</strong>:</p>
<pre>apt-get install g++ zlib1g-dev libssl-dev build-essential</pre>
<p>Al intentar instalarlo me tiró el siguiente <a href="http://pastie.org/322667">error</a>, pero leyendo algunos mails de la lista de <strong>Ruby EE</strong> recomendaban ejecutar el instalador de la siguiente manera:</p>
<pre>cd /opt/ruby-enterprise-1.8.6-20080810/
./installer --no-tcmalloc</pre>
<p>y funcionó&#8230;</p>
<p>Ahora tenemos que crear una serie de links simbólicos para que nos quede la versión de Ruby EE instalada correctamente:</p>
<pre>ln -fs /opt/ruby-enterprise-1.8.6-20080810/ /opt/ruby-enterprise
ln -fs /opt/ruby-enterprise/bin/gem /usr/bin/gem
ln -fs /opt/ruby-enterprise/bin/irb /usr/bin/irb
ln -fs /opt/ruby-enterprise/bin/rake /usr/bin/rake
ln -fs /opt/ruby-enterprise/bin/rails /usr/bin/rails
ln -fs /opt/ruby-enterprise/bin/ruby /usr/bin/ruby
ln -fs /opt/ruby-enterprise/lib/ruby/ /usr/lib/ruby</pre>
<p>Ahora instalamos la gema de mysql</p>
<pre>apt-get install libmysqlclient15-dev

/opt/ruby-enterprise-1.8.6-20080810/bin/ruby /opt/ruby-enterprise-1.8.6-20080810/bin/gem install mysql</pre>
<p>Ya tenemos instalado Ruby EE entonces ahora vamos a instalar <strong>mod_rails</strong>.</p>
<p>bajamos los sources de passenger:</p>
<pre>wget -c http://rubyforge.org/frs/download.php/47928/passenger-2.0.5.tar.gz
tar -xvvzf passenger-2.0.5.tar.gz</pre>
<p>Instalamos las lib necesarias para compilar:</p>
<pre>apt-get install ruby-dev libopenssl-ruby rubygems  apache2-prefork-dev build-essential</pre>
<p>Instalamos apache prefork:</p>
<pre>apt-get install apache2-mpm-prefork</pre>
<p>Ahora tenemos que instalar mod_rails:</p>
<pre>cd /opt/passenger-2.0.5
./bin/passenger-install-apache2-module</pre>
<p>luego editamos el archivo /etc/apache2/mods-available/passenger.conf<br />
y ponemos lo soguiente:</p>
<pre>PassengerRoot /opt/passenger-2.0.5
PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby</pre>
<p>editamos el archivo /etc/apache2/mods-available/passenger.load<br />
y ponemos lo siguiente:</p>
<pre>LoadModule passenger_module /opt/passenger-2.0.5/ext/apache2/mod_passenger.so</pre>
<p>luego tenemos que activar el modulo entonces ejecutamos el siguiente comando:</p>
<pre>a2enmod passenger</pre>
<p>Listo ahora lo único que tenemos que hacer cada vez que agregamos una app<br />
es agregar un virtual host en apache.<br />
Editamos el archivo /etc/apache2/sites-available/nueva_app.com<br />
y ponemos lo siguiente:</p>
<pre>    &#60;VirtualHost *:80&#62;
    ServerName www.nueva_app.com
    ServerAlias nueva_app.com
    DocumentRoot /var/www/apps/nueva_app.com/public
    RailsBaseURI /
    CustomLog /var/log/apache2/nueva_app.com.log "%h %l %u %t \"%r\" %&#62;s %b"
   &#60;/VirtualHost&#62;</pre>
<p>Como pueden ver puse el archivo de log separado del lo general de apache.<br />
luego de esto habilitamos el nuevo virtual host</p>
<pre>a2ensite nueva_app.com</pre>
<p>y reiniciamos apache:</p>
<pre>/etc/init.d/apache2 reload</pre>
<p>y listo.</p>
<p>Ahora en mi vps tengo 165MB de RAM libres, así que la migración fue productiva, cabe destacar que tuve que migrar de nginx a apache entonces todos los virtual hosts (státicos  y dinámicos) que tenía creados en nginx los tuve que migrar a apache, pero no fue algo complicado.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mongrel_cluster vs. Passenger Phusion : Round 1]]></title>
<link>http://jeremy.wordpress.com/2008/09/17/mongrel_cluster-vs-passenger-phusion-round-1/</link>
<pubDate>Wed, 17 Sep 2008 07:49:20 +0000</pubDate>
<dc:creator>Jérémy Lecour</dc:creator>
<guid>http://jeremy.wordpress.com/2008/09/17/mongrel_cluster-vs-passenger-phusion-round-1/</guid>
<description><![CDATA[Voici un premier post focalisé sur mes tests liés à l&#8217;hébergement d&#8217;applications Rails. ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Voici un premier post focalisé sur mes tests liés à l&#8217;hébergement d&#8217;applications Rails.</p>
<p>Depuis quelques temps, je fais tourner mes applis de cette manière :</p>
<ul>
<li>un cluster de process <strong>Mongrel</strong> (5-10 en général)</li>
<li>un virtual host <strong>Nginx</strong> qui fait proxy et load-balancer</li>
</ul>
<div>Le principe est assez rigide ; on définit un pool de process Mongrel qui instancient chacun la totalité de l&#8217;application (et du framework) et qui ouvrent un port pour répondre aux requêtes. Le proxy/load-balancer redirige les requêtes du port 80 vers ces autres ports de manière transparente, récupère le résultat et le renvoie au navigateur à l&#8217;origine de la requête.</div>
<div>Cette allocation de process se fait de manière statique, au lancement du cluster. Il faut donc bien calibrer le nombre de process lancés car ça n&#8217;évolue pas selon la charge. Qu&#8217;il y ait 1 ou 1000 requêtes simultanées, le nombre de process ne change pas. Dans le premier cas, c&#8217;est de la RAM qui est utilisée pour rien, dans l&#8217;autre ce sont des requêtes qui font la queue.</div>
<div>Grace à un gabarit (très simple) de configuration du cluster, à quelques scripts de lancement et un chien de garde qui surveille tout ça (<a href="http://www.tildeslash.com/monit/">Monit</a> est parfait pour ce job), tout roule assez vite et vraiment bien.</div>
<div>Cependant, c&#8217;est un sacré pas en arrière par rapport à l&#8217;hébergement d&#8217;applis PHP. Il suffisait de placer son code source dans un dossier accessible via un VirtualHost et basta !</div>
<p>Au printemps 2008, la communauté Rails a déclaré (<a href="http://www.rubyinside.com/no-true-mod_ruby-is-damaging-rubys-viability-on-the-web-693.html">RubyInside</a> et <a href="http://www.loudthinking.com/posts/21-the-deal-with-shared-hosts">LoudThinking</a>) que l&#8217;absence d&#8217;un vrai mod_ruby (ou rails) pénalisait fortement l&#8217;adoption de l&#8217;outil. Je l&#8217;ai constaté par moi-même a chaque présentation, les remarques fusent sur la complexité de l&#8217;hébergement.</p>
<p>Alors quelques farfelus se sont lancés dans le développement d&#8217;un module pour Apache qui permettrait de déléguer à Apache la gestion des process (leur lancement/extinction selon les besoins, le nombre max de process par appli ruby, …) et de se contenter d&#8217;un VirtualHost qui pointe vers le dossier principal d&#8217;une appli ruby.<br />
Ce module a rapidement été surnommé &#8220;mod_rails&#8221; car il a assez vite permi de faire tourner des applis Rails, mais pas Merb, et autres framework à base de Ruby.<br />
Son vrai nom est <strong><a href="http://www.modrails.com/">Passenger Phusion</a></strong>.<br />
Depuis peu, il a atteint l&#8217;état &#8220;stable&#8221;, il permet de faire tourner d&#8217;autres framework, … et il gagne du coup une sacré popularité, à tel point que moi qui suis plutôt conservateur quand les choses marchent vraiment bien, je me suis laissé aller à faire un premier test de config, mais surtout à un comparatif de performance pour charger la page d&#8217;accueil d&#8217;une même appli Rails dans les 2 modes d&#8217;hébergement.</p>
<h3>Situation commune</h3>
<p>La machine est quasiment au repos ; MySQL tourne mais aucune autre appli Rails que celle de test n&#8217;est en service, pas de process lourd (copie, backup, transfert, …) au moment des tests.</p>
<h3>Premier test : Nginx + Mongrel_cluster</h3>
<p>J&#8217;ai mis en place un cluster de 30 process Mongrel et un VirtualHost dans Nginx pour le proxy/load-balancer. C&#8217;est ma config de prod courante (sauf que j&#8217;ai moins de process en général).</p>
<p>Un stress test avec ApacheBench : $ ab -n 1000 -c 50 http://serveur.dev/accueil</p>
<p>Au résultat il a fallu 94 secondes pour répondre aux 1000 requêtes, avec une moyenne de 10,58 req/sec</p>
<p>Aucun autre process gourmand et inutile ne tournait sur la machine (Apache était arrêté).</p>
<h3>Second test : Apache + Passenger</h3>
<p>J&#8217;ai configuré un Virtualost dans Apache2 avec un nombre maxi de process à 30</p>
<p>Un stress test avec ApacheBench : $ ab -n 1000 -c 50 http://serveur.dev/:81/accueil</p>
<p>Au résultat il a fallu 88 secondes pour répondre aux 1000 requêtes, avec une moyenne de 11,25 req/sec</p>
<p>Nginx était stoppé.</p>
<h3>Conclusion</h3>
<p>De la simplicité de mes tests et de leur rigueur très relative, je tire tout de même une première conclusion : <strong>ça va pas moins vite</strong> !</p>
<p>Ce qui veut dire que c&#8217;est a priori une solution aui est envisageable, moyenant des tests plus poussés.</p>
<p>Le grand bénéfice de tout ça serait certainement d&#8217;alléger mon environnement de dev. Ne plus avoir à paramétrer un cluster, un VHost, Monit, … pour une nouvelle instance de travail, ça sera un vrai progrès par le gain de temps.</p>
<p>Ensuite, pourquoi pas le mettre en environnement de production. La quantité de RAM dispo est assez importante, il suffit alors de permettre un grand nombre de process dynamiques pour que Apache s&#8217;adapte à la demande de manière plus souple.</p>
<p>Ça ne me fera pas changer d&#8217;avis quand à la qualité de Nginx en tant que serveur web ultra léger, particulièrement adapté pour les fichiers statiqueset très facile à configurer.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tutorial de instalação do Rails com Phusion Passenger  (mod_rails) para Ubuntu ]]></title>
<link>http://dannnylo.wordpress.com/2008/08/28/tutorial-de-instalacao-do-rails-com-phusion-passenger-mod_rails-para-ubuntu/</link>
<pubDate>Thu, 28 Aug 2008 16:17:43 +0000</pubDate>
<dc:creator>Danilo Jeremias da Silva</dc:creator>
<guid>http://dannnylo.wordpress.com/2008/08/28/tutorial-de-instalacao-do-rails-com-phusion-passenger-mod_rails-para-ubuntu/</guid>
<description><![CDATA[Mais um dos milhares e milhares de tutoriais de como instalar, mas as vezes é muito dificil de encon]]></description>
<content:encoded><![CDATA[Mais um dos milhares e milhares de tutoriais de como instalar, mas as vezes é muito dificil de encon]]></content:encoded>
</item>
<item>
<title><![CDATA[New Relic RPM &amp; Mod_Rails]]></title>
<link>http://appletownprince.com/2008/08/01/new-relic-rpm-mod_rails/</link>
<pubDate>Sat, 02 Aug 2008 00:45:06 +0000</pubDate>
<dc:creator>simplelight</dc:creator>
<guid>http://appletownprince.com/2008/08/01/new-relic-rpm-mod_rails/</guid>
<description><![CDATA[Unfortunately, the New Relic performance monitor for Ruby on Rails doesn&#8217;t work with mod_rails]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Unfortunately, the <a title="New Relic" href="http://www.newrelic.com/">New Relic performance monitor</a> for Ruby on Rails doesn&#8217;t work with <a title="Passenger" href="http://www.modrails.com">mod_rails (Passenger)</a>. According to a support email from them it currently &#8220;only supports mongrel and thin (without sockets)&#8221;. They plan to support Passenger in the future. That&#8217;s great news because they provide an excellent performance monitoring tool which is very easy to install and use.</p>
<p><strong>Update: New Relic has added support for mod_rails</strong>. I received this email from their excellent customer support:</p>
<blockquote>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">I was just digging through my support emails and found a few people who had inquired about RPM supporting Phusion Passenger, aka mod_rails.</span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;"> </span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">I wanted to let you know that we released a version of the agent with &#8216;beta&#8217; support for Passenger.</span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;"> </span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">If you&#8217;re interested, check it out and let us know how it works for you!</span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;"> </span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">To try it out, just do:</span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;"> </span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">script/install &#8211;force </span><a href="http://svn.newrelic.com/rpm/agent/newrelic_rpm"><span style="font-size:small;font-family:Consolas;">http://svn.newrelic.com/rpm/agent/newrelic_rpm</span></a></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;"> </span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">Bill Kayser</span></p>
<p class="MsoPlainText" style="margin:0;"><span style="font-size:small;font-family:Consolas;">New Relic RPM Developer</span></p>
</blockquote>
<p class="MsoPlainText" style="margin:0;"> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Migrating Rails App to Dreamhost using mod_rails]]></title>
<link>http://appletownprince.com/2008/05/27/migrating-rails-app-to-dreamhost-using-mod_rails/</link>
<pubDate>Tue, 27 May 2008 21:16:43 +0000</pubDate>
<dc:creator>simplelight</dc:creator>
<guid>http://appletownprince.com/2008/05/27/migrating-rails-app-to-dreamhost-using-mod_rails/</guid>
<description><![CDATA[Over Memorial Day weekend I migrated my Rails Application to Dreamhost using mod_rails (Passenger). ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Over Memorial Day weekend I migrated my Rails Application to <a title="Dreamhost" href="http://www.dreamhost.com/r.cgi?421109">Dreamhost </a>using <a title="Passenger" href="http://www.modrails.com/">mod_rails (Passenger)</a>. It was not an entirely smooth process but I was also upgrading from Rails 1.8.x at the same time. That was compounded by making the foolish mistake of trying to rebuild my database using Rake migrations. (That&#8217;s a bad idea. I could have saved many hours by just uploading the schema)</p>
<p>Here is the procedure I followed (hat tip to Nock):</p>
<ol>
<li>cd ~/</li>
<li>rails your_app_name -d mysql</li>
<li>Copy app/, database.yml, routes.rb, db/</li>
<li>Change public/.htaccess from .cgi to .fcgi</li>
<li>put your app into production mode (uncomment line 5 in environment.rb)</li>
<li>run rake db:migrate RAILS_ENV=production</li>
<li>chmod -R 755 ~/your_app_name/app</li>
<li>rm your_app_name/public/index.html</li>
<li>killall -USR1 dispatch.fcgi</li>
<li>killall -USR1 ruby</li>
</ol>
<p>One comment on step 4. For some reason none of my stylesheets would load. Much of the advice gleaned from endless Google searches seemed to suggest that the problem would be fixed by setting the RewriteBase in /public/.htaccess. That turned out to not be the case.</p>
<p>My stylesheet problem was caused by having this line twice in my .htaccess file</p>
<blockquote><p>RewriteRule ^(.*)$ dispatch.fcgi[QSA,L]</p></blockquote>
<p>DO NOT uncomment the one before RewriteEngine On , as all the tutorials seem to imply, just change the .cgi to .fcgi in the block below it.</p>
<p>Thanks to <a title="Dreamhost" href="http://www.dreamhost.com/r.cgi?421109">Dreamhost</a> for their stellar support over a frustrating (for me!) Memorial Day weekend. In the end, (as is so often the case), very little of the frustration was caused by Dreamhost or mod_rails but, rather, by some of the vagaries of Rails. I&#8217;m guessing that future deployments would be much smoother as this was my first time deploying to a shared hosting environment.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Dreamhost Supports Passenger and mod_rails]]></title>
<link>http://appletownprince.com/2008/05/26/dreamhost-supports-passenger-and-mod_rails/</link>
<pubDate>Mon, 26 May 2008 19:55:54 +0000</pubDate>
<dc:creator>simplelight</dc:creator>
<guid>http://appletownprince.com/2008/05/26/dreamhost-supports-passenger-and-mod_rails/</guid>
<description><![CDATA[I use Dreamhost to host my websites and they have now added support for Passenger (a.k.a mod_rails).]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I use Dreamhost to host my websites and they have now added support for <a title="Mod_rails" href="http://www.modrails.com/" target="_blank">Passenger </a>(a.k.a mod_rails). Ruby on Rails deployment hassles should be a distant memory soon!</p>
<p>If you&#8217;re looking for a cheap and cheerful hosting company for your Rails app, I highly recommend <a title="Dreamhost" href="http://www.dreamhost.com/r.cgi?421109" target="_blank">Dreamhost</a>. It&#8217;s great for the solo developer (or small team) because for a small amount per year you can launch your site on a shared hosting service and then later easily migrate it to a virtual private server as your needs change. </p>
<p><a title="Dreamhost" href="http://www.dreamhost.com/r.cgi?421109"><img class="alignnone size-full wp-image-57" src="http://simplelight.wordpress.com/files/2008/05/100x75-a.gif" alt="Dream in Rails" width="100" height="75" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Instalação do mod_rails]]></title>
<link>http://ggarnier.wordpress.com/2008/04/22/instalacao-do-mod_rails/</link>
<pubDate>Tue, 22 Apr 2008 21:52:23 +0000</pubDate>
<dc:creator>ggarnier</dc:creator>
<guid>http://ggarnier.wordpress.com/2008/04/22/instalacao-do-mod_rails/</guid>
<description><![CDATA[Recentemente foi lançado o Phusion Passenger, mais conhecido como mod_rails. Trata-se de um módulo A]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Recentemente foi lançado o Phusion Passenger, mais conhecido como <a href="http://www.modrails.com">mod_rails</a>. Trata-se de um módulo Apache para Rails que promete oferecer configuração e deploy de aplicações mais simplificado do que com o Mongrel, além de ser mais estável e utilizar menos memória.</p>
<p>Tentei instalar o mod_rails e encontrei várias dificuldades. Inicialmente tentei instalar no CentOS 4.4, mas não consegui. Encontrei alguns conflitos de versões de pacotes (pré-requisitos do mod_rails), e ainda não consegui concluir a instalação.</p>
<p>Em seguida, tentei instalar no Ubuntu 7.10. As dificuldades foram menores, mas ainda assim não foi tão simples quanto parece pelo <a href="http://www.modrails.com/documentation/Users%20guide.html">guia do usuário</a>. Segue o passo-a-passo da instalação:</p>
<ol>
<li>Instalar os pré-requisitos:
<pre class="brush: xml;">
sudo apt-get install apache2-mpm-prefork apache2-prefork-dev libapr1-dev
</pre>
<li>Instalar o gem do mod_rails:
<pre class="brush: xml;">
sudo gem install passenger
</pre>
<li>Definir as seguintes variáveis de ambiente:
<pre class="brush: xml;">
export HTTPD=/path/to/httpd
export APXS=/path/to/apxs (ou apxs2)
</pre>
<li>Executar o script de instalação do módulo Apache:
<pre class="brush: xml;">
sudo /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-install-apache2-module
</pre>
<li>Habilitar o mod_rails no httpd.conf do Apache, adicionando as linhas a seguir:
<pre class="brush: xml;">
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby1.8
RailsEnv PROD
</pre>
<p>A última linha acima define o ambiente Rails que será utilizado. Se você omitir esta linha, será usado o ambiente padrão (production).</p>
<li>criar um virtual host no Apache:
<pre class="brush: xml;">
&lt;VirtualHost *:80&gt;
  ServerName localhost
  DocumentRoot /var/www/rails/public
&lt;/VirtualHost&gt;
</pre>
</ol>
<p>Na configuração acima, DocumentRoot é o diretório public da sua aplicação Rails.</p>
<p>Ao concluir estas configurações e reiniciar o Apache, minha aplicação funcionou, porém os arquivos que estão no diretório public (arquivos javascript, css e imagens) não estavam acessíveis. Para resolver este problema:</p>
<ul>
<li>habilite o mod_rewrite
<li>adicione à configuração do virtual host:
<pre class="brush: xml;">
&lt;Directory &quot;/var/www/rails/public&quot; &gt;
    Options         FollowSymLinks
    AllowOverride   All
&lt;/Directory&gt;
</pre>
<li>reinicie o Apache
</ul>
<p>Assim, finalmente consegui fazer a aplicação funcionar corretamente. Ainda não fiz nenhum benchmark comparando o mod_rails com o Mongrel, mas todos os que encontrei até agora são favoráveis ao mod_rails, como estes:</p>
<ul>
<li><a href="http://s2.diffuse.it/blog/show/53_Benchmarking+mod_rails+against+mongrel">Benchmarking mod_rails against mongrel</a>
<li><a href="http://www.akitaonrails.com/2008/4/16/phusion-passenger-mod_rails-test-drive">Phusion Passenger (mod_rails) Test-Drive</a>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[[筆記] 也許是對於 server 的最佳化]]></title>
<link>http://qizhang.wordpress.com/2008/04/21/maybe-optimization-for-sab/</link>
<pubDate>Sun, 20 Apr 2008 22:20:37 +0000</pubDate>
<dc:creator>Chitsaou Yorkxin</dc:creator>
<guid>http://qizhang.wordpress.com/2008/04/21/maybe-optimization-for-sab/</guid>
<description><![CDATA[有人建議我可以 po 一些技術類的文章，所以來吧。 最近幾天針對伺服器軟體做了一些最佳化 (謎: 你不是期中考嗎？)，不知道眾鄉民有沒有覺得最近一、兩天網站的速度變快了？我是覺得有變快。包括也改了一些]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>有人建議我可以 po 一些技術類的文章，所以來吧。</p>
<p>最近幾天針對伺服器軟體做了一些最佳化 (謎: 你不是期中考嗎？)，不知道眾鄉民有沒有覺得最近一、兩天網站的速度變快了？我是覺得有變快。包括也改了一些程式，因此寫一點筆記。有興趣寫 <a href="http://rubyonrails.org">Ruby on Rails</a> 程式的可以參考參考。</p>
<p><!--more--></p>
<h2>ksk 的利器？ mod_rails</h2>
<p>網站運作速度變快，主要我覺得是因為我改用「號稱」極速的 <a href="http://www.modrails.com/">mod_rails (Phusion Passenger)</a> 這個專門為 Ruby on Rails 量身打造的 Apache 2 Module ，取代了原本一次開十隻 cluster 的 <a href="http://mongrel.rubyforge.org/">mongrel_rails</a> 。</p>
<p>差別在於，之前是把十隻 cluster 一次全部開起來放在記憶體裡面當 daemons ，然後透過 mod_proxy 設定 proxy balancer 使 apache 可以調配 client 用戶該使用哪一個 daemon 來應對(詳細方法可以參考我去年寫的<a href="http://chitsaou.wordpress.com/2007/07/17/apache-mongrel-ror/">這篇文章</a>)。而現在有了 mod_rails，直接讓 Phusion Passenger 去控制要有多少個 processes 開在記憶體中，甚至是有連線進來才啟動 rails，沒連線就統統關掉，有點像是 mod_php5 。</p>
<p>實作方法很簡單，照著<a href="http://lightyror.thegiive.net/2008/04/modrails-passenger-release.html">這篇文章</a>做就 ok 了，或是看官方的<a href="http://www.modrails.com/install.html">二行文教學</a>也行 (真的只有 2 行指令就裝完了，當然改設定那些另當別論)。裝完之後把 apache2 重新啟動，記得先關掉原有的 mongrel_rails cluster 就是了。其實還真的有一種「Ruby on Rails 終於脫離 CGI 的影子了」的感覺，「檔案放上去就可以動了，不用開 <code>./script/server</code>」。</p>
<p>所以我現在要暫時關站做 <code>rake db:migrate</code> 之類的事，還得先要把 <code>#{RAILS_ROOT}/public</code> 這個資料夾更名，假裝是關站 囧</p>
<h2>進化到 rails 2.0.2、改用 will_paginate</h2>
<p>一時興起把 <code>config/environment.rb</code> 裡面的 rails 版本換成 2.0.2 了，不知道 rails 2 是不是真的有讓 ruby on rails 變快？</p>
<p>可是因為這個換版本的動作，原本針對高中榜單做的分頁 (pagination) 竟然爛掉了。當初是抄<a href="http://thebogles.com/blog/2006/06/paginate_by_sql-for-rails-a-more-general-approach/">這篇文章</a>的方式去做的，那時候還在 rails 1.x 。結果換到 rails 2.0，似乎是 <code>Paginate</code> 這個 Class 不見了 (還是我找錯 namespace?)。</p>
<p>正在不知道該從何改起的時候，讓我找到了 <a href="http://github.com/mislav/will_paginate/wikis">will_paginate</a> 這個東西，也不需要像之前那以自己寫(貼?) Class Methods 了，就直接引用他內建的東西即可。</p>
<p>先看 <a href="http://github.com/mislav/will_paginate/wikis/installation">Installation</a> 這篇文章，把 will_paginate 裝進系統，並載入你的 Ruby on Rails 專案，然後照這篇 <a href="http://github.com/mislav/will_paginate/wikis/usage-examples">Usage examples</a> 做就行了。用的程式碼比之前少很多，也可以透過 css 去裝飾你 render 出來的分頁列長怎樣。</p>
<p>&#8212;</p>
<p>以上其實我不知道是不是真的有對 server 做到某種程度上的最佳化，因為同時我還把姓名查榜關掉了，光這個就可以省下很多資源。也許過幾天又把姓名查榜開起來，才會知道 mod_rails 到底有多大能耐吧。</p>
<p>&#8212;</p>
<p>ksk = 加速，日本 2ch 鄉民語。</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Instalasi Phusion Passenger]]></title>
<link>http://balirubybrigade.wordpress.com/2008/07/29/instalasi-phusion-passenger/</link>
<pubDate>Tue, 29 Jul 2008 04:16:42 +0000</pubDate>
<dc:creator>bali.rb</dc:creator>
<guid>http://balirubybrigade.wordpress.com/2008/07/29/instalasi-phusion-passenger/</guid>
<description><![CDATA[Saatnya beralih ke Phusion Passenger (mod_rails/mod_rack). Passenger merupakan module apache httpd s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Saatnya beralih ke <a href="http://www.modrails.com" target="_blank">Phusion Passenger</a> (mod_rails/mod_rack). Passenger merupakan module <a href="http://httpd.apache.org/" target="_blank">apache</a> httpd server yang dibuat awalnya agar dapat menjalankan aplikasi Rails di server apache (WebServer yg sudah well proven, dan paling banyak digunakan di seluruh dunia).</p>
<p>Apache memiliki banyak module yg dibuat oleh apache foundation community, atau pengembang 3rd party lain, sperti yg umum digunakan adalah mod_php, mod_python, mod_perl. Apache dapat menghandle request dengan membuat beberapa proses threard simultan yang diatur jumlahnya secara dinamis, dan jika terjadi error dapat melakukan reloading secara otomatis pula. Memanfaatkan kestabilan dari Apache Server, passenger lahir untuk memudahkan deployment aplikasi Rails, yg selama ini selalu menjadi momok menakutkan, dianggap menyulitkan,dan membutuhkan resource gede. Menjadi pain less deployment.<br />
<!--more--><br />
Kini passenger telah berevolusi menjadi mod_rack. <a href="http://rack.rubyforge.org" target="_blank">Rack</a> merupakan library ruby yg dibuat dengan tujuan menyeragamkan proses start webserver dengan menyediakan interface standard, sehingga apapun framework yg digunakan dan webservernya, tetap dapat berjalan, tanpa melakukan perubahan konfigurasi. Saat ini framework2 Ruby lain (Merb,Sinatra,Ramaze,Camping,dll) yg telah mendukung Rack dapat berjalan di apache dengan passenger tanpa masalah.</p>
<p>Passenger hanya dapat di install pada mesin *NIX. Windows mohon maaf, untuk saat ini ga masuk hitungan. Berikut langkah2 instalasi pada Linux Ubuntu (passenger Versi 2.0.2).</p>
<p>- Pertama2 pastinya harus telah menginstall Apache dan Ruby.<br />
Dianjurkan menggunakan <a href="http://rubyenterpriseedition.com" target="_blank">RubyEnterpriseEdition(REE)</a>, menurut janjinya Phusion, dpat mengurangi pemakaian memory hingga 30%.</p>
<p>- Download REE.deb, execute dan ikuti proses installasi hingga selesai<br />
- Install Ruby Dev Header: sudo apt-get install ruby1.8-dev<br />
- Install Apache Dev Header: sudo apt-get install apache2-prefork-dev<br />
- Install APR Dev Header: sudo apt-get install libapr1-dev<br />
- Install passenger, bisa compile dari <a href="http://rubyforge.org/frs/?group_id=5873&#38;release_id=23881" target="_blank">source</a> ataupun melalui rubygems<br />
Jika ingin compile source, download sourcenya <a href="http://www.modrails.com">disini</a>, ekstrak, dan masuk kedirektorinya.</p>
<p>- ./configure<br />
- sudo make &#38;&#38; make install</p>
<p>Jika rubygems<br />
- sudo gem install passenger</p>
<p>- Jalankan: sudo passenger-install-apache2-module<br />
ikuti hingga proses meminta untuk mengubah httpd.conf, tanpa berhenti dari proses installasi,</p>
<p>- edit file /etc/apache2/httpd.conf, tambahkan baris kode berikut<br />
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.2/ext/apache2/mod_passenger.so<br />
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.2<br />
PassengerRuby /opt/ruby-enterprise/bin/ruby</p>
<p>- Save dan exit proses edit httpd.conf</p>
<p>- Lanjutkan proses installasi dengan menekan enter</p>
<p>- Edit setting virtual host, sehingga aplikasi rails dpat berjalan<br />
edit file /etc/apache2/sites-enabled/000-default, didalam tag &#60;VirtualHost&#62; dibaris paling akhir tambahkan kode berikut RailsBaseURI /rails_saya. Ini merupakan url yg nantikan akan diarahkan ke aplikasi rails anda.</p>
<p>- Save exit, dan proses installasi selesai.</p>
<p>- Create new Rails app : rails app_saya</p>
<p>- buat symlink dari folder public aplikasi rails tsb ke document root apache server(/var/www)<br />
ln -s /home/irfani/Desktop/app_saya/public /var/www/rails_saya</p>
<p>- perhatikan rails_saya harus sama dengan url di RailsBaseURI</p>
<p>- restart apache server: sudo /etc/init.d/apache2 restart</p>
<p>- Buka browser masukkan url http://localhost/rails_saya. Ta daaa&#8230;.Halaman welcome default rails akan tampil. Fast enaugh.</p>
<p>- Karena dalam env production, maka perubahan kode tidak akan seketika berdampak pada aplikasi rails yg telah dideploy, untuk itu diperlukan restart apache. Namun cara ini terlalu boros, dimana seluruh module apache2 lainnya akan di reload. Bagaimana jika hanya mereload aplikasi railsnya saja? caranya adalah : touch /home/irfani/Desktop/rails_saya/tmp/restart.txt</p>
<p>- Reload browser dan perubahan akan dijalankan</p>
<p>- passenger menjalankan rails dalam env Production, so ingat create database untuk production:<br />
rake db:create:all dan lakukan migrate production rake db:migrate RAILS_ENV=production</p>
<p>Terimakasih. Salam dari Bali.rb untuk Komunitas Ruby Indonesia</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Why Does Mod_Rails Start Slowly?]]></title>
<link>http://appletownprince.com/2008/07/01/why-does-mod_rails-start-slowly/</link>
<pubDate>Wed, 02 Jul 2008 05:19:02 +0000</pubDate>
<dc:creator>simplelight</dc:creator>
<guid>http://appletownprince.com/2008/07/01/why-does-mod_rails-start-slowly/</guid>
<description><![CDATA[If you&#8217;re running your low-volume Ruby on Rails app on mod_rails (Passenger) and have wondered]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you&#8217;re running your low-volume Ruby on Rails app on mod_rails (Passenger) and have wondered why the first page takes 5 seconds or more to load, there is an <a title="Slow Passengers" href="http://www.pervasivecode.com/blog/2008/04/14/why-mod_rails-is-a-really-good-thing-for-light-duty-ruby-on-rails/">excellent explanation here</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Rails deployment made easy]]></title>
<link>http://marcelscherf.com/2008/07/01/rails-deployment-made-easy/</link>
<pubDate>Tue, 01 Jul 2008 21:44:52 +0000</pubDate>
<dc:creator>marcelscherf</dc:creator>
<guid>http://marcelscherf.com/2008/07/01/rails-deployment-made-easy/</guid>
<description><![CDATA[There&#8217;s a new gem called passenger which makes it very easy to deploy your rails application o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There&#8217;s a new gem called <strong>passenger</strong> which makes it very easy to deploy your rails application on a Apache2 server. Here is the website of the project: <a href="http://www.modrails.com">Passenger</a></p>
<p>There&#8217;s also a short screencast you can watch to see how easy rails deployment can be: <a href="http://www.modrails.com/videos/passenger.mov">Passenger Screencast</a> (the video is made by Ryan Bates from <a href="http://www.railscasts.com">railscasts</a> so the voice should sound familiar <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[A Recovering Programmer]]></title>
<link>http://appletownprince.com/2008/06/25/a-recovering-programmer/</link>
<pubDate>Thu, 26 Jun 2008 07:09:36 +0000</pubDate>
<dc:creator>simplelight</dc:creator>
<guid>http://appletownprince.com/2008/06/25/a-recovering-programmer/</guid>
<description><![CDATA[I was once a respected coder. But for 5 years I&#8217;d designed ASIC&#8217;s using Verilog (where e]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I was once a respected coder. But for 5 years I&#8217;d designed ASIC&#8217;s using Verilog (where everything happens at once) and then for 5 years I&#8217;d turned to business. And it all changes in a decade. I&#8217;d let my skills lapse and in the interim C++ had morphed to Java and then suddenly CPU&#8217;s got really fast and scripting was back in vogue. </p>
<p>I realized that my CS undergrad was quickly becoming worthless. Web programming was a complete mystery to me. (Whether that was really a problem is a philosophical question beyond the scope of a humble blog entry). Here is my road to recovery. In bullet point form amenable to PowerPoint and as buzzword compliant as possible.</p>
<p>Jan 1st, 2008: Resolve to brush up on programming skills.</p>
<p>Which language should I learn? Web development seems cool&#8230;.what&#8217;s involved in that? Narrowed it down to a) the LAMP stack or b) Ruby on Rails. Do I want to be a) paid as a programmer or b) hip ?</p>
<p>I went with Hip. Rails it is.</p>
<p>Here are the steps (and mistakes) I took on the road to recovery:</p>
<ol>
<li>Linux &#8211; I remember that: &#8220;ls -al&#8221; and all that. It&#8217;s the sine qua non for a real programmer.</li>
<li><a href="mailto:F@(k">F@(k</a>. That&#8217;s a lot of variants of Linux. Go with Ubuntu because I&#8217;m semi-African.</li>
<li>Hmm&#8230; Windows XP is standard issue at work.</li>
<li>Get an old PC from my IT guy. Spend an entire day installing Ubuntu. Realize I&#8217;m now a web programmer so start again and install the server version. What the hell? What&#8217;s involved with web programming anyway. Will I be writing the client or the server?</li>
<li>Call college roommate who is on &#8220;tiger team&#8221; at Yahoo. He says: &#8220;Buy <a title="Pickaxe" href="http://pragprog.com/titles/ruby/programming-ruby">Pickaxe</a>&#8220;. Sold. In a flash of environmental sympathy I buy the PDF version. It also saves $10. Print it out on corporate printer. Double sided to save the environment.</li>
<li>Need the Rails part: Buy &#8220;<a title="Agile Web Development with Rails" href="http://pragprog.com/titles/rails2/agile-web-development-with-rails">Agile Web Development with Rails</a>&#8220;. We invested in an Agile software company so &#8220;agility&#8221; must be good.</li>
<li>Start reading. In the interest of time and an anxiety to see the global greeting I dispense with Linux and deploy InstantRails on Windows &#8211;&#62; Instant gratification. (Nice to see those programmer types have dropped their antipathy towards Microsoft. I&#8217;m a web programmer. Even if it&#8217;s only on localhost. (Wow: It&#8217;s only February and I could compete with Amazon if I wanted to and if I knew where to buy all the books for my bookstore)</li>
<li>I have a bookstore up and running. No one can see it. That&#8217;s ok&#8230;.how hard can deployment be.</li>
<li>March. Deploytment is hard. People don&#8217;t recommend Windows. Could I be the only person writing Ruby code in a Rails environment on Windows XP. Seems to be from my google searches.</li>
<li>Let&#8217;s reinstall Ubuntu Linux.</li>
<li>Install ruby gems. Rinse. Repeat. Rinse. Repeat. Check dependencies. Rinse Repeat. Rinse. Repeat.</li>
<li>Install MySQL. (It&#8217;s nice that I don&#8217;t need to think too much about the database. Seems like something business people should concern themselves with).</li>
<li>Stuff is working. Slow as all hell on this ancient PC but what the hell. People will wait for the page to load.</li>
<li>Becoming a problem that I can only work on my hobby at work. Can&#8217;t afford another PC at home.</li>
<li>VMware to the rescue. Downloading an Ubuntu VM on my home PC is a cinch. And hip. Which is important.</li>
<li>Realize I need a real hosting service. (Weeks of agonizing research). Settle on <a title="Dreamhost" href="http://www.dreamhost.com/r.cgi?421109" target="_blank">Dreamhost</a>. (I love those guys!)</li>
<li>Deploy app. Hmmm&#8230;this is a <a href="mailto:f@(k1ng">f@(k1ng</a> nightmare!</li>
<li><a title="Passenger (mod_rails)" href="http://simplelight.wordpress.com/2008/05/27/migrating-rails-app-to-dreamhost-using-mod_rails/">Passenger (mod_rails)</a> is released a few days later. I realize I&#8217;m back on the cutting edge. Deployment is now piss easy.</li>
<li><a href="http://www.assetcorrelation.com">www.assetcorrelation.com</a> (Live as of June 1st, 2008 &#8212; 5 months start to finish)</li>
<li>Start to harass Google to show me some organic search love.</li>
</ol>
<p>It&#8217;s been a wild ride. And not as hard as I thought. In the end, we return to the beginning. I still hate writing test benches. Hacking is still fun. And not having deadlines is the way to go. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
