This blog post is long due. Once again its a quick tip which can save lot of developers time in setting up rails with phusion passenger when they run into permission denied error.
After installing Passenger Phusion on a existing Apache HTTP web server when I started the Apache server and try to launch the app in browser I was getting following error.
[client ::1] (13)Permission denied: access to /favicon.ico denied, referer: http://localhost/
[client ::1] (13)Permission denied: access to / denied
After fixing obvious issues around permission like below, still no luck.
chmod on rails directory , so that Apache/Phusion would have all the permission to access the rails directory
Adjusting VirtualHost directory permission in Apache config (httpd.conf) file to allow all which would look something like this
<VirtualHost *:80>
ServerName localhost
DocumentRoot <rails app directory>
<Directory <rails app directory> >
Allow from all
</Directory>
RailsEnv development
RailsDefaultUser root
</VirtualHost>
As I was going thru httpd.conf in detail, I noticed that Apache kicking off the process under user ”Daemon” every time I started the web server. This surely sounded like a issue to me and can lead to permission problems. So it was just a matter of changing this user to the my default user and bounce the server. This finally fixed it.
Look for following in your httpd.conf
User daemon
change this to
User <default machine user>
Here is one reference which talks about solution similar to what I explained above.
Following are some references for installing phusion passenger
IronRuby on rails: only the sql driver was needed to get the stack running… Otherwise everything is the same, and works as expected at 05/30/2008 05:58 PM
Multicore FUD talk: first impression, stop reading from your notes… Room drifting asleep. #railsconf at 05/30/2008 05:50 PM
Back to pen and paper @ railsconf. Wewt. at 05/30/2008 05:45 PM
@timbray more twitter coverage of #railsconf here.. Courtesy of dead laptop. at 05/30/2008 06:31 PM
Multicore talk: plugged Switchpipe by @peterc - mix and match cluster management at 05/30/2008 06:29 PM
Engineyard: ebb is not production ready; don’t worry about the app server, should be the least of your worries. at 05/30/2008 07:15 PM
I found this while solving my own problem. ( That is always a best way to learn).
Requirement: Extract text from HTML body which includes ignoring large white spaces between tags and words.
Solution : Use Hpricot to do the magic
Assumption : Only HTML body is used here
One liner : Hpricot(html).inner_text.gsub("\r"," ").gsub("\n"," ").split(" ").join(" ")
Above line gets the inner text (which is a very convenient method to get the actual meat out of HTML)
Replaces line returns into spaces.
Do a split/join which eliminates multiple spaces between tags and words. This trims it down to single space
Now if want scan thru the whole HTML right from <html> tags, then you will have to strip out script, link, meta, style tags as well. to do that just do following
Phusion Passenger — a.k.a. mod_rails — makes deployment of applications built on the revolutionary Ruby on Rails web framework a breeze. It follows the usual Ruby on Rails conventions, such as “Don’t-Repeat-Yourself”.
If this really picks up, expect to toss couple of key problems with rails based apps
Rails can potentially be as fast as PHP or Python : Everyone’s complain about Rails being slow (I agree up to some extent) , just because rails needs to go thru additional application server layer . Passenger should come bundled with mod_rails (as any other apache modules) and Apache itself (which may not be needed by too many people). So all you looking at Webserver -> mod_rails -> Rails execution framework, as lean as anything you can imagine
Deployment will be breeze as above site says.
Also comments from two of the best authorities on Ruby & Rails
- Matz (Yukihiro Matsumoto) said “It is often said that Rails is weak on deployment; PHP runs fairly fast just by uploading scripts.Rails is slow on development mode, and requires restarting on production mode (and bit complex to configure). modrails might be the answer for it.”.
Look at this page http://github.com/news and it will give you what it really means. Kinda like facebook's public feed for programmers commit/going crazy activities. I like that.
Quick read article on wired.com about the new age internet trend of "get it fast out there" .
One example mentioned in the article was Zazzle, how they get Disney's brand out there in public so fast, that traditional retailer can not even think about unless traditional folks spin their chain to have good online presence. Some of the interesting numbers in the article Ian mount talks about
Disney has uploaded more than 3,500 of its designs to Zazzle, allowing the company to sell a wider range of products than just the blockbuster Mickey Mouse T-shirts favored by conventional retailers. The service also gives the Disney machine unprecedented agility. "Here, I can see that Hannah Montana is taking off, we can upload a design right into Zazzle's system, and in a day or two it's a product," says Patrick Haley, senior manager of customization for DisneyShopping.com.
On the side note, now I see the term "instapreneur" catching up and will be another one to toss around in your discussion with friends about modern trends and buzzwords.