Master ruby with us

Archive for March, 2007

Deploying Rails application with Apache on Windows XP

Posted by firstruby on March 21, 2007

We can run rails application with default WEBrick server, lighttpd, mongrel, apache.

Here we ll go for deploying rails with apache.

1. Install Ruby and Rails.

2. Install Apache HTTP Server.

3. Get FastCGI2.4.2

4. Download RubyForApache

5. Install MySQL

6. Rename mod_fastcgi-2.4.2-AP20.dll to mod_fastcgi.dll and copy it to the Apache modules folder (default is c:\programs files\Apache Group\Apache2\modules).

7. Install Ruby For Apache for all options. It will give error, but just ignore and continue.

8. Copy and fromĀ  /RubyForApache/lib/ruby/site_ruby/1.8/i386-msvcrt to Apache modules folder (default is c:\programs files\Apache Group\Apache2\modules).

Apache Configuraration,

Edit the Apache httpd.conf Configuration File,

Check for

#LoadModule rewrite_module modules/

and change it to

LoadModule rewrite_module modules/

Then add following line,

LoadModule fastcgi_module modules/mod_fastcgi.dll

Now at the bottom of this file, add following,

<VirtualHost *:4000>
ServerName rails
DocumentRoot “C:/testing/public”
<Directory “C:/testing/public/”>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi

(set paths according to your application)

Configure your Rails application,

1. Go to the public folder in your Rails application and open .htaccess

2. Look for line likeĀ  RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

Change it to RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

3. Now restart your Apache.

4. Access http://localhost:4000

It will show Welcome page (index.html) of Rails.

Posted in Useful Links | 8 Comments »

Protected: Configuration of Apache and Subversion (SVN) for Ruby On Rails application

Posted by firstruby on March 8, 2007

This content is password protected. To view it please enter your password below:

Posted in Useful Links | Enter your password to view comments.