Monday, May 29, 2006
Buttonator....
Friday, May 19, 2006
Ruby Java Bridge is here
Thursday, May 11, 2006
How Ruby can be next generation business building block
- As Martin fowler said "As a result it certainly seems to me that certain languages are more suited to in-language DSL than others. Seeing lisp and smalltalk I concluded that the more suitable languages were minimalist ones with a single basic idea that's deeper and simpler than traditional languages (function application for lisp, objects and messages for smalltalk). But Ruby is more conventional and a much bigger language than these two, yet is still suitable for in-language DSLs."
- Anothe good read on Metaprogramming idea of Ruby [pdf].
- How to create DSL using Ruby
What does Rails on Apache mean?
Assuming you have a running rails application on WEBrick (which comes with rails), its 5 mins job to have rails up and running on Apache. You will need following things.
Remember You do not need FastCGI at all to run rails on Apache. .
Every rails application created is Apache deployable ready (that sounds so good!!), you don't need anything extra, neither FastCGI or Mongrel. You will need these 2 puppies for some other reasons that I will point out soon.
# Apache HTTP server
# Rails application
2 step process
- Open Apache httpd.conf under
- Add following at the very end and restart Apache
Listen 8027
<VirtualHost 127.0.0.1:8027>
DocumentRoot [railsapppath]/public/
<Directory [railsapppath]/public/>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>
Or another better way is to (Use Apache Alias technique) add following in your httpd.conf
Alias /railsappname [railsapppath]/public
<Directory [railsapppath]/public>
Options ExecCGI FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
- Open public/.htaccess file and add "RewriteBase /railsappname "
(With above technique you will not be creating virtual host on different port and this kind of setup makes more sense when you have more than one rails component sitting on Apache)
Here
[railsapppath]/public/: is your rails application public folder. You need to point to this directory, else it won't work.
Port 8027: some random port, on which you are asking Apache to run a virtual host for your rails application.
Now just point your browser to http://127.0.0.1:8007/ and you will see the rails running on Apache. How fast was that?. Oh did I ask How fast was that?. Yes now this takes us to our next topic
# Fast CGI: Fast CGI makes ruby run faster on Apache, otherwise by itself ruby is slow on Apache, because it runs native CGI. I will talk on this in detail, in my next blog topic