1. cd C:/InstantRails/www. This is assuming your Instant Rails is installed in C:

  2. rails -d mysql myapp. This will create a new Ruby on Rails application in C:/InstantRails/www with MySQL as the default database server.
  3. On command prompt, key in: ruby script/server –port=3003. Check that you are able to access myapp at http://localhost:3003/ in your browser.
  4. Check that Apache is running by typing http://localhost/. This will display the index file fron C:/InstantRails/www directory.

  5. cd C:/InstantRails/apache/conf.
  6. Open http.conf file. In this file search for ‘VirtualHost’. This will lead you to the bunch of virtualhost declations for typo and cookbook applications.
  7. httpd.conf with InstantRails has proxy_module already uncommented for use. LoadModule proxy_module modules/mod_proxy.s.
  8. Add myapp block to httpd.conf:

  9. In the InstantRails configuration tool, select Configure -> Windows Hosts File. Click it open and add an entry to the end: 127.0.0.1 myapp. Save the file and exit notepad.
  10. Restarting Apache server was not needed since I was running this set up for the development environment.
  11. Key in http://myapp/ in the browser to check that your app is indeed showing up the index.html page from myapp/public folder.
  12. As a further adventure, add up on myapp:
    C:\InstantRails\www\myapp>ruby script/generate scaffold Blog blog_id:integer title:string body:text
  13. Run rake db:migrate
  14. Now key in http://myapp/blogs and it should show up the ‘index’ action for blogs correctly. Browse around by clicking on ‘new blog’ and see that the page is served as http://myapp/blogs/new.
  15. Also look at Apache access logs from InstantRails application and also the mongrel server logs from the command line.
  16. If keying in http://myapp/ takes you to http://www.myapp.com/, then you need to checks Windows Hosts file using InstantRails.
  17. If keying in http://myapp/ takes you to the Index of / directory listing that just shows the files in myapp folder, then you need to make sure you have given the DocumentRoot in the virtualhost declaration in httpd.conf as C:/InstantRails/www/myapp/public/ and NOT C:/InstantRails/www/myapp/ alone.
  18. Alternatives: in httpd.conf file if you
    (a) provide ServerName as http://www.myapp.com/,
    (b) provide ProxyPass / http://localhost:3003/ instead of ProxyPass /myapp/ http://localhost:3003/, and
    (c) include the entry 127.0.0.1 http://www.myapp.com/ in Windows hosts file,
    you can access you application at http://www.myapp.com/ from your desktop. If the browser continues to show the real http://www.myapp.com/ then just restart the browser or perhaps just clear the browser cache.
  19. It is not necessary to create your application under InstantRails/www. Having an application as InstantRails/rails_apps/myapp and providing the document root in httpd.conf as C:/InstantRails/rails_apps/myapp/public works just fine.