« March 2008 | Main | June 2008 »

April 30, 2008

Multiple Rails applications with mod_rails on Ubuntu

It works as advertised!

The installer provides exhaustive built-in documentation, describes every step and suggests solution for every unmet requirement like “please install Apache headers with apt-get install apache2-prefork-dev”. Other guys and we all can learn a lot from mod_rails about how a perfect installer looks like.

At the end of the installation process it asks to put three configuration lines into apache configuration file although it does not tell how. According to online documentation the requirement is that these lines should be only executed once.

So my solution (in Debian way) is to

Then I followed the documentation. But I had to make an additional change to enable the FollowSymLinks.

It was also not clear from the documentation how to set up multiple applications to the same VirtualHost and that RailsBaseURI is allowed multiple times. So I had to experiment. Here is the result (works on Ubuntu 7.10):

<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerName myapps.example.com
    DocumentRoot /home/passenger
    RailsBaseURI /app1
    RailsBaseURI /app2
    <Directory /home/passenger>
      AllowOverride All
    </Directory>
</VirtualHost>

Then for every additional application you need to

I did not find any way to avoid last two tasks. Hopefully the next version of passenger will offer some sort of wildcard-based mass-RailsBaseURI.

Current mod_proxy advantages:

TODO:

Posted by VladimirDobriakov at 9:15 PM

April 16, 2008

Create the most scalable HelloWorld application in the world with Google App Engine

eggs If you have the luck to use the programming language and technology that Google uses, then you can use Google App Engine to host your web application and scale almost indefinitely.

Google App Engine is very different to Amazons’s approach.

You can start the most scalable HelloWorld application in the world with the following lines:

from google.appengine.ext import webapp
class MyHandler(webapp.RequestHandler)

There will be nothing Google specific in the web part of your application. It is WSGI-based so you can host it at Google or within your own Apache HTTPD through mod_wsgi.

The bigger concern is this special data store, for which no open source replacement exist.

So you can not use a relational database with such distributed system like App Engine, but if you use this Google Datastore then you trapped into a dependency, that can not be removed easily. And introducing an additional abstraction layer for data access is not the way to success with a dynamic programming language, fast development and being happy.

Posted by VladimirDobriakov at 7:00 PM

April 4, 2008

Appearance matters

screenshot

No, I am not talking about preparation for a date or for an interview. I am still talking about a prototype I am working on. Even if you told that there is no need for special styling and a professional web designer will prepare something two weeks later, and the application should simply work, so it is possible to play around a bit with it.

And because you love the semantical nature of the html you start with a pure html with this scientifical styling. That means no styling at all. But even if you are not a professional designer, exactly like me, you should take one or two hours to create some basic stylesheet to make the user interface pretty less ugly.

For example, if you want the main navigation to be shown in one row at the top of the screen and you have implemented the menu as unordered list <ul> then put something like

ul.main_menu li {
    display: inline; 
    background-color: orange; 
    padding: 4px;
    font-weight: bold;
}

into your CSS file.

Posted by VladimirDobriakov at 5:00 PM | Comments (0) | TrackBack

April 2, 2008

Rapid Prototyping with Rails

Zürich I am currently in Zürich and working on an extemely hot startup project there. The customer heard that with Rails you can prototype pretty fast…

I am working with two experienced Java- and J2EE- developer there, however they did not have any Ruby- or Rails- experience. So my task for this week is to create a prototype and at the same time to spread some Ruby but especially Rails knowledge among developers.

So after tree days:

It is unbelievable, how much you can achive with learning/teaching Rails provided:

Posted by VladimirDobriakov at 11:01 PM | Comments (0)