<?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; Technology</title>
	<atom:link href="http://vinsol.com/blog/category/technology/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>Git &#8211; Fast Version Control System</title>
		<link>http://vinsol.com/blog/2008/02/14/git-fast-version-control-system/</link>
		<comments>http://vinsol.com/blog/2008/02/14/git-fast-version-control-system/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 19:11:01 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[SCM]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[VCS]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://webonrails.com/2008/02/15/git-fast-version-control-system/</guid>
		<description><![CDATA[Git is getting popular in Rails community these days, as there were being many changes in rails to support Git.
Git is a open sourse fast version controller system. It was originally designed by Linus Torvalds to handle large projects. It was inspired by Monotone &#038; BitKeeper. It is a distributed version controlling system. It gives [...]


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><a href="http://git.or.cz/">Git</a> is getting popular in Rails community these days, as there were being many <a href="http://dev.rubyonrails.org/changeset/8772">changes</a> in rails to support Git.<br />
Git is a open sourse fast version controller system. It was originally designed by Linus Torvalds to handle large projects. It was inspired by Monotone &#038; BitKeeper. It is a distributed version controlling system. It gives you ability to commit, traverse into history while being offline. Actually every working copy of Git is a full-fledged repository. It has no central server like <a href="http://subversion.tigris.org/">SVN</a>. One can share his working-copy/repository by using various protocols like ssh, http, ftp etc. One thing I like about Git over SVN is that the size of Git&#8217;s repository, which is smaller compared to SVN.</p>
<p>I gave an introductory presentation in <a href="http://vinsol.com/">VinSol</a>. I am sharing it with you, this is not very explanatory as I focused on speech more. Please share your views.VinSol</p>
<div style="width:425px;text-align:left" id="__ss_354888"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=git1-1208284093507575-8"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=git1-1208284093507575-8" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"><a href="http://www.slideshare.net/?src=embed"><img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare"/></a> | <a href="http://www.slideshare.net/bansalakhil/git-fast-version-control-system-354888?src=embed" title="View 'Git- Fast version control system' on SlideShare">View</a> | <a href="http://www.slideshare.net/upload?src=embed">Upload your own</a></div></div>]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2008/02/14/git-fast-version-control-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migration: Adding/Removing columns are now much easier</title>
		<link>http://vinsol.com/blog/2008/01/23/migration-addingremoving-columns-are-now-much-easier/</link>
		<comments>http://vinsol.com/blog/2008/01/23/migration-addingremoving-columns-are-now-much-easier/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 17:24:54 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://webonrails.com/2008/01/23/migration_adding_removing_columns_are_now_much_easier/</guid>
		<description><![CDATA[You may have noticed by now, that in Rails 2.0 changeset 7422, you can specify columns you want to add/remove in your migration by passing attribute:type pairs to the migration generator. 
For example, lets assume that we need to add a column &#8216;role&#8217; in users table(User model). In this case generate a migration like:

script/generate migration [...]


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>You may have noticed by now, that in Rails 2.0 <a href="http://dev.rubyonrails.org/changeset/7422">changeset 7422</a>, you can specify columns you want to add/remove in your migration by passing <strong>attribute:type</strong> pairs to the migration generator. </p>
<p>For example, lets assume that we need to add a column &#8216;role&#8217; in users table(User model). In this case generate a migration like:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
script/generate migration AddRoleToUser role:string
</textarea>
<p>Output:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
class AddRoleToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :role, :string
  end

  def self.down
    remove_column :users, :role
  end
end
</textarea>
<p>Here <strong>Add</strong>Role<strong><em>To</em></strong><strong>User</strong> plays the main role. &#8216;Add&#8217; specifies the we want to add column(s) and &#8216;User&#8217; separated by &#8216;To&#8217; specifies the table.</p>
<p>Similarly, if we need to remove a column &#8216;role&#8217; :</p>
<textarea name="code" class="ruby" cols="50" rows="10">
 script/generate migration RemoveRoleFromUser role:string
</textarea>
<p>Output:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
class RemoveRoleFromUser < ActiveRecord::Migration
  def self.up
    remove_column :users, :role
  end

  def self.down
    add_column :users, :role, :string
  end
end
</textarea>
<p>Here <strong>Remove</strong>Role<strong><em>From</em></strong><strong>User</strong> plays the main role. &#8216;Remove&#8217; specifies the we want to remove column(s) and &#8216;User&#8217; separated by &#8216;From&#8217; specifies the table.</p>
<p>Isn&#8217;t it cool?
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2008/01/23/migration-addingremoving-columns-are-now-much-easier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff</title>
		<link>http://vinsol.com/blog/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/</link>
		<comments>http://vinsol.com/blog/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 14:17:16 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://webonrails.com/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/</guid>
		<description><![CDATA[Some days ago I wrote a post about &#8220;SVN commit notification&#8221; which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2010/03/29/jquery-full-calendar-with-rails/' rel='bookmark' title='Permanent Link: Jquery Full Calendar with Ruby on Rails'>Jquery Full Calendar with Ruby on Rails</a> <small>Contrary to popular belief, working on a client project gives...</small></li>
<li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</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>Some days ago I wrote a post about &#8220;<a href="http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/">SVN commit notification</a>&#8221; which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult to read. Also there were some important information missing.  Like the name of user committing the code, the log message etc&#8230; </p>
<p>And then I started writing my own ruby script for same purpose but with some addition and modification. <a href="http://webonrails.com/wp-content/plugins/wp-downloadMonitor/download.php?id=7" title="Version 0.1 downloaded 17 times" >Commit notification script</a> is that script, you can download and configure it with your SVN post commit hook as follows.</p>
<p>Add following line at the bottom of your post-commit file:</p>
<p><textarea name="code" class="ruby" cols="50" rows="10"><br />
/usr/bin/ruby /var/www/repositories/project/hooks/commit-email.rb &#8220;$1&#8243;  &#8220;$2&#8243;<br />
</textarea></p>
<p>* Please remember to change the path of you commit-email ruby script.</p>
<p>Now open commit-email ruby file and modify the following section according to your requirement:</p>
<p><textarea name="code" class="ruby" cols="50" rows="10"><br />
# You can edit below</p>
<p># Subject prefix<br />
sub = &#8220;[test_project@vinsol]&#8221;  # A project &#8216;test_project&#8217; is maitained at vinsol</p>
<p>#list of users who will recieve commit notification<br />
recipients = ["bansalakhil30.10@gmail.com", "akhil@vinsol.com"]</p>
<p># email which will appear in from email field<br />
from_user = &#8220;svn-notify@somedomain.com&#8221;</p>
<p># your smtp settings here<br />
ActionMailer::Base.smtp_settings = { :address => &#8216;localhost&#8217;, :port => 25, :domain => &#8216;domain.com&#8217;}</p>
<p># Do not edit below this line<br />
</textarea></p>
<p>You are done with that, now onwards whenever someone commits the code, you&#8217;ll get the commit notification mail like:</p>
<p><a class="imagelink" href="http://webonrails.com/wp-content/uploads/2008/01/commit-email-preview.png" title="Commit Email Preview"><img id="image104"  width = 100% src="http://webonrails.com/wp-content/uploads/2008/01/commit-email-preview.png" alt="Commit Email Preview" /></a></p>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2010/03/29/jquery-full-calendar-with-rails/' rel='bookmark' title='Permanent Link: Jquery Full Calendar with Ruby on Rails'>Jquery Full Calendar with Ruby on Rails</a> <small>Contrary to popular belief, working on a client project gives...</small></li>
<li><a href='http://vinsol.com/blog/2010/04/01/ssl-checklist-for-rails-applications/' rel='bookmark' title='Permanent Link: SSL checklist for Ruby on Rails Applications'>SSL checklist for Ruby on Rails Applications</a> <small>Cross posted from darthsid The purpose of SSL is to...</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/2008/01/14/ruby-script-for-svn-commit-notification-with-log-message-list-of-updated-files-and-readable-colored-svn-diff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Single Table Inheritance validates_uniqueness_of Problem</title>
		<link>http://vinsol.com/blog/2007/10/26/single-table-inheritance-validates_uniqueness_of-problem/</link>
		<comments>http://vinsol.com/blog/2007/10/26/single-table-inheritance-validates_uniqueness_of-problem/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 07:45:02 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/10/26/single-table-inheritance-validates_uniqueness_of-problem/</guid>
		<description><![CDATA[Consider a case of STI where:

class User < ActiveRecord::Base
  validates_uniqueness_of :name
end

class Customer < User

end

class Manager < User

end

Now try following at console:

User.create(:name => "Akhil Bansal")
Manager.create(:name => "Akhil Bansal")
Customer.create(:name => "Akhil Bansal")

This will let you create three records in users table with same name, validates_uniqueness_of written in User class has no effect on it. validates_uniqueness_of automatically [...]


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>Consider a case of STI where:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
class User < ActiveRecord::Base
  validates_uniqueness_of :name
end

class Customer < User

end

class Manager < User

end
</textarea>
<p>Now try following at console:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
User.create(:name => "Akhil Bansal")
Manager.create(:name => "Akhil Bansal")
Customer.create(:name => "Akhil Bansal")
</textarea>
<p>This will let you create three records in users table with same name, validates_uniqueness_of written in User class has no effect on it. validates_uniqueness_of automatically scoped with class names, that means it will not let you create two managers with same name or two customers with same name  or two users with same name. </p>
<p>If you want uniqueness of an attribute in overall table, put the following code in some file in your lib dir and require that file in environment:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
module ActiveRecord
  module Validations
    module ClassMethods
      # Intended for use with STI tables, helps ignore the type field
      def validates_overall_uniqueness_of(*attr_names)
        configuration = { :message => "has already been taken" }
        configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)
        validates_each(attr_names, configuration) do |record, attr_name, value|
          records = self.find(:all, :conditions=> ["#{attr_name} = ?", value])
          record.errors.add(attr_name, configuration[:message]) if records.size > 0 and records[0].id != record.id
        end
      end
    end
  end
end
</textarea>
<p>And then use validates_overall_uniqueness_of instead of validates_uniqueness_of.
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/10/26/single-table-inheritance-validates_uniqueness_of-problem/feed/</wfw:commentRss>
		<slash:comments>0</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>
		<item>
		<title>Acts_as_solr: Starting solr server on windows</title>
		<link>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/</link>
		<comments>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 08:54:40 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[acts_as_solr]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails plugins]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/09/13/acts_as_solr-starting-solr-server-on-windows/</guid>
		<description><![CDATA[I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued 
 
rake solr:start

to start the solr server, it threw a heart breaking &#8220;Bad file descriptor&#8221; error, [...]


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>I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued </p>
<textarea name="code" class="ruby" cols="50" rows="10"> 
rake solr:start
</textarea>
<p>to start the solr server, it threw a heart breaking &#8220;Bad file descriptor&#8221; error, although acts_as_solr was working fine on one of my colleague&#8217;s linux machine. </p>
<p>I started digging around this and found that there is an issue in rake task that starts the solr server. Actually the problem was this rake task uses &#8216;fork&#8217; which is not available on windows, also it only handles &#8216;ECONNREFUSED&#8217; exception which is actually &#8220;Connection Refused&#8221; error raised by ruby on linux. But in windown it throws &#8216;EBADF&#8217; which is &#8220;Bad file descriptor&#8221; error raised by ruby on windows. </p>
<p>So below is the hack for that:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
  desc 'Starts Solr. on windows . Options accepted: RAILS_ENV=your_env, PORT=XX. Defaults to development if none.'
  task :start_win do
    begin
      n = Net::HTTP.new('localhost', SOLR_PORT)
      n.request_head('/').value 

    rescue Net::HTTPServerException #responding
      puts "Port #{SOLR_PORT} in use" and return

    rescue Errno::EBADF #not responding
      Dir.chdir(SOLR_PATH) do
          exec "java -Dsolr.data.dir=solr/data/#{ENV['RAILS_ENV']} -Djetty.port=#{SOLR_PORT} -jar start.jar"
        sleep(5)
        puts "#{ENV['RAILS_ENV']} Solr started sucessfuly on #{SOLR_PORT}, pid: #{pid}."
      end
    end
  end
</textarea>
<p>Just add this to vendor/plugins/acts_as_solr/lib/taks/solr.rake, and start solr server on windows by issuing </p>
<textarea name="code" class="ruby" cols="50" rows="10">
rake solr:start_win
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customizing CruiseControl build for RSpec</title>
		<link>http://vinsol.com/blog/2007/08/30/customizing-cruisecontrol-build-for-rspec/</link>
		<comments>http://vinsol.com/blog/2007/08/30/customizing-cruisecontrol-build-for-rspec/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 09:52:35 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[CruiseControl]]></category>
		<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/08/30/customizing-cruisecontrol-build-for-rspec/</guid>
		<description><![CDATA[Yesterday I posted about CruiseControl for Rails projects. It was working fine with all my rails projects using traditional test cases, But today I faced a problem with a project using RSpec. Actually, By default CruiseControl follows the following step to build:

rake db:test:purge
rake db:migrate
rake test

This default was not working with my last project As I [...]


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 posted about CruiseControl for Rails projects. It was working fine with all my rails projects using traditional test cases, But today I faced a problem with a project using RSpec. Actually, By default CruiseControl follows the following step to build:</p>
<ol>
<li>rake db:test:purge</li>
<li>rake db:migrate</li>
<li>rake test</li>
</ol>
<p>This default was not working with my last project As I was using RSpec for my project. I found that we can overwrite default way of building by creating a rake task named <strong>cruise</strong> in our project. Means by building CruiseControl will run your custom rake task only, so you have to take care of all other things i.e. migrate etc.</p>
<p>Hence I created following rake task in RAILS_ROOT/lib/tasks/custom_cc.rake</p>
<textarea name="code" class="ruby" cols="50" rows="10">
desc 'Custom curise task for RSpec'
task :cruise do
      ENV['RAILS_ENV'] = 'test'

      if File.exists?(Dir.pwd + "/config/database.yml")
        if Dir[Dir.pwd + "/db/migrate/*.rb"].empty?
          raise "No migration scripts found in db/migrate/ but database.yml exists, " +
                "CruiseControl won't be able to build the latest test database. Build aborted."
        end

        # perform standard Rails database cleanup/preparation tasks if they are defined in project
        # this is necessary because there is no up-to-date development database on a continuous integration box
        if Rake.application.lookup('db:test:purge')
          CruiseControl::invoke_rake_task 'db:test:purge'
        end

        if Rake.application.lookup('db:migrate')
          CruiseControl::reconnect
          CruiseControl::invoke_rake_task 'db:migrate'
        end
      end

      CruiseControl::invoke_rake_task 'spec:all'
end
</textarea>
<p>and it worked for my rails project using RSpec.
</p>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/08/30/customizing-cruisecontrol-build-for-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CruiseControl.rb: A Continuous integration tool for your rails projects.</title>
		<link>http://vinsol.com/blog/2007/08/29/cruisecontrolrb-a-continuous-integration-tool-for-your-rails-projects/</link>
		<comments>http://vinsol.com/blog/2007/08/29/cruisecontrolrb-a-continuous-integration-tool-for-your-rails-projects/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 09:38:25 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[CruiseControl]]></category>
		<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/08/29/cruisecontrolrb-a-continuous-integration-tool-for-your-rails-projects/</guid>
		<description><![CDATA[We at vinsol recently started using CruiseControl for our rails project. CruiseControl is a continuous integration tool. Which keeps an eye on you code repository and runs  all test cases (or the command you specify) whenever new version of code is found, it also sends a mail to all members specified when testcases fails [...]


Related posts:<ol><li><a href='http://vinsol.com/blog/2010/03/29/jquery-full-calendar-with-rails/' rel='bookmark' title='Permanent Link: Jquery Full Calendar with Ruby on Rails'>Jquery Full Calendar with Ruby on Rails</a> <small>Contrary to popular belief, working on a client project gives...</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>We at <a href="http://vinsol.com" >vinsol</a> recently started using <a href="http://cruisecontrolrb.thoughtworks.com/"  >CruiseControl</a> for our rails project. CruiseControl is a continuous integration tool. Which keeps an eye on you code repository and runs  all test cases (or the command you specify) whenever new version of code is found, it also sends a mail to all members specified when testcases fails with details. I found this tool very helpful and customizable. If you don&#8217;t use <a href="http://cruisecontrolrb.thoughtworks.com/"  >CruiseControl</a> , I suggest you to give it a try.</p>


<p>Related posts:<ol><li><a href='http://vinsol.com/blog/2010/03/29/jquery-full-calendar-with-rails/' rel='bookmark' title='Permanent Link: Jquery Full Calendar with Ruby on Rails'>Jquery Full Calendar with Ruby on Rails</a> <small>Contrary to popular belief, working on a client project gives...</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/08/29/cruisecontrolrb-a-continuous-integration-tool-for-your-rails-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get svn commit notification right into your inbox by using svn hook post-commit</title>
		<link>http://vinsol.com/blog/2007/07/11/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/</link>
		<comments>http://vinsol.com/blog/2007/07/11/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 19:42:21 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/07/12/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/</guid>
		<description><![CDATA[If you wish you can get notification right into your inbox when a team member commits the code. This mail will contain list of files added/deleted along with the svn diff of files that are modified. This needs some extra efforts to setup, but once it is setup it is very helpful.
This can be done [...]


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>If you wish you can get notification right into your inbox when a team member commits the code. This mail will contain list of files added/deleted along with the svn diff of files that are modified. This needs some extra efforts to setup, but once it is setup it is very helpful.</p>
<p>This can be done by using svn hooks. Yes, svn has inbuilt hook functionality like pre-commit, post-commit, post-lock, post-unlock, pre-lock, pre-unlock, start-commit. We&#8217;ll use post-commit hook to get notifications. </p>
<p>First of all get a perl script from here <a href="http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in"><strong>http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in</strong></a> and copy it to hooks directory inside your repository directory, lets say /var/www/repos/repository_name/hooks.<br />
Make sure to rename it as commit-email.pl, ofcourse you need perl installed on your server. Now cd to hooks directory inside you repository directory. <strong>Rename post-commit.tmpl to post-commit, and chmod 755 to post-commit and commit-email.pl</strong> . Now open post-commit in you favorite editor, and put &#8220;<strong>/usr/bin/perl /var/www/repos/commit-email.pl &#8211;from svn-notify@example.com  -s &#8216;SVN commit notification&#8217;  &#8216;$REPOS&#8217; &#8216;$REV&#8217; user_whom_to_notify@example.com, another_user_to_notify@example.com</strong>&#8221; at the bottom of that file. Now open commit-email.pl and make changes in configuration section according to your requirement and server, specially svnlook path. </p>
<p>Congrats!, You are done ;-) . </p>
<p>Now your server will send email notification to user_whom_to_notify@example.com, another_user_to_notify@example.com whenever someone commits.</p>
<p><em><strong><br />
**For security reasons, the Subversion repository executes hook scripts with an empty environment that is, no environment variables are set at all, not even $PATH or %PATH%. Because of this, a lot of administrators are baffled when their hook script runs fine by hand,but doesn&#8217;t work when run by Subversion. Be sure to explicitly set environment variables in your hook and/or use absolute paths to programs.</strong></em></p>
<p>It worked for me, Please let me know if it works for you too.</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/2007/07/11/get-svn-commit-notification-right-into-your-inbox-by-using-svn-hook-post-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
