Hosting Test Site Domain:
RUBY1 - Ruby on Rails Petstore


Ruby on Rails is a web application framework, released in 2004, that aims to increase the speed and ease with which database-driven web sites can be created and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby On Rails is an open source project written in the Ruby programming language and applications using the Rails framework are developed using the Model-View-Controller design pattern.

Rails Petstore is an implementation of Clinton Begin's JPetstore that has been developed with the Rails web framework. The aim of this project is to develop a reference application that demonstrates the capabilities of the framework and the best practices that should be followed when developing an application.

This particular application can also, in addition to testing Ruby on Rails functionality, serve as a test to confirm whether FastCGI is installed and working on the server. FastCGI is an extension to CGI (Ruby on Rails is essentially a collection of CGI scripts) that provides high performance without the limitations of server specific APIs. When testing with this application, the difference between using CGI vs. FastCGI is very noticable.

This test requires that both /ruby/public/dispatch.cgi and /ruby/public/dispatch.fcgi are executable (CHMOD 755)

Whether the Petstore uses CGI (dispatch.cgi) or FastCGI (dispatch.fcgi) depends on which RewriteRule is included in the .htaccess file found in the /ruby/public/ directory.

The following is a part of what appears in the .htaccess file:

RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

We are only concerned with the last two lines:

# RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

The pound sign (#) placed in front of the line serves to comment the line out so it is ignored, so in this case the line with dispatch.fcgi is 'active' so the Petstore application will use FastCGI. Regardless of whether you use CGI or FastCGI, the first page of the store takes a significant time to load. The difference is that with FastCGI the ensuing clicks throughout the store work quickly whereas with CGI each click takes some time.

Complete this test by accessing the store and clicking through a few of the products using 'dispatch.fcgi' and then modifying the .htaccess file (by commenting out the RewriteRule line with dispatch.fcgi, and uncommenting the with dispatch.cgi) to use 'dispatch.cgi' and confirm the store still works, though more slowly.

Note: The CGI Admin Panel can be helpful in confirming the correct process (dispatch.cgi vs dispatch.fcgi) is running.

Note: The app is configured to use an existing DB. If you get any database errors it may be necessary to setup/use/configure a new database.