Install apache web server and passenger on Ubuntu 11.04(Natty)

I just Installed apache and passenger on Ubuntu 11.04 to run and deploy my ruby on rails applications Passenger is a gem and can work with apache as well as nginx…

The reason for choosing apache is that its an industry standard.

Also one thing I did with apache was created virtual hosts and ran my apps on local machine with domains like

In this post I will list the steps I followed in order to setup apache web server and passenger.

Here is my stack:

  •  Ubuntu 11.04
  •  ruby 1.9.2 via rvm
  •  rubygems 1.8.10

I will be using rails 3.1.10(lastest this morning).!!

So lets start !!

  • Install rvm

To install rvm just type the following in the terminal(ctrl+alt+t)

 user$ bash < <(curl -s )

You can find more information about rvm on Here

  • Install ruby via rvm

Once rvm is installed you can install the latest or desired version of ruby by typing the following in terminal

rvm install 1.9.2

This will install ruby 1.9.2 on your system.

More information on how to make it your default ruby is available on here

  • Install rails.

just need to do

gem install rails

  • Install passenger

just do

gem install passenger

  • Install apache web server.

To install apache web server type:

sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
  • Install passenger apache module.

Once this is done, we must install passenger , an apache module thats hepls us to rub rails apps on apache.

sudo passenger-install-apache2-module
  • Configure.

Finally everything is done.

When you run the passenger apache module, there would be some instructions that installer will give you.

The last thing it will tell is to paste some text in apache configuration file

The configuration file is located at /etc/apache2/apache2.conf

Now once this is done, we are ready to deploy.

This has a lot of information about deploying.

In my next post, I will show how to start rails apps on local machine with apache.

Hope it helps.!

A candid interview with Society !!

It feels so great !!! Amitabh bachchan in Hindi movies or clint eastwood in the 70s and 80s revolting against a society !!!

Wow, I hope I can be such a hero too ! Speak dialogues in front of an idol like vijay or fire a gun like eastwood does !!

Was it only the greatness of Salim-Javed and sergio leone( not related to sunny leone i presume!!) or we need such rebellions ??

I think like our economy , our society and our value system is at an all time low !!! We are  in midst of a moral recession.

Look in the mirror ! What are we doing ? Where are we headed ? Whats our objective ? whats with us ?? This is what I felt.

So, I decided to take an interview of the society on four basic factions of life. Childhood, youth, parents and old age. Here are the views of society on these factions in a summary:

We first talk about childhood. O ! childhood is an age of innocence. It is that period of life when everything is so beautiful. What are your views ?

O yes, child hood is a great phase of life. Probably the greatest. Now, what I do with childhood is very simple. For me , childhood is not a phase, to enjoy, childhood is a phase where I can impart value system in that small brain , or thats what people call that first floor of humans. I impart the knowledge like we believe in only a particular god. The choice of god varies depending on my wish. If I am Christian, I say, jesus is the true god and others are not. If I am a hindu, I say Shiv or Krishna is a true god nothing else. If I am islamic, I say Allah is path to salvation and nothing else. So I impart this invaluable knowledge to them. See, I am doing this for them . I am training them to fight for rest of their lives. If this is not taught, how will they fight ? What will they do ? Then I also somehow manage to convince them that the scriptures are very very true. They are very literal and you have to believe in miracles. That actually easy as they do not much about science at that time and to tell you a secret, I also tell them that of they ever ask me a question, they will be punished !! Isnt it cool ?  Then, I send them to school ! There I give information and tell them that this is knowledge. Those poor little beings believe it !! They actually think school and college is a place where they get knowledge. This is a greatest failure of knowledge isnt it ?? (hehe). Then when they say they have gained knowledge , I ask, how do I know. Prove it by getting good grades in the exams. Memory is the path way of knowledge for them and this I think is a very innovative idea by me. This is imparted in the human brain and is executed through out. Humans, stupid humans actually believe that intelligence is knowing things. In IO test, they ask some questions regarding who was who and who did what and when etc ! And they test their intelligence !!! (Hahahahahahha). Anyways, then is gradually expose them to outside world. I show them movies, give them books etc. I show them shows like “mahabharat” or “jesus story” and tell them television is true. But this has a side effect, when they see things like “original sin”, “ma mere” or “munni badnam” and “sheila jawan”, I scold them. I say thats not what you should learn. Though I allow the makers to make it and elders to watch it, but not for children.Some say what is does is confuses a childs mind, but I say, no, the only rule is follow my rules without question !! Thus, in childhood, I impart qualities like competition, rivalry, winning spirit and also gifts. I give gifts when you are successful and punish when you fail !!!

Then comes youth. Another good phase. Human at his/her prime in the life. Full of energy and enthusiam ! What about it.?

Well, yes, youth is a good stage. Its a good platform to teach advanced things now. Now, in this stage, I introduce them to money. I give them money but  not the permission to spend it. So, they are confused. Then I tell them whats good and whats bad without reasoning ! I say, drugs are bad. Not why are they bad. Ofcourse, as god has made humans curious , they wanna know why are drugs bad and hence consume it. Thats it, as soon as they consume it, I proclaim them as sinners. I punish them and I isolate them. The result, they take more drugs. And computer scientists thought recursion is their invention !!! Then for someone who has escaped this devious and brilliant plot, I surely trap them in marriage. See, I am a humanitarian, I allow you to love. But, as usual, the catch is you cant marry the person you love. There are things like cast and creed that I have to take care of. And then, I fill the human mind with the root cause of all troubles. “Expectations”. I teach them to expect from the person they wanna marry.I teach them:

We are the invincible ones. We are the most popular ones.Each and everyone needs us you see.But ofcourse, we are also humans and we have our requirements. We look into some basic qualities in our partner. Common, they are not very difficult. We are good people you see. All we expect is that the partner should be good looking. Have a good figure/physique. They should have style you see. We need it as when we introduce them to our friends, our style and status should be maintained. He/she should know how to behave in a 5 star hotel and  should know how to speak in english full of accent, How to drink wine and how to hold hands and dance in a party. He/she should like my friends and appreciate my habits. Even If I smoke, He/she should not. Even If I flirt with someone else, he/she should be faithful. Even if I do not give a damn about my parents, he/she should. Even If I courier her/him a gift, he she should be happy ! Thats all we ask for. Nothing more. And ya, ofcourse, they should not be married before. You see we need “fresh” people. And ofcourse, I many cultures, marrying a divorcee or widow is a crime. And kinda Post script: Their fathers must be rich. They should be able to fulfill our dreams ! I dream of buying a car and since I am a divine being, he should full-fill it as a duty !! Thats all, see how nice we are !!

See, isnt it good ?? Isnt it correct ?? I know I am a master, I can make it from your expression kid !!!

Then comes parenthood. gift of god! A birth of human life. How do you deal with that.

I start by seeing them cry. They cry when in the hospital, they hear the crying of the baby. But, for me , its an important phase. I start early. I say, if the baby is a girl, then you ought to cry you idiot ! How can you do this. Girls , I somehow manage to convince the people , are not creation of god. The idiots believe me.  They know their mother is a girl still in many times and cultures I have convinced man to kill girl !! I love it.  But I do not stop there.  Then there is a simple course for parents. Thats actually a result of what I thought in childhood. Rivalry, competition etc. Now the concepts are applied to children. The average guy is always told “learn from your brother/sister”. Isnt it ?? Now, I dont see anything wrong in it ! Ofcourse, studies and grades are everything ! People not good at studies or those who do not get good grades should understand that they have a responsibilities toward their parents ! What will their parents say to the relatives and neighbours ?? What do they talk if you do not top or you do not win a trophy on your sports day ??  ow will they say ” see this is my sons certificate” with a proud laugh on their face and a hidden feeling a achievement as the relatives son stood second !! Guys , we have to understand that world war 3 is all parallel ! Each house and family has its own version of world war 3 !!! Common, you cant be average !!   But what do we actually learn in school, college ? Its just information anyways. Knowledge is long lost when we used memory to test intelligence. How great of me that we expect our students to understand information !! One may ask how do you understand that a flight AI-103 is going from Bombay to London !! Isnt it same as teacher after teaching a chapter on Gandhi asks “Understood ” ???? Today I care more about translation of gita rather than understanding it !!

Then comes old age ! Probably the most difficult phase of life.

All traditions and religions in the world say we should respect our elders ! So I do. We make better old age homes ! I give them better facilities. I give them a garden to have an evening walk with those artistic looking sticks I gave them as birthday present and those arthritis inflicted legs which nature gave them. I give them library. Books to read with those armani glasses I  gave them and those eyes that cant see clearly which nature gave them. I give them cozy beds and heaters or Air conditioner so they can sleep properly forgetting that only closing eyes is not sleeping. I give them smart phones to stay in touch ! So they can contact us when in need ! Knowing that those shaking hands cannot dial or remember the number !! We give them good medical facilities so they do not feel any pain. I give them medicines  as their blood pressure increases when going to a doctor. They say, they need their children. Are they mad ? They are  busy ,they have a meeting to attend otherwise their company would go bankrupt. they have their car to be serviced,  they have wine to be purchased, they have extra language classes to attend, they have gym to go , they have to go to the temple or church for worship ! They are  so so busy! common, tell oldies to handle themselves. And then they say, all we need is your smile and I say, na I cant, I have to mourn for a train accident victim you see !. All they ask is can you spend one hour on a sunday and I say no,I have to go for mass and feed the homeless !! The old people must understand, I dont have time for their stupid emotions. I will talk to you only if the talking helps my bank balance in any way ! I do this much for them , be content with what you get. You get free money. What else do you need ??

Mr. Society, Arent you afraid of god ?

God ? Hahaha, tell me whats god? How did you came to know about the concept of god ? Its through me child. I created god. And god, where is he ? Can he do anything ? I am the one who stays with you everyday, every minute !! I am the one with you, always. I have been with you for ages and I will be with you forever. I am a parasite which eats you, which consumes you and you do not have a medicine for me. You cannot harm me. You cant live without me you see. After all, you are a social animal !!!

The Mayans said that world will end in 2012. While factually incorrect, I suppose they understood the parasite I am talking about.

A cancer, my interviewer friend kills you. I on the other hand give you life. Its true that I have now grown so so strong that living with a parasite like me is more difficult than getting killed by a cancer !!

Compiling a LaTeX Document.

So having prepared your first tex document I was pretty excited to see the out put. But there was one daunting question !!
Whats the next step ??

Fortunately , I was using KILE so I got my PDF in a click but I wanted to figure out how get the same pdf using command line.
So here is the procedure to do the same:



Suppose the file ``my_report.tex” is the file that contains all the author’s work, i.e., her actual typed words and formulae. It was typed using the text editor vi. Similar text editors include emacs, pico, Notepad (in Windows), and TextEdit (on Macs).

First navigate to the place where the tex file is located using terminal.

Then run the command:

latex my_report.tex

This produces a bunch of files. One of them would be my_report.dvi.
The dvi stands for “device independent”.

The file my_report.dvi is the same regardless of

(1) which computer is used to compile the document,

(2) what kind of printer it is headed for.

In fact, it is too universal to be printed in this form; it must still be translated to a form suitable for a specific kind of printer. (Different printers speak different languages…) You can’t even view the DVI file unless you use a special “DVI Viewer”, such as xdvi on ucsub.


The files“my_report.aux” and  “my_reoprt.log” are two by-products of the compiling command.
The aux file is used if the document contains more complicated stuff, like bibliography and cross-references.

The log file contains a full record of the compilation, including errors you need to correct, e.g., misspelled macros, missing bracket or parenthesis, missing references, etc.



The file “”, a PostScript file, the kind understood by most laser printers.
A printable PostScript file is created from the dvi file by the translating program dvips. On computer run the command

dvips my_report.dvi



The file ``my_report.pdf” is the PDF form of the document.
This is as web-friendly a document as possible. Using Acrobat Reader, any computer can be used to view the document and/or print it. On computer run the command the command

dvipdfm my_report.dvi

translated the DVI file to PDF form.


Thats it !!


Hope it helps. !!

Special Characters and Symbols in LaTeX

Following is the way to use special characters and symbols while creating a document using LaTeX:



Symbol/Character Way to get it in LaTeX
Quotation Marks two ` (grave accent) for opening quotation marks.
two ‘ (vertical quote) for closing quotation marks.

Dashes and Hyphens L TEX knows four kinds of dashes. Access three of them with different number
of consecutive dashes. The fourth sign is actually not a dash at all—it is the
mathematical minus sign.
The names for these dashes are: ‘-’ hyphen, ‘–’ en-dash, ‘—’ em-dash
and ‘−’ minus sign.

Examples of each are shown below:

  • daughter-in-law —-> daughter-in-law
  • pages 13–67 —-> pages 13–67
  • yes—or no? —-> yes—or no?
  • $0$, $1$ and $-1$ —-> 0, 1 and −1
Tilde (∼) $\sim$demo
Slash (/) \slash
Degree Symbol (◦)

The textcomp package makes the degree symbol also available as \textdegree
or in combination with the C by using the \textcelsius.

The Euro Currency Symbol


NOTE: its available in textcomp package

Ellipsis (. . . )

On a typewriter, a comma or a period takes the same amount of space as
any other letter. In book printing, these characters occupy only a little space
and are set very close to the preceding letter. Therefore, entering ‘ellipsis’
by just typing three dots would produce the wrong result. Instead, there is
a special command for these dots. It is called



Some letter combinations are typeset not just by setting the different letters
one after the other, but by actually using special symbols.

These so-called ligatures can be prohibited by inserting an \mbox{} between
the two letters in question. This might be necessary with words built from
two words.

1 \Large Not shelfful\\
2 but shelf\mbox{}ful

1.Not shelfful
2. but shelfful

Basic LaTex document classes

Document Class Name Usage/meaning
 article for articles in scientific journals, presentations, short reports, pro-
gram documentation, invitations, . . .
 proc  a class for proceedings based on the article class.
 minimal is as small as it can get. It only sets a page size and a base font. It
is mainly used for debugging purposes.
 report  for longer reports containing several chapters, small books, PhD
theses, . . .
 book  for real books
 slides   for slides. The class uses big sans serif letters. You might want to
consider using the Beamer class instead.

Advantages and Disadvantages of LaTex

The main advantages of LaTeX over normal word processors are the following:

  •   Professionally crafted layouts are available, which make a document really look as if “printed.”
  •   The typesetting of mathematical formulae is supported in a convenient way.
  •   Users only need to learn a few easy-to-understand commands that specify the logical structure of a document. They almost never need to tinker with the actual layout of the document.
  •   Even complex structures such as footnotes, references, table of contents, and bibliographies can be generated easily.
  •   Free add-on packages exist for many typographical tasks not directly supported by basic L TEX. For example, packages are available to include PostScript graphics or to typeset bibliographies conforming to exact standards.
  •   LaTeX encourages authors to write well-structured texts, because this is how L TEX works—by specifying structure.TEX, the formatting engine of LaTeX 2ε , is highly portable and free. Therefore the system runs on almost any hardware platform available.

The main dis-advantages of LaTeX over normal word processors are the following:

  • LaTeX does not work well for people who have sold their souls . . .
  •  Although some parameters can be adjusted within a predefined document layout, the design of a whole new layout is difficult and takes a
  • lot of time.
  •  It is very hard to write unstructured and disorganized documents.
  •  Your hamster might, despite some encouraging first steps, never be able to fully grasp the concept of Logical Markup.


Just installed a new precise pangolin and thought of giving rbenv a try….

So collected this with a bit of googling….

rbenv is a new lightweight Ruby version management tool built by Sam Stephenson(of 37signals and Prototype.js fame).

The established leader in the Ruby version management scene is RVM but rbenv is an interesting alternative if you want or need something significantly lighter with fewer features. Think of it as a bit like Sinatra and Rails. It’s not about which is the best, it’s about which is better for you and your current requirements.

What’s  rbenv?

Compared to RVM, rbenv is light. For example, it doesn’t include any mechanism to install Ruby implementations like RVM does. Its sole job is to manage multiple Ruby “environments” and it allows you to quickly switch between Ruby implementations either on a local directory or default ‘system-wide’ basis.

With rbenv, you install Ruby implementations manually or, if you prefer a little help, you can try ruby-build, another project of Sam’s that provides RVM esque recipes for installing seven popular Ruby implementation and version combos.

rbenv primarily works by creating ‘shim’ files in ~/.rbenv/shims which call up the correct version of files for each Ruby implementation behind the scenes. This means ~/.rbenv/shims will be in your path and there’s no threat of incompatibilities between libraries or systems like Bundler and rbenv.

The key thing to be aware of, however, is that if you install a gem that includes ‘binaries’ (or any generally available command line scripts), you need to run rbenv rehash so that rbenv can create the necessary shim files.


Firstly, it’s worth noting that by default rbenv is incompatible with RVM because RVM overrides the gem command with a function. This means to get the full rbenv experience you’ll need to do a rvm implode to wipe away your RVM installation or, at the least, remove/comment out the RVM loader line in your .bash_profile and/or .bashrc.

The installation instructions for rbenv are likely to change fast due to its youth, so I suggest the README. However, rbenv has just been made into a homebrew package on OS X, so if you’re a homebrew user (and if you’re not, check out my screencast), try:

brew update brew install rbenv rbenv rehash

And then add this line to your ~/.bash_profile or equivalent:

eval "$(rbenv init -)"

When you open a new shell now, you can run commands like rbenv and rbenv version to see what’s going on. rbenv versions should return nothing since you won’t have any rbenv-enabled Ruby installations yet, so move on to the next step..

Installing Implementations for rbenv

If you have ruby-build installed, getting, say, Ruby 1.9.2-p290 installed is easy:

ruby-build 1.9.2-p290 $HOME/.rbenv/versions/1.9.2-p290

If you prefer to download tarballs and do your own Ruby installs, however, you just need to set the directory prefix at the ./configure stage in most cases. For example:

./configure --prefix=$HOME/.rbenv/versions/1.9.2-p290

Once you’ve installed a new Ruby in this way, you need to run rbenv rehash in order for rbenv to create the ‘shim’ binaries necessary to make the correction version of Ruby available on the path at all times.

The RVM Splashback

In the interests of completeness, it’d be amiss to not mention the minor drama that kicked off on Twitter and Hacker News about rbenv’s release.

rbenv made its way on to Hacker News where, surprisingly, many people railed against RVM. This, coupled with a slightly antagonistic tone taken by rbenv’s README (which has now been taken away), led RVM’s maintainer Wayne E Seguin to vent some pressure on Twitter:

Sam quickly clarified his position:

Nonetheless, Wayne took a little time off, and a campaign to encourage donations to Wayne for his work on RVM was kicked off on Twitter (by Ryan Bates, I believe). The campaign went well, taking RVM’s donations from $7468 to $11370 (at time of writing), a jump of almost $4000 in a few days.

Part of the complaint made in rbenv’s README was about RVM’s “obnoxious” redefinition of the “cd” shell builtin. Essentially, RVM would create a new function which called “cd” but also took into account any .rvmrc files present in each directory so that it could change Ruby version automatically. While there was some validity to this concern, Ben Atkin took some time to write a blog post correcting some of the misinformation on this point.

In the end, however, all seems to be well, and Wayne is already making regular commits to the RVM project again just days later. Hopefully the outpouring of support from the Ruby community for RVM over the past couple of days has shown Wayne that RVM still has a significant user base, most of who aren’t going anywhere new anytime soon. If you want to help out, of course, you can still donate to the RVM Pledgie.


If you’re happy with RVM, there’s not much in rbenv to really leap to. It’s just a lighter and more modular way to achieve the basic functionality that RVM provides while missing out on a lot more (although you can use rbenv-gemset to get some basic gemset-like features).

If, however, you want something “lighter” than RVM, rbenv is certainly worth a look. Its approach feels cleaner and more transparent at a certain level, and if this is of utmost importance to you, you may prefer it.

I personally switched back to rvm coz I am getting openssl error which is tricky(ofcourse mybad!) and not able to get over it…