<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vinsol - Leading Ruby on Rails Development and Consulting Firm in India &#187; deployment</title>
	<atom:link href="http://vinsol.com/blog/category/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinsol.com/blog</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 08:37:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>11 Things to Consider Before Deploying Your Ruby on  Rails Application</title>
		<link>http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/</link>
		<comments>http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 21:13:46 +0000</pubDate>
		<dc:creator>kapil</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[checklist]]></category>

		<guid isPermaLink="false">http://vinsol.com/blog/?p=787</guid>
		<description><![CDATA[At VinSol, we have been developing and deploying Rails applications for more than four years. During this period, we  have identified some best practices that we prefer to follow while deploying  rails application to production server.
Below is the checklist of these practices:
 &#160; 
1. Ensure that NS records and MX records are changed if they [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>At VinSol, we have been developing and deploying Rails applications for more than four years. During this period, we  have identified some best practices that we prefer to follow while deploying  rails application to production server.</p>
<p>Below is the checklist of these practices:</p>
<p> &nbsp; </p>
<p><strong>1. </strong><strong>Ensure that NS records and MX records are changed if they need to be changed</strong></p>
<p>Changing nameservers will point the domain to the hosting server,  and changing MX records will redirect incoming mails to the mail server. As a very first step, we should make sure that name servers of the domain are set to be the correct one.  Changing MX record is a must if our application is parsing incoming mails or we wants to use other mail services for e-mail exchange, for example Gmail.</p>
<p> &nbsp; </p>
<p><strong>2. Ensure some backup mechanism in place for both data as well as user uploaded content like images/documents etc.</strong></p>
<p>Since production data is very critical, we must setup backup  mechanism. It could be some type of scheduled task that takes periodic backup of all critical data, Or it could be some type of backup service provided by hosting company. When we talk about critical production data, it includes production DB, content generated by application users like images, documents, etc.</p>
<p> &nbsp; </p>
<p><strong>3. Ensure database indexes</strong></p>
<p>We might have done development without having proper database indexes, but we should avoid going to production without them. Adding indexes might slow down insert queries a bit but it increases the  performance of read queries. It applies when application in production has percentage of read operations much more than write operations.</p>
<p> &nbsp; </p>
<p><strong>4. Enable your slow query log</strong></p>
<p>This is specific to MySQL. Enabling slow query log allows MySQL to log slow running queries to a file. And this log can be used to find queries that take a long time to execute and are therefore candidates for optimization.</p>
<p> &nbsp; </p>
<p><strong>5. Ensure exception capturing is in place</strong></p>
<p>We might want to be notified when something bad happens to our application. There are several hosted services available who receive and track exceptions, for example <a href="hoaptoadapp.com" target="_blank">Hoptoadapp.com</a>,<a href="http://getexceptional.com/"> GetExceptional.com</a> etc&#8230;  Either we can choose one from these hosted services or we can use <a href="http://agilewebdevelopment.com/plugins/exception_notifier">“exception notifier”</a> plugin.</p>
<p> &nbsp; </p>
<p><strong>6. Ensure adding entries for cron/scheduled jobs</strong></p>
<p>Most of the applications have some functionality/jobs that need to be run periodically, for example generating invoices, sending newsletters etc.  In most cases these jobs are done by a rake task. We should make sure that we have added such jobs to cron or similar program.</p>
<p> &nbsp; </p>
<p><strong>7.  Monitoring important processes</strong></p>
<p>To ensure that our site is up 24&#215;7 we need to ensure that all processes that our application needs are up. There can be many processes like MySQL, Mongrel, Apache etc.. These processes are very important as our application directly depends on them. For example if MySQL process get killed accidentally, our application would not be able to connect to MySQL and will start throwing exceptions.</p>
<p>We can choose any of the available monitoring tools like God, Monit, 24&#215;7 etc&#8230;</p>
<p> &nbsp; </p>
<p><strong>8. Ensure confidential data filtering</strong></p>
<p>We would never like to leak/share confidential information of our application users. We should make sure that none of the user&#8217;s confidential data like SSN, Credit card info, password are being written to log files. We might not have paid much attention on this while developing the application.</p>
<p> &nbsp; </p>
<p><strong>9. Rotate log files</strong></p>
<p>Once our site is up and running, every single request write some text in log file. And hence size of the  log file keeps on increasing. Larger log files can put us in trouble if we get it beyond certain size. Its difficult to manage these log files, as larger files need more memory to open and need more time to download. In one of the rescue project we did , the log file size was 3GB.</p>
<p>We would recommend having<a href="http://www.nullislove.com/2007/09/10/rotating-rails-log-files/"> logrotate setup</a> for the application.</p>
<p> &nbsp; </p>
<p><strong>10. Setup Asset Host </strong></p>
<p>Setting up asset hosts can reduce loading time by 50% or more. We must setup asset hosts for our application. Once asset hosts are all set, our static files will be delivered via asset hosts for example asset1.hostname.com, asset2.hostname.com</p>
<p> &nbsp; </p>
<p><strong>11. Clearing up stale sessions</strong></p>
<p>We should make sure we should not left any stale session on the server. If our application is using DB or file system  as session store, we must add a schedule task to delete stale sessions.</p>
<p>These are some of the points we have identified from our past experience and we might be missing some. Feel free to  always add them as comments, and I&#8217;ll keep this post updated.</p>
<hr size = 2 width = "98%" style="border-top:2px dotted grey; margin: 5px;"/>
<img src="http://www.gravatar.com/avatar/174330d280860a6ad77a6d15dd7fabe1?s=96&#038;d=wavatar&#038;r=G" height="50" align="left" hspace="10" vpsace="10" /> <a href="http://www.webonrails.com" target="_blank"> Akhil </a> is a senior software engineer working with Vinsol for last 5 years. He is an inhouse deployment ninja.</p>
<div style ="clear:both"> &nbsp;</div>
<hr size = 2 width = "98%" style="border-top:2px dotted grey; margin: 5px;"/>
<p> &nbsp; </p>
<p>We also provide affordable <a href="http://vinsol.com/rails-deployment-services"> rails deployment services</a>.  </p>
<p> &nbsp; </p>
<p> &nbsp; </p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hosting Rails app and Wordpress on same domain(as folder instead of subdomain)</title>
		<link>http://vinsol.com/blog/2008/08/08/hosting-rails-app-and-wordpress-on-same-domainas-folder-instead-of-subdomain/</link>
		<comments>http://vinsol.com/blog/2008/08/08/hosting-rails-app-and-wordpress-on-same-domainas-folder-instead-of-subdomain/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 08:35:31 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[virtualhost]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://webonrails.com/2008/08/08/hosting-rails-app-and-wordpress-on-same-domainas-folder-instead-of-subdomain/</guid>
		<description><![CDATA[Hey guys, Yesterday I did an interesting server configuration. Actually we had a rails app hosted on server which is using passenger(a.k.a mod_rails). This application can be access by going to http://domain.com . Also we had a wordpress running which could be access by going to http://blog.domain.com. 
But, for SEO sake I had to change [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey guys, Yesterday I did an interesting server configuration. Actually we had a rails app hosted on server which is using <a href="http://www.modrails.com/" target = '_blank'>passenger</a>(a.k.a mod_rails). This application can be access by going to http://domain.com . Also we had a wordpress running which could be access by going to http://blog.domain.com. </p>
<p>But, for SEO sake I had to change configuration so that wordpress can be access by http://domain.com/blog instead of http://blog.domain.com/</p>
<p>The problem was if I configure wordpress for http://domain.com/blog and go to this url, the request was handled by rails app because of domain.com virtualhost. </p>
<p>So what I did? I changed apache virtualhost configuration for http://blog.domain.com and http://domain.com as:</p>
<textarea name="code" class="c" cols="50" rows="10">
<VirtualHost *>
    ServerName blog.domain.com

    DocumentRoot /var/www/html/wordpress/
    <Directory "/var/www/html/wordpress/">
      Options FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
   </Directory>
 </VirtualHost>


<VirtualHost *>
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot /var/www/html/domain/current/public
    <Directory "/var/www/html/domain/current">
      Options FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>
    
  RailsAllowModRewrite  on
  RewriteRule ^/blog/?(.*)$ http://blog.domain.com/$1 [P,NC,L]

 </VirtualHost>

</textarea>
<p>Also I created a symbolic link to wordpress installation directory under rails public folder(ln -s /var/www/html/wordpress /var/www/html/railsapp/blog).</p>
<p>I restarted apache and it worked fine. Wordpress was running at http://domain.com/blog and rails app was as http://domain.com/.
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2008/08/08/hosting-rails-app-and-wordpress-on-same-domainas-folder-instead-of-subdomain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presented at BarCampDelhi3</title>
		<link>http://vinsol.com/blog/2007/12/10/presented-at-barcampdelhi3/</link>
		<comments>http://vinsol.com/blog/2007/12/10/presented-at-barcampdelhi3/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 07:57:33 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Barcamp]]></category>
		<category><![CDATA[Delhi]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/12/10/presented-in-barcampdelhi3/</guid>
		<description><![CDATA[Yesterday, I attended third barcamp in delhi. I presented a session &#8220;Deploying rails application in EC2&#8243;.  It was an amazing experience. We talked about EC2 and I have given a demo &#8220;How to deploy rails application on EC2&#8243;.
I personally didn&#8217;t like some sessions that are based on marketing. There were people from some hosting [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I attended<a href="http://www.barcamp.org/BarCampDelhi3"> third barcamp in delhi</a>. I presented a session &#8220;Deploying rails application in EC2&#8243;.  It was an amazing experience. We talked about EC2 and I have given a demo &#8220;How to deploy rails application on EC2&#8243;.</p>
<p>I personally didn&#8217;t like some sessions that are based on marketing. There were people from some hosting company and after every 2 mins they were saying &#8220;we are the best&#8221;. I think this should not happen in barcamp. As far as I know about barcamp, it is for sharing your experiences, Talking about new technology, but not for promoting your company.</p>
<p>I think that, at BarCamp there should be sessions on new things, not on the things that are popular and have similar other services.</p>
<p>There was a very good session by  Jinesh Varia on Amazon Cloud Computing. He included Amazon&#8217;s simple storage system, and  Amazon&#8217;s cloud computing(Ec2) in his presentation. He also helped me to answering people while the demo. He gave me a hint that very soon there will a news from Amazon that will surprise us. </p>
<p>I have uploaded my presentation slides on Slideshare.net:</p>
<div  id="__ss_197972"><object  width="425" height="355">
<param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=deploying-rails-app-on-ec2-1197272291134652-3"/>
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=deploying-rails-app-on-ec2-1197272291134652-3" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div ><a href="http://www.slideshare.net/?src=embed"><img src="http://static.slideshare.net/swf/logo_embd.png"  alt="SlideShare"/></a> | <a href="http://www.slideshare.net/bansalakhil/deploying-rails-app-on-ec2" title="View 'Deploying Rails App On Ec2' on SlideShare">View</a> | <a href="http://www.slideshare.net/upload">Upload your own</a></div>
</div>
<p>Thanks to <a href="http://impetus.com">Impetus</a> Noida for Hosting Barcamp for second time and <a href="http://www.opera.com/">Opera</a> for Beer.
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/12/10/presented-at-barcampdelhi3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running Rails Application on https with pound</title>
		<link>http://vinsol.com/blog/2007/09/13/running-rails-application-on-https-with-pound/</link>
		<comments>http://vinsol.com/blog/2007/09/13/running-rails-application-on-https-with-pound/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 13:58:56 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[mongrel_cluster]]></category>
		<category><![CDATA[pound]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/09/13/running-rails-application-on-https-with-pound/</guid>
		<description><![CDATA[Hours ago, I posted about, &#8220;How to deploy rails application with pound as a Balancer&#8221;.
Lets run rails application on https with pound. For that your machine should have:
* Pound installed with ssl support
* Pound and mongrels running
Now, First of all we need a ssl certificate, that can be generate by issuing &#8220;openssl req -x509 -newkey [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hours ago, I posted about, <a href="http://webonrails.com/2007/09/13/deploying-rails-application-with-pound-as-a-balancer/" target = "_blank">&#8220;How to deploy rails application with pound as a Balancer&#8221;</a>.</p>
<p>Lets run rails application on https with pound. For that your machine should have:</p>
<p>* Pound installed with ssl support<br />
* Pound and mongrels running</p>
<p>Now, First of all we need a ssl certificate, that can be generate by issuing <strong>&#8220;openssl req -x509 -newkey rsa:1024 -keyout mydomain.pem  -out mydomain.pem -days 365 -nodes&#8221;</strong> . Give all the information it asks. Now copy mydomain.pem to /etc/pound/ directory(I am assuming that your pound.cfg file resides in /etc/pound/). Now put the following code in pound configuration file(/etc/pound/pound.cfg):</p>
<textarea name="code" class="c++" cols="50" rows="10">
ListenHTTPS
  Address 0.0.0.0
  Port    443
  Cert    "/etc/pound/mydomain.pem" 
  # pass along https hint
  AddHeader "X-Forwarded-Proto: https" 
  HeadRemove "X-Forwarded-Proto" 

Service
    URL "/(images|stylesheets|javascripts)/"
    BackEnd
        Address 127.0.0.1
        Port    8080
    End
    Session
        Type    BASIC
        TTL     300
    End

End

  Service
    BackEnd
      Address 127.0.0.1
      Port    8000
    End
    BackEnd
      Address 127.0.0.1
      Port    8001
    End
    BackEnd
      Address 127.0.0.1
      Port    8002
    End
  End
End
</textarea>
<p>I am assuming that your mongrels are running at ports 8000, 8001, 8002, apache running at 8080 and pound is listening ports 443 &#038; 80.<br />
Restart pound, and you are done. With this configuration all requests for dynamic content at port 443(https) will get redirected to mongrels and requests for static content will get redirected to apache.</p>
<p>You may want to check if the request is https or not before serving the content. That can be done by adding a before_filter (defined below) in application.rb  :</p>
<textarea name="code" class="ruby" cols="50" rows="10">
def confirm_ssl
  unless request.ssl?
    request.env["HTTPS"] = "on"
    redirect_to "/"
    return
  end
end
</textarea>
<p>By adding this method as before_filter in application.rb your application will check for https, if the request is not of type https it will redirect to an https request.
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/13/running-rails-application-on-https-with-pound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying rails application with pound as a Balancer</title>
		<link>http://vinsol.com/blog/2007/09/13/deploying-rails-application-with-pound-as-a-balancer/</link>
		<comments>http://vinsol.com/blog/2007/09/13/deploying-rails-application-with-pound-as-a-balancer/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 12:40:38 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mongrel_cluster]]></category>
		<category><![CDATA[pound]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/09/13/deploying-rails-application-with-pound-as-a-balancer/</guid>
		<description><![CDATA[Now a days Apache + mod_proxy + mongrel_clusters, Lighttpd + Mongrel cluster and Nginx + mongrel cluster are well known for deploying rails applications. 
You can also deploy your rails application with pound(a reverse proxy, load balancer and HTTPS front-end for Web server). 
First you need to setup mongrel_clusters for your rails application by issuing [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/' rel='bookmark' title='Permanent Link: 11 Things to Consider Before Deploying Your Ruby on  Rails Application'>11 Things to Consider Before Deploying Your Ruby on  Rails Application</a> <small>At VinSol, we have been developing and deploying Rails applications...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Now a days Apache + mod_proxy + mongrel_clusters, Lighttpd + Mongrel cluster and Nginx + mongrel cluster are well known for deploying rails applications. </p>
<p>You can also deploy your rails application with <a href="http://www.apsis.ch/pound/"  target= "_blank">pound</a>(a reverse proxy, load balancer and HTTPS front-end for Web server). </p>
<p>First you need to setup mongrel_clusters for your rails application by issuing &#8221; <strong>mongrel_rails cluster::configure -e production -p 8000 -a 127.0.0.1 -N 3 -c ./</strong> &#8221; inside the rails application root directory(on client machine). This will create mongrel_cluster.yml in config directory. You can change parameters in this command, as -p 8000 specifies that mongrel instances  will start  up on port  number starting 8000, -a 127.0.0.1 specifies that mongrel instances will listen to the localhost, -N specifies the number of mongrel instances and -c specifies the rails root directory.</p>
<p>Now you need to install pound(if not installed) by issuing following commands(as root):</p>
<ul>
<li>cd /opt/src</li>
<li>wget http://www.apsis.ch/pound/Pound-2.3.2.tgz</li>
<li>tar xzpf Pound-2.1.6.tgz</li>
<li>cd Pound-2.1.6</li>
<li>./configure</li>
<li>make</li>
<li>make install</li>
</ul>
<p>This will install pound in /usr/local/sbin/pound. In order to proceed further we need to create pound.cfg(pound configuration file) in /etc/pound/pound.cfg . Below is the content of pound.cfg:</p>
<p><textarea name="code" class="c++" cols="50" rows="10"></p>
<p>User &#8220;pound&#8221;<br />
Group &#8220;pound&#8221;</p>
<p>ListenHTTP<br />
  Address 0.0.0.0<br />
  Port 80<br />
  Service<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8000<br />
    End<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8001<br />
    End<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8002<br />
    End<br />
  End<br />
End<br />
</textarea></p>
<p>Start mongrel cluster by issuing mongrel_rails cluster::start in you app root directory, start pound by /usr/local/sbin/pound -f /etc/pound/pound.cfg , now you are done. Pound is listening the port 80 and redirect all requests to mongrel instances running on 8000, 8001, 8002.</p>
<p>* Please Note that we have configured pound at port 80, if port 80 is being used by apache or any other application pound will not start. You need to stop any service using  port 80, if it is apache then stop apache, change line &#8216;Listen 80&#8242; to &#8220;Listen 8080&#8243; and start apache.</p>
<p>In a specific case, when apache is running at some port (let say 8080), you may want to use apache to serve static content of your application, in order to reduce some load from mongrels. In that case use the following:</p>
<p><textarea name="code" class="c++" cols="50" rows="10"></p>
<p>User &#8220;pound&#8221;<br />
Group &#8220;pound&#8221;</p>
<p>ListenHTTP<br />
  Address 0.0.0.0<br />
  Port 80<br />
  Service<br />
      URL &#8220;/(images|stylesheets|flash|javascripts)/&#8221;<br />
      BackEnd<br />
          Address 127.0.0.1<br />
          Port    8080<br />
      End<br />
      Session<br />
          Type    BASIC<br />
          TTL     300<br />
      End<br />
  End<br />
  Service<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8000<br />
    End<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8001<br />
    End<br />
    BackEnd<br />
      Address 127.0.0.1<br />
      Port 8002<br />
    End<br />
  End<br />
End<br />
</textarea></p>
<p>This will redirect all requests for image, stylesheets, javascripts, flash to apache. Now we need to configure apache to serve those static content. Just add a virtualhost for that:</p>
<p><textarea name="code" class="c++" cols="50" rows="10"><br />
<VirtualHost *:8080><br />
  ServerName example.com<br />
  ServerAlias www.example.com<br />
  DocumentRoot /var/www/html/example.com/public<br />
  <Directory "/var/www/html/example.com/public" ><br />
    Options FollowSymLinks<br />
    AllowOverride None<br />
    Order allow,deny<br />
    Allow from all<br />
  </Directory></p>
<p>  RewriteEngine On</p>
<p>  # For static files it&#8217;s good to avoid hitting your mongrel process<br />
  # so let apache knows it should serve it directly<br />
  # for a rails application it means, files in images / stylesheets / javascripts<br />
  RewriteRule &#8220;^/(images|stylesheets|flash|javascripts)/?(.*)&#8221; &#8220;$0&#8243; [L]</p>
<p></VirtualHost><br />
</textarea></p>
<p>Its all done. All requests for dynamic content at port 80 will be redirect to mongrel running at 8000, 8001, 8001 and requests for static content will be served by apache running at port 8080.</p>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2009/11/16/11-things-to-consider-before-deploying-your-rails-application/' rel='bookmark' title='Permanent Link: 11 Things to Consider Before Deploying Your Ruby on  Rails Application'>11 Things to Consider Before Deploying Your Ruby on  Rails Application</a> <small>At VinSol, we have been developing and deploying Rails applications...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/13/deploying-rails-application-with-pound-as-a-balancer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
