NEWS: Cod free phentermine shipping Dacarbazine: Cheapest viagra online Crestor: Beconase Tetanus. Viagra prescription uk Sertraline Xanax detoxification Protonix Amoxapine Cyclizine: Phentermine mastercard Chlorpheniramine? Valium vs xanax Propofol Ambien eminem Phytonadione? Zoloft What do xanax look like! Protriptyline Buy generic phentermine! Watson soma Phentermine next day Viagra lowest price Thiopropazate Propofol Phentermine 37 5mg shipped to kentucky Ordering phentermine Pyridium Colchicine Aldactone Drug test tramadol hydochloride Cope? Ipratropium Bepridil Cialis in the uk Prozac and phentermine? Chlorambucil Plavix Cheap phentermine no shipping Keyword prescription qoclick tramadol without Can xanax cause frontal lobe dementia Nexium Riboflavin Cheap phentermine no rx. Cheapest phentermine 90 day order Premarin? Propylthiouracil Tramadol narcotic Discounted phentermine with no prescription Alesse! Cortisol Buy cialis in uk Xanax long term effects Colon cleanse ambien? Prazosin Viagra lowest prices Diethylstilbestrol Free shipping cheap phentermine Rated online pharmacies for phentermine Cheep paris france phentermine: Viagra discussion Tramadol medication, Phentermine prescription Strattera! Online pharmacy duromine viagra international How long does viagra last Phentermine prices Order phentermine online uk Does phentermine really work Cozaar Generic viagra overnight delivery Pantoprazole! Xanax on line Lorazepam Cheap phentermine no rx How does phentermine work: Cialis lowest price Griseofulvin? How fast will phentermine work Fda approved phentermine Oxacillin Generic sales viagra! Oxycontin xanax bars perclesept and lortab wha Cialis discount online Milrinone Butalbital fioricet, Levaquin Phentermine & health risks Phentermine hoodia Cleocin! Levitra vs cialis vs viagra Picture of xanax pill Diet hcl phentermine pill Differin Piperidolate Trovafloxacin. Prescription weight loss medication phentermine Pfizer viagra: Minocin Carbidopa Tramadol withdrawal Viagra online sales Hydrocodone info Next day delivery on phentermine. Aricept Cheapest viagra price. Prevacid Phentermine delivered overnight Adipex Snorting xanax Discount fioricet Exelon Glimepiride Acyclovir! Clarinex Phentermine 37.5 cash on delivery! Tessalon Provigil. Isoxsuprine Hydrocodone online pharmacy Concerta Pink oval pill 17 xanax identification Phentermine uk Cialis comparison levitra, Glycopyrrolate Free viagra order online! Buy phentermine on line Xanax drug test Tramadol cheap overnight inexpensive Prescription free viagra! Addiction recovery xanax Is klonopin stronger than xanax Tramadol 50mg Tolbutamide. Vicodin health Order soma online Tramadol 377 Nasonex! Viagra price compare Nitrofurantoin. Toprol Tyropanoate Buy meridia Pravachol Hyzaar Disulfiram Fda us approved phentermine Alternative herbal viagra, Buy viagra pill online Isosorbide Free sample prescription for viagra Hydrocodone apap 5 500 Triprolidine Comparison viagra cialis levivia Does phentermine help weight loss Actos: Viagra price list Compare viagra prices Cefaclor Xanax pills. Noroxin Adderall Cheap viagra in uk Amlodipine, Natural alternatives to viagra Hydrocodone for ibs: Hyzaar Information phentermine shortage Codeine How to discontinue the use of phentermine. Phentermine and urine drug screen Xanax anxiety No prescription phentermine Paroxetine. Estrone Azithromycin Lawsuits involving blindness caused by viagra Phentermine 37.5mg Dulcolax Do companies sell phentermine with low dose ingredients: Bontril phentermine adipex Fluticasone Cefuroxime Next day phentermine Cheap phentermine free consult Simethicone Delavirdine Half life of xanax Xanax vs klonopin Best price phentermine Phentermine buy best Buy discount phentermine? Cinoxacin Phentermine overnight No prior perscription tramadol Hydrocodone effects Does phentermine interact with hydrocodone Effexor Phentermine drug Herbal viagra for woman Meridia coupon Cialis levivia sales viagra, Phentermine tablet Buy xanax cod Woman take viagra Aminopterin Hydromorphone Xanax next day delivery Glucophage Per day buy phentermine, Stopping xanax Chlorhexidine Buy viagra canada Information phentermine Etoposide Buy viagra prescription online 180 tramadol Triamterene Lisinopril drug interaction viagra Cialis online sales Ticarcillin Allopurinol Cheapest tramadol online Carvedilol How to inject xanax pills Droperidol Hydrocodone vicodin Phentermine shipped to tn Reliable same or next day phentermine purchase online Natural phentermine Xanax information Buy viagra online cheap Discount phentermine no prescription Monopril. 37 effects phentermine side Fast delivery phentermine Diethylpropion Buy hydrocodone Phentermine order Cilexetil: Diazoxide Tobramycin Generic viagra in canada Donepezil Chlorhexidine Bar gold xanax Phentermine lowest price Weight loss phentermine! Buspirone Epivir. Xanax and valium Cheap phentermine no prescription? Dangers of phentermine Anxiety disorder xanax xr to wean off effexor xr Generic fioricet Overdose xanax. Viagra women Phentermine interactions Buy phentermine without prescription Phentermine use Hytrin Cialis comparison levivia viagra Cialis levitra viagra vs vs Vicodin prescription Viagra samples Xanax federal express Fosinopril Itraconazole Buy tramadol cheap Liothyronine Information phentermine Tramadol cause kidney problems Get viagra online Viagra and ischemic optic neuropathy Triamcinolone How long does xanax stay in your system, Side effects of viagra Cyclandelate Weight loss oral hcg and phentermine Buying viagra online uk, Cycrimine Cheap viagra canada Loxapine Buy cheap domain online atspace com xanax Iodamide Linkdomain buy online viagra info domain buy onlin Dichloralphenazone Thyroid. Paxil and xanax interaction How to get xanax Indomethacin Cialis impotence drug eli lilly co Phentermine side effects danger Addiction tramadol Natural over counter just like viagra stores Prozac drug interaction with xanax Generic viagra canada Cheap phentermine canada Chep phentermine Diatrizoate Tramadol ingredients Cheapest prescription viagra. Phentermine and carbs Carteolol? Buy no phentermine prescription Language phentermine ru Phentermine works Oxycontin xanax bars perclesept and lortab Dothiepin Lanoxin Does xanax show up on drug tests Xanax high Elavil Phentermine ingredients Iothalamate Methoxsalen Best generic viagra Androgel Is phentermine dangerous Exelon: Online pharmacy tramadol Add link phentermine purchase suggest Free trial viagra Viagra sample pack. Elidel Buy online viagra viagra Hydrochlorothiazide Carisoprodol Dexamethasone Actonel Troleandomycin Ordering xanax online Phentermine 37.5 tablet Ambien overnight. Lowest prices viagra Phentermine np with hoodia! Cheapest phentermine diet pills Order phentermine cod online Buy cialis in canada Digoxin Ceftizoxime Online ordering viagra Adipex phentermine vs Cheap phentermine with online consultation Online viagra Phentermine weight loss pills Phentermine reviews Enalapril! Generic viagra cialis Clarinex. Buying vicodin online Buying viagra online Chlorotrianisene Augmentin? Drug screening phentermine Fexofenadine Mycostatin Phentermine result Valium and xanax Xanax online cheap Cheap soma Cialis viagra Does viagra work for women Actos Detection drug in phentermine screen urine Herbal phentermine review Cheapest place to buy phentermine online Phentermine eprescriptions Itraconazole Hydrocodone cod only, Phentermine Viagra compared to levivia? Colistimethate Ultram Trifluoperazine Diet no phentermine pill prescription Fioricet Phentermine for weight loss! Dextrothyroxine Generic money order viagra Viagra herbal alternative Phentermine free shipping 90 supply no delay Free shipping phentermine Buy viagra without prescription Free overnight phentermine shipping Phentermine cod delivery, Famvir Phentermine guaranteed overnight shipping Cheapest place to buy phentermine Purchase tramadol online Butalbital fioricet Cialis effective soft tab treatment Order viagra buying viagra uk Lipids Phentermine florida Cialis compare levivia viagra: Viagra alternatives uk Levoxyl? Belladonna Buy viagra on line Phentermine lowest price 37.5 online Beconase Xanax picture Phentermine 37 5mg and mastercard, Phentermine 37.5mg tablet Soma cube? Female use viagra Buy discount viagra online, Cialis vs viagra Phentermine forum Viagra cialis comparison Losec: Methocarbamol Viagra herbal? Xanax overnight Xanax 1mg Free viagra online 50 hcl mg tramadol Phentermine canada Good morning viagra commercial Viagra dosages Difference between cialis and viagra Ditropan Buy viagra in canada Xanax dose Apcalis cialis. Oxybutynin Buy viagra online get prescription Good morning viagra commercial Viagra testimonials? Quinidine Soma bike? 25 mg viagra Hydrocodone order Xanax info Phentermine mastercard Generic name online qoclick tramadol Herbal viagra alternative review! Dangers of viagra Dioxyline Viagra for woman study Viagra shelf life? Order phentermine cod Celebrex Bromocriptine Cod phentermine shipped Tramadol side effects Esomeprazole Cod tramadol money orders Phentermine on sale Ipodate Xanax withdrawl symptoms Viagra cialis generic Lowest phentermine Cialis generic viagra Mesoridazine Fluphenazine Cialis compared to viagra! Hydrocodone overdose Perindopril Generic soft tab cialis Cheap hydrocodone Amiloride Midodrine. No prescription needed phentermine Mastercard phentermine Online cialis Purchase xanax online Detox hgh phentermine quit smoking xenical Mifepristone Dangers of phentermine heart Overnight shipping viagra: Locoid Injecting xanax. Tramadol narcotic Dicumarol Macrodantin Estrogen Xanax 2 mg Phentermine side effects dangers! Paris cheep phentermine No overnight prescription xanax Ritalin Reviparin Price viagra viacreme Effects of viagra On line prescription viagra Ethinyl 2 mg xanax Meridia vs. Phentermine. Viagra lowest prices Ship free viagra sample Risperdal Viagra erection Online pharmacies phentermine xenical meridia Viagra price compare Xanax grapefruit juice Nizoral. Rabeprazole Discount phentermine price Colace Klonopin versus xanax Cefadroxil On line viagra Discount phentermine online Buy viagra woman: Ordering 30mg phentermine Viagra in woman! Esmolol Alprazolam xanax Effects of viagra Is phentermine discontinued Phentermine without rx Cialis softtabs! Phentermine delivered cod Lynestrenol Natural viagra alternative Plicamycin Protirelin Biaxin. Phentermine feedback Nifedipine Buy online viagra viagra Online pharmacy prescription viagra Buying xanax Opium. Cialis compared to viagra What happens when women take viagra Purchase phentermine Phentermine pill. Sofia viagra Viagra cialis levivia Beclomethasone Celexa phentermine Diltiazem Ampicilin Diet drug fenfluramine phentermine Blindness viagra? Is xanax addictive Mixing cocaine and viagra? Moricizine Hydrocortisone? Vicodin drug test Cialis price, Ambien Purchase viagra online. Pulmonary hypertension and viagra Viagra sale online Lopressor Home made viagra Uk cheapest viagra Ambien cr dosage, Ionamin phentermine yellow Differin Ambien overdose Cheap tramadol online Griseofulvin Phentermine and carbs How long does phentermine stay in your system Viagra doseage. Metharbital Cialis dose Biperiden On line prescription viagra: Molindone Mixing viagra and cialis Adipex diet phentermine pill prescription Motrin Viagra cream Effect viagra Cheapest phentermine 90 day orders Amoxicillin Levivia and viagra Ranitidine Podofilox Diet ky phentermine pill ship that Xanax look alike Nabumetone Cialis generic Herbal phentermine does it work. Buy generic xanax Bricanyl Viagra in woman Phentermine pictures Fioricet information 100 phentermine Xanax liver damage Xanax versus prozac? Adipex ionamin phentermine Cycloserine Generic ambien Buy cheap generic viagra. Xanax prescription online Echothiophate Phentermine 37.5mg Clonidine Best price for generic viagra Buy cheap tramadol online Dicloxacillin Xanax online pharmacy no prescription Blue xanax Canada viagra! Dolasetron Prescription viagra? Medrol Dichlorphenamide Pink oval pill 17 xanax identification Buy tramadol without prescription Phentermine ups delivery Cialis com Phentermine withdrawal Ambien withdrawal Diclofenac Tolazamide, Cinnarizine Phentermine diet plan Procyclidine 37.5 phentermine! Phentermine for less Eon phentermine Miconazole Hydrocodone addiction! Cialis levitra sales viagra Purchase cialis: Carbimazole No online prescription xanax! Cheapest xanax online Cialis vs levitra Genaric viagra Aldara Phentermine np Carbamazepine, Buy phentermine cheap Phentermine and sibutramine be combined Soma seed Viagra substitutes Female spray viagra Liquid cialis: Allegra Levitra: What does xanax do Lansoprazole Lanoxin Furazolidone Diovan Phentermine phendimetrazine Prozac and xanax induced mood disorder Procyclidine. Celexa Viagrafix corporation: Cialis sales uk Lysodren Lowest price on phentermine Xanax grapefruit: Phentermine result Phentermine tablet

Local Development Environment - Part 3

After we had our WAMP local server setup done in Part 1 and Part 2, and booting it online via No-IP dynamic DNS service, it’s time now to talk about installing Ruby on Rails on our server and use Apache 2 along with FastCGI as the webserver for the first option and Mongrel for the second, we will also install few ruby libraries that are commonly used and ensure that they are working and functioning properly by installing a ready rails script.

Ruby

Ruby is a pure object oriented programming language, created by Yukihiro Matsumoto from Japan around 11 years ago, first it was only in Japanese language, and then got translated into English around 5-6 years ago, where it had an exposure success and a great support.

For Windows the simplest way to install Ruby is via RubyInstaller, the latest stable release is version 1.8.2-15 but we should get version 1.8.4-17 RC2 (this will be explained later) as we are going to prepare for Mongrel as a webserver, you can use 1.8.2 if you will use Apache-FastCGI option only, but version 1.8.4 is more recommended for both cases.

Note: If you are running any previous version of Ruby and upgrading to Ruby 1.8.4 you may face a problem with your existing Rails applications: “Invalid char `\002′ in expression” this error happens because of some wrong tabs interpreting in windows, in order to solve it simply use your preferred editor (I use Notepad++) to replace all tabs by spaces as Ben Reubenstein advised.

So after you download the executable file from RubyForge, run it and don’t forget to change the setup directory to D:/Development/ruby (the directory we’ve created to host our development programs files in Part 1).

Ruby 1.8.4-17 RC2 install location

Ruby is now installed on our system, let’s try the lovely IRB that comes with it. IRB is an interactive command-line interpreter, which allows us to simply type our code lines and see the results on the spot.

Start the command line (Start->Run->cmd), simply enter the command “irb” to start, and to exit you can type “exit”.

D:\\development>irb
irb(main):001:0> s = String.new
=> ""
irb(main):002:0> s = "Hello World!"
=> "Hello World!"
irb(main):003:0> n = 3
=> 3
irb(main):004:0> sn = s << n.to_s
=> "Hello World!3"
irb(main):005:0> exit

You can know more about Ruby (if you don’t already know) from Wikipedia Ruby Programming Language page, and now let’s move on to see some more Ruby goodness, let’s meet RubyGems.

RubyGems

RubyGems is the standard packaging system for Ruby, it simplify the distribution of Ruby third party libraries and projects by packing them in a standard format and then allowing us to install it in another simple way too (this is what we will do with Rails).

First download the Ruby Gems 0.8.11 zip file from RubyForge, unzip it, and then run the setup.rb file which will take care of the rest.

Installing Ruby Gems will add a new command “gem” that can be used from the command prompt to install, update and build gem packages. Now we will use it to install Rails and many other libraries by simply typing a single command line and let it take care of the rest.

Ruby on Rails

Ruby on Rails aka Rails aka RoR is the web framework of Ruby, created almost three years back by David Heinemeier Hansson as an extraction of his work on BaseCamp (a product of 37Signals), maintained now by a list of talented developers in the core team that came from different backgrounds to help Rails be the best friend of every web developer.

RoR framework implemented to demonstrate a better MVC architecture that follows the DRY concept, which to help us create better applications in less time and more solid way, personally I moved to Rails because it allowed me to spend more time on algorithms and real programming work instead of just worrying about the regular stuff that we do everyday like connecting to the database and the other
CRUD work.

We will install Rails and all its dependencies via RubyGems using “gem install” command, that will first search for the gem file locally, then attempt the remote installation from the robyforge gem repository:

D:\\development>gem install rails --include-dependencies
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.1.2

If you are not able to connect to the internet from the command line then you have to install Rails locally by downloading Rails 1.1.2 and its dependencies: ActionMailer 1.2.1, ActionPack 1.12.1, ActionWebservice 1.1.2, ActiveRecord 1.14.2 and ActiveSupport 1.3.1 as stand alone gems, place them in the directory were you want to run the gem command so it will be able to find them, let’s say inside D:\Development and see:

cd d:\\development
D:\\development>gem install activesupport
Attempting local installation of 'activesupport'
Successfully installed activesupport, version 1.3.1
Installing RDoc documentation for activesupport-1.3.1...

D:\\development>gem install actionpack
Attempting local installation of 'actionpack'
Successfully installed actionpack, version 1.12.1
Installing RDoc documentation for actionpack-1.12.1...

D:\\development>gem install actionmailer
Attempting local installation of 'actionmailer'
Successfully installed actionmailer, version 1.2.1
Installing RDoc documentation for actionmailer-1.2.1...

D:\\development>gem install activerecord
Attempting local installation of 'activerecord'
Successfully installed activerecord, version 1.14.2
Installing RDoc documentation for activerecord-1.14.2...

D:\\development>gem install actionwebservice
Attempting local installation of 'actionwebservice'
Successfully installed actionwebservice, version 1.1.2
Installing RDoc documentation for actionwebservice-1.1.2...

D:\\development>gem install rails
Attempting local installation of 'rails'
Successfully installed rails, version 1.1.2

It’s pretty simple isn’t it, so now we have Ruby and Rails installed on our machine, let’s give Rails a try, and see this quick thing that everybody is talking about, we will create a rails application in our webroot folder (the one we have created in Part 1 to be our web root).

cd D:\\webroot
D:\\webroot>rails testapp
      create
      create  app/controllers
      create  app/helpers
      .
      .
      .
      .
      create  log/production.log
      create  log/development.log
      create  log/test.log

With just this two words command we have got a complete web application hierarchy that we can start from to develop what we need, as this post is getting more longer that expected let’s just run WEBrick and see what will it look like.

WEBrick

WEBrick is a library that comes bundled with Ruby to build HTTP servers, it is commonly used as the development server for Rails applications, we will use it now to test the testapp we have just made:

D:\\webroot>cd testapp

D:\\webroot\\testapp>ruby script/server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2006-06-20 01:24:33] INFO  WEBrick 1.3.1
[2006-06-20 01:24:33] INFO  ruby 1.8.4 (2005-12-24) [i386-mswin32]
[2006-06-20 01:24:33] INFO  WEBrick::HTTPServer#start: pid=3668 port=3000

This will start a light webserver on port 3000, which is the default (changeable) port of WEBrick, be sure if you are running any other services that they are not using this port, how about seeing the results of two lines of work on Rails? Point your browser to http://localhost:3000 and see by yourself.

TestApp Rails Welcome Screen

Enough for now, let’s stop WEBrick (use Ctrl+C) and install some quick gems before we configure FastCGI and Mongrel.

Extra Goodness - Ruby Libraries and Typo

Below is a quick list of some useful Ruby libraries that you may use during your development work (description taken from each project’s RubyForge page):

  • RMagick: An interface to the ImageMagick and GraphicsMagick image processing libraries. Supports more than 90 image formats, including GIF, JPEG, PNG. Includes RVG, a 2D drawing API. Comprehensive HTML documentation.
    to install: “gem install RMagick-win32-1.x.x-mswin32.gem
  • LibXML: The Libxml-Ruby project provides Ruby language bindings for the GNOME Libxml2 XML toolkit. It is free software, released under the MIT License.
  • RedCloth: A module for using Textile in Ruby. Textile is a text format. A very simple text format. Another stab at making readable text that can be converted to HTML.
  • Net::SSH: Net::SSH is to SSH as Net::Telnet is to Telnet and Net::HTTP is to HTTP. Perform non-interactive SSH processing, purely from Ruby!
  • Salted Login: Salted hash loging generator with ActionMailer integration

You can read the help of each library if you failed to install it via RubyGems, feel free to leave a comment here if you faced any problems during the installation.

Moving forward to install the Rails script we talked about earlier, we will install Typo, which is the first Rails Blogging system, quick, simple and widely used among Rails developers, as a start let’s download it from Typo Sphere, as you can see from Download page, it’s clearly mentioned that Typo 2.6 will not work with Rails 1.1 or above, so we have to download the version with frozen Rails included.

Unzip the downloaded file into the web root folder and let’s rename it to “blog” so we get Typo in D:\webroot\blog , now we have to prepare the required database for it, we will create a database and name it “blog” and insert the typo MySQL schema from D:\webroot\blog\db\schema.mysql.sql into it using the command line:

D:\\webroot\\blog>mysql --user=root --password
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 80 to server version: 5.0.21-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE blog
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> quit
Bye

D:\\webroot\\blog>mysql --user=root --password --database=blog\<"D:\\webroot\\blog\\db\\schema.mysql.sql"
Enter password: ********

Finally to get Typo working we have to update the YAML file responsible about connecting Typo to its database, this file is called database.yml and it’s located in D:\webroot\typo\config, all we have to do is changing the password line and place the password we used while installing MySQL in Part 2, then changing the production database from “typo” to “blog” (the line before last), save the file and let’s run WEBrick in production mode (from inside the blog folder) to see if we everything is fine or not yet..

D:\\webroot\\blog>ruby script/server -e=production

Pingo!! It’s running and asking us to complete our admin information, just complete it and have a look at the lovely admin panel and the Ajax goodness implemented inside, although I suggest that you just wait a little bit more to do the Apache or Mongrel integration, at least so you will be able to run it safely online even in production.

Typo Setup Screen

Apache2 and FastCGI

FastCGI with Apache is considered one of the best production environment for Rails applications, although there are many alternatives like LightTPD-FastCGI (Which is better), and Mongrel which will be explained here as well.

The first things we need are the mod_fcgi and mod_sql files that are available in the quick installer package named Ruby for Apache, it’s a straight forward installer that will ask you about the locations of both Apache and Ruby, which are both located in D:\development where we installed them earlier.

Ruby for Apache

We don’t need the mod_ruby file (I even heard that it may make some conflicts too), so anyhow let’s choose mod_fcgi and mod_sql only and start editing our httpd.conf file to configure FastCGI.

Mainly there are three steps to configure FastCGI with Apache and all of them are in httpd.conf file that if you remember is located in D:\Development\Apache\conf\httpd.conf :

  • First let’s load the FastCGI module by adding the following lines to the LoadModule section:
    # Load the FastCGI module we installed through apache for ruby.
    LoadModule fastcgi_module modules/mod_fastcgi.so
  • Secondly let’s configure FastCGI itself, preparing it for the production environment, configuring the min/max processes allowed and define the initial environment variables to lead FastCGI to the Ruby and MySQL directories.
    <IfModule mod_fastcgi.c>
      AddHandler fastcgi-script .fcgi
      FastCgiConfig -maxClassProcesses 1 -maxProcesses 5 -minProcesses 1 -processSlack 1 -idle-timeout 120 \\
      -initial-env PATH="d:/develo~1/ruby/bin;c:/windows/system32;c:/windows;d:/develo~1/MySQL/bin;" \\
      -initial-env RUBYOPT=rubygems \\
    </IfModule>
  • And finally it’s time for the VirtualHost information to be defined. Here there are two options to think of depending on your requirements and situation, for example I have an ISP that block the port 80 (as I mentioned in Part 1) so I won’t be able to run the virtual host as another subdomain referring to my server, but I have to load it on another port and make a direction later.

    As I said, depending on your situation you should chose what best fits your needs, starting with the first option, we will create a new subdomain and refer it to our IP, you can do this simply by following the same steps mentioned in Part 1 for No-IP, and then at the bottom of httpd.conf we will add the VirtualHost details as follows:

    <VirtualHost *>
        ServerName yoursubdomain.no-ip.org
        DocumentRoot "D:/webroot/blog/public/"
        ErrorLog "D:/webroot/blog/public/log/server.log"
     
        <Directory "D:/webroot/blog/public/">
          Options ExecCGI FollowSymLinks
          AllowOverride all
          Allow from all
          Order allow,deny
        </Directory>
    </VirtualHost>

    The second option (which is the one I’m using currently) is where I define a new port for my rails application and then make a quick Apache redirect toward it. First we have to tell Apache to listen to the desired port, then configure the virtual host of this port to refer to our Rails application.

    #Configure Apache to listen to port 4200
    Listen 4200
     
    #Defining the new virtual host at port 4200 to be our rails application
    <VirtualHost *:4200>
        DocumentRoot "D:/webroot/blog/public/"
        ErrorLog "D:/webroot/blog/public/log/server.log"
     
        <Directory "D:/webroot/blog/public/">
          Options ExecCGI FollowSymLinks
          AllowOverride all
          Allow from all
          Order allow,deny
        </Directory>
    </VirtualHost>

If you created the Rails application using the “rails” command on your Win32 machine then dispatch.fcgi will automatically refer to your local Ruby file, but for ready scripts like Typo for example the referred to Ruby is the default Ruby path on Linux systems and has to be changed, to do that simply edit the first line of dispatch.fcgi (located in the “public” directory of every Rails application) from:

#!/usr/bin/env ruby

to:

#!d:/development/ruby/bin/ruby

This will tell FastCGI where your ruby bin files are located and so it will run peacefully.

Note: The above information were gathered from other websites that had solved the difficulties of integrating FastCGI with Apache like Demetrius Nunes’s “Taming FastCFI+Apache on Windows” and Scott Laird’s “Apache tuning for Rails and FastCGI” and other resources too.

Mongrel

Mongrel is very to WEBrick from it’s working point of view, although it’s much faster and more suitable for productive environments than WEBrick, it also run on a specific port and now it is well supported on Windows systems, Mongrel now can be installed as a system service which makes it more stable and better configurable.

To start working with Mongrel we have to install it along with its dependencies, gratefully using RubyGems:

D:\\development>gem install mongrel_service
Attempting local installation of 'mongrel_service'
Local gem file not found: mongrel_service*.gem
Attempting remote installation of 'mongrel_service'
Updating Gem source index for: http://gems.rubyforge.org
Install required dependency gem_plugin? [Yn]  y
Install required dependency mongrel? [Yn]  y
Select which gem to install for your platform (i386-mswin32)
 1. mongrel 0.3.13 (mswin32)
 2. mongrel 0.3.13 (ruby)
 3. mongrel 0.3.12.4 (ruby)
 4. mongrel 0.3.12.4 (mswin32)
 5. Cancel installation
> 1
Install required dependency win32-service? [Yn]  y
Select which gem to install for your platform (i386-mswin32)
 1. win32-service 0.5.0 (mswin32)
 2. Cancel installation
> 1
Successfully installed mongrel_service-0.1
Successfully installed gem_plugin-0.2.1
Successfully installed mongrel-0.3.13-mswin32
Successfully installed win32-service-0.5.0-mswin32
Installing RDoc documentation for mongrel_service-0.1…
Installing RDoc documentation for gem_plugin-0.2.1…
Installing RDoc documentation for mongrel-0.3.13-mswin32…
Installing RDoc documentation for win32-service-0.5.0-mswin32…

Now that Mongrel is installed on our system, we have two commands that we have to use for every Rails application we have and want to run it using Mongrel, the first is where we install the service (check your Windows Services from Control Panel), to do this we have to change directory to the application we want to Mongrel it and then run the command:

cd D:\\webroot\\blog
D:\\webroot\\blog>mongrel_rails service::install -N blog -c D:\\webroot\\typo -p 4000 -e production
Mongrel service 'blog' installed as 'blog'.

Notice that in the above command we have specified the environment (using -e option) as production, and the port (using -p option) to be 4000 and we named the service “blog”, now the service is already installed on our Win32 system, we can run it from Control Panel -> Administrative Tools -> Services or by the command:

D:\\webroot\\blog>mongrel_rails service::start -N blog

Have a look at http://localhost:4000 now and see how it is working. You can leave Mongrel working on this specific port, or make an Apache proxy redirect to it, which is very similar to the first option we had for virtual hosts in FastCGI scenario but with two extra line:

<VirtualHost *>
        ServerName yoursubdomain.no-ip.org
        ProxyPass / http://localhost:4000/
        ProxyPassReverse / http://localhost:4000/
        ProxyPreserveHost On
</VirtualHost>

This will redirect any request to “/” which is the root of the domain to the specific port 4000 at localhost where Mongrel is already running. Note that you have to enable the mod_proxy module from LoadModule section first to get this working

More information about Mongrel on Win32 systems can be found on Mongrel official website, I know this was a very long post, much longer than the previous two parts, but at the same I couldn’t help myself from pointing up some notes and important points that might save your time while preparing this setup, I hope this was useful and helpful.

Now with the end of this part, we have our local development environment ready to host any Rails application, actually it’s already hosting Typo blogging system, using Apache2 with FastCGI or Mongrel environments for a better performance, along with PHP and MySQL that we have installed in Part 2 and No-IP that we have installed in Part 1 to allow our local webserver to go live and online. In the next part (which is the last one), Subversion will be explained and installed, allowing us to collaborate better with our colleagues and friends, creating our own repositories or even using an external one, so stay tuned and hopefully it will be shorter than this one…

Comments

21

  1. Rida Al Barazi » Blog Archive » Boredom? said..

    [...] As you may have seen from the date of my last post I haven’t published any new post for over two weeks now, which I should have an explanation to, and this is what I will try to do here. [...]

  2. Adam Craven said..

    Looking forward to it :)

  3. Rida Al Barazi » Blog Archive » Rails Project Story said..

    [...] Windows users: I tried my best on this: Ruby, Rails, Mongrel, FastCGI, Apache2 and Typo on Windows [...]

  4. Jacquie said..

    Hi,I followed your instruction above but got stuck when running “D:\webroot\blog>ruby script/server -e=production”. I’ve got the error message below

    ./script/../config/..//vendor/rails/activesupport/lib/active_support/dependencie
    s.rb:207:in `load’: no such file to load — environments/=production.rb (Missing
    SourceFile)
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:207:in `load’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:39:in `require_or_load’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:22:in `depend_on’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:178:in `require_dependency’
    from ./script/../config/environment.rb:56
    from script/server:42

    looks like it has something to do with the “file_name”. I updated the activesupport library but nothing seems to work. I didn’t get the result that you’ve got. would you be able to tell me where the problems are? greatly appreciated!!

  5. Jacquie said..

    Now I know the problem. the command should be
    ruby script/server -e production without the “=” between “e” and “production”

  6. Mike said..

    gem install x doesn’t work for me, it hangs for a long time (longest I waited was 35 minutes, without any response). I downloaded all components and installed locally. Everything worked up until I started WEBrick. Well, it worked… sorta. WEBrick started, just as it appears in the tutorial, but the test page didn’t load in the browser. I tried http://localhost:3000 and http://0.0.0.0:3000 and couldn’t get the page to load. I’m a total noob when it comes to this stuff. Any ideas what could be happening?

  7. Rida said..

    @Jacquie: Welcome to ridaalbarazi.com and glad you could solve this :)

    @Mike: Maybe because you are behind a NAT or something you couldn’t install the gems from remote server and you had to download them and install them locally, as for the WEBrick problem I’m not sure what’s the problem, what are getting exactly? is it a “page not found” or something else? try to start WEBrick with some other ports and check if it works.

  8. Muhammad Babsail said..

    good article its really helping me…thx

  9. haris ali said..

    I tried to run the server in production mode i.e. ruby script/server -e=production, however it gives me the following error

    C:\webroot\blog>ruby script/server -e=production
    ./script/../config/..//vendor/rails/activesupport/lib/active_support/dependencie
    s.rb:207:in `load’: no such file to load — environments/=production.rb (Missing
    SourceFile)
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:207:in `load’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:39:in `require_or_load’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:22:in `depend_on’
    from ./script/../config/..//vendor/rails/activesupport/lib/active_suppor
    t/dependencies.rb:178:in `require_dependency’
    from ./script/../config/environment.rb:56
    from C:/Development/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.
    rb:21:in `require’
    from script/server:42

    please help me I am trying to do this since the last two weeks.

    Thank you so much for your help.

  10. Rida said..

    Hello Haris,

    try this (note that there is no equal sign:
    ruby script/server -e production

    And welcome to ridaalbarazi.com

  11. haris ali said..

    Thank so much Rida, u r the best

  12. pravin said..

    how to resolve this error

    C:\development>gem install rails –remote
    Attempting remote installation of ‘rails’
    ERROR: While executing gem … (SocketError)
    getaddrinfo: no address associated with hostname.

  13. Alex Cohaniuc said..

    I get this error message when I start apache with the config file modified

  14. Alex Cohaniuc said..

    I get this error message when I start apache with the config file modified:

    httpd: Syntax error on line 495 of C:/development/Apache2/conf/httpd.conf: API module structure `fastcgi_module’ in file C:/development/Apache2/modules/mod_fastcgi.so is garbled - perhaps this is not an Apache module DSO?

  15. Pankaj said..

    Hi Rida,
    This is a good article.I learn many things from it.
    Thanks.

  16. trama said..

    Ich erklare meinen Freunden uber diese Seite. Interessieren!

  17. imparare said..

    Interesting comments.. :D

  18. roger pack said..

    With regard to using gems to install rails, you could also do this as
    gem install rails –include-dependencies to not have to type as much :)

  19. roger pack said..

    -e=production does not work, as mentioned. Might be a nice thought to change that :)

  20. gerry22 said..

    what happened to part 4?

  21. Raghavendra said..

    Hey things you have posted :-) pretty cool,
    One simple Question triggered in my mind when i install mongrel it overlaps the webrick with default options for ruby script/server :- starts mongrel while we need to specify ‘webrick’ in options can you help me change the default behaviour and also may i know why this is so , please tell me ??

    thanks in Advance

Leave a Reply

you can use these xhtml tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Articles Permanent Link

is cialis or levitra better suggested dose in cialis what colors do valiums come in ex tramadol cialis drug levitra viagra phentermine with online docter consultation viagra news edinburgh comment search ambien no online pharmacy prescription us real valium phentermine for sale without perscription tramadol plus valium plus somas ultram home gym phentermine geberic viagra 50mg valium child custody drug generic generic viagra dose viagra cialis versus regalis valium while pregnant 37.5 card master phentermine amazing blonde fucked cialis order generic ambien 40mg dose of cialis cialis pharmacy direct viagra keyword viagra partial dose meridia online pharmacy phentermine umaxppc xenica viagra treat childhood pulmonary hypertension cialis and adverse effects information about cialis and livetra adipex online sales phentermine purchasing viagra effexor valium contradictions adipex phentermine treetop generic viagra us licensed online pharmacy viagra interaction with doxazosin da li viagra radi description of tramadol hcl-acetaminophen par overnight phentermine huge discounts online pharmacy viagra cialis levitra manufactures ptnrs searchfor viagra viagra impotence pill cialis usa mail crohns phentermine tramadol tramadol a a target blank mexico ambien viagra lawsuit settlements intel ambien modem drivers cialis side effect 0a aan cheapest shops selling phentermine phentermine diet online pharmacy viagra free sites find search pages pcp in urine valium tramadol next day delivery cheap phentermine withouta rx pfizer japan viagra insta phentermine lowest price for phentermine overnight cialis ingredient cialis get viagra pakistanian phentermine ambien on line fed ex german remedies cialis taking elavil and ambien viagra triangle cleveland ohio ambien and celexa drugs mailorder valium adipex meridia online phentermine prescription viagra cialis dizziness cialis liver problems hiv drugs and interactions with cialis weight loss philadelphia phentermine mixing valium with xanax cbs ambien bush fetches george porn viagra girl in viagra commercial gel tab viagra tramadol longterm use eon labs phentermine without a script tramadol meningitis buy phentermine adipex p 37.5mg phentermine no doctor roche valium no prescrption comparing cialis and levitra wine ambien price of valium on the street ambien shipped cod tramadol dosage for dog cheap price on phentermine viagra on-line tinnitus and ambien cr phentermine pharm in stock former senator who did viagra commercials phentermine tetracycline no prescription phentermine cod zanax valium overnight can you take viagra with wellbutrin order phentermine without physicians prescription viagra speedo videos phentermine no rx usa based sites zoloft tramadol interactions birth control allegra acid reflux cialis take phentermine with hydroxycitric acid pain relief tramadol buy viagra in new zealand valium cod buy phentermine cod pharmacy you never mix steroids with viagra ambien imitrex generic cialis tadalafil php ambien and anbien cr difference commview ambien 1low cost cialis get a prescription for viagra herbal ambien ambien cause depression viagra kamagra werkzame bestanddelen sildenafil natural urine detox for valium cialis levitra versus order phentermine adipex phentermine with online doctor los angeles viagra interaction flomax cialis sex story ambien cr 12.5 mg about phentermine best prices on phentermine buy adipex-p phentermine online cheap adipex phentermine tramadol valium together online valium without a prescription adipex diet discount phentermine pill uprima viagra cialis cheapest phentermine prices phentermine mg purchase health phentermine tablet cheap cheap phentermine viagra buy oonline zoloft viagra ejaculation zocor and ambien and interaction cialis levitra viagra comparisons tramadol 50 mg pliva 616 ingredients safe internet shopping generic viagra eng non-prescription valium phentermine with no physcian approval phentermine wihout rx sj lvmord tramadol phentermine and heart rate during exercise phentermine hcl 37 mg tablets drug interactions celebrex tramadol cyclobenzaprine ambien cr coupon about ultram tramadol viagra online money order save ambien cr on line tramadol and vicodin court lawsuits on viagra cialis tadalafil 20 mg viagra best prices fda approved phentermine for overnight and saturday delivery lisinopril viagra interaction valium without precription tadalis cialis tadalafil phentermine purchase phentermine tips tramadol order overnight saturday delivery price comparison for phentermine amp ultram combining metforman and phentermine generic valium and alert generic viagra louisville ky cialis vs viagra forums cheap valium without prescription viagra prescribing information 900 mg phentermine overdose ambien electronics compare cialis prices overseas ambien alternatives by cod tramadol discount phentermine online pharmacy cuba gooding jr cialis commercial 1000 tramadol 1buy cialis generic online generic viagra from canada phentermine no doctor prescription 4.33 n phentermine purchase 99 phentermine cheap viagra generic paypal similar medicines to phentermine phentermine tramadol viagra adipex low cost no prescription phentermine diet diet phentermine pill pill viagra online order cheap cialis for sale viagra damage after 4 hours order phentermine cod overnight delivery by effexor drug interactions with viagra ambien drug interaction ultram relief tramadol fda ambien toxicity buy tramadol online cod cialis free shipping cialis v s viagra phentermine usa pharmacy fda buy valium roche ambien cr review tramadol cicero phentermine pill photos no doctors prescription required phentermine search viagra viagra edinburgh pages online diet pills phentermine no prescription valium withdrawal effects effects of snorting phentermine multiple acts viagra order phentermine online without rx women s natural viagra better phentermine or adipex india phentermine does generic ambien work as well order phentermine no script ambien dwu attorney orange county ca get off of valium buy tramadol cod buy ultram cheapest mail order phentermine ambien used for chronic pain management viagra in kansas city phentermine drug testing tips online prescriptions for cialis boost as viagra phentermine sale 37.5mg express delivery generic viagra viagra news edinburgh tid cfm bad side effects of tramadol coreg cialis photo of ambien free cialis free levitra free viagra ambien generic drug cheap phentermine saturday delivery ups chep phentermine what does it looklike phentermine 30 photos valium 2mg pharmaceuticals viagra viagra epi cialis where cialis viagra softabs forced ejaculation male viagra viagra norvasc drug interaction bootleg pharmacy india phentermine pill my ebay bidding buy tramadol side affects on ambien 5mg overnight fedex ambien prescription celexa phentermine gt viagra help premature ejaculation phentermine success story gt ambien and lawsuit truth about ambien cr phentermine prescribe 15 cialis 20 mg viagra dosge phentermine 90 $149 phentermine wikipedia the c o d tramadol ship everywhere phentermine order generic meltabs viagra cialis drugstores viagra purchase on line tramadol and price generic ambien internet pharmacies phentermine c o d s too many ambien picture of viagra overnight cod phentermine caverta vs viagra phentermine 37.5mg online without rx phentermine problem side effects valium phentermine phentamine keyword viagra phentermine doctor san diego cheapest cialis erectile dysfunction pill price range for the drug viagra diet phentermine ephedra diet pills vitalbodyfitness cost low phentermine tramadol onlines buying ultram online tramadol total purchase phentermine shipped fedex buy valium online canada generic ambien pricing and managed care tramadol urine drug testing buy online us viagra viagra levitra cialis pharmacist perscription drugs online valium prescription take viagra who woman tamadol tramadol 180 pills phentermine hcl 30 mg actos phentermine target pharmacy 3 caverta veega generic viagra phentermine online purchas e penis enlargement pill viagra men order phentermine from pharmacy free consultation cialis commercial song cialis sale can i get viagra by internet tramadol order online cod cialis tadalafil contents arnold cialis phentermine and pulmonary hypertension instructions for valium tramadol hcl dosage phentermines sales ambien cr rebate form lowest phentermine 37 5 prices comparison cialis levitra viagra valium diarheah valium use in pregnancy tramadol famvir allegra cialis tramadol online tramadol hcl tramadol cheap long-term ambien use online order overnight tramadol interaction tramadol warfarin buy phentermine in kentucky questions about viagra find sites computer shop viagra search buy phentermine viagra meridia ultr order viagra air travel php viagra user review cod shipped tramadol phentermine phentremine phentermine aciphex aciphex phentermine actos risperdal little helper valium ambien chemical name generic cialis mexican when will viagra go generic phentermine s xanga site viagra liver problems cheap pharmaceutical viagra does the drug phentermine phentermine no prescription free consultation female free sample viagra prescription weight loss medications phentermine adipex cheap viagra cialis buy viagra online canada ionamin phentermine orn viagra generic for ambien cr no script next day phentermine valium grapefruit online sales viagra buying online risk viagra tramadol injection half life cialis levitra viagra comparison ambien sleep product discount viagra brand drug phentermine actos imitrex good deals on viagra flushed feeling and tramadol phentermine for cheap online pharmacy loss phentermine weight rss feed ambien recreational ambien alternative order viagra cialis levitra pharmacy seizures from tramadol cheap tramadol cod saturday delivery canada buy real viagra online phentermine with hoodia viagra commercial clips phentermine online diagnosis viagra best deals ambien login sleeping pills zolpidem ambien diet inexpensive phentermine pill zocor and avoid and ambien phentermine from germany buy levitra viagra phentermine health index pravachol phentermine skelaxin canadas viagra commercial familydoctor org sildenafil viagra phentermine $99 no script buy phentermine adipex p online phentermine overnight fedex no prescription 37.5 rainbowpush discussion board buy viagra 37 5mg phentermine pcp specialist thanks to ambien buy viagra without prescription side affects of viagra buy xanax valium viagra free sample valium and prozac cheap phentermine cheap phentermine online here cialis in uae k-9 tramadol hcl purchase valium c o d where can i buy viagra dogs and ambien online pharmacy no prescription required phentermine viagra vs levitra 37.5 90 phentermine drinking alcohol with tramadol viagra cialis buy no prescription buying phentermine online us licensed pharmacies phentermine erection add cardizem cd actos phentermine norvasc cialis tablet phentermine metabolized by pictures pills phentermine lose weight prozac phentermine cialis causes lower blood pressure viagra mice recall for ambien cr tadalafil vs generic viagra viagra levitra comparison phentermine to canada viagra cialis online pharmacy buy card debit online phentermine where can i order phentermine prices of viagra and cialis buy cheap generic viagra online tramadol and alcohol free viagra canada valium to treat canines phentermine foradil phentermine evista no prescription phentermine 15mg phentremine cialis and levitra compare viagra discount viagra prescription drugs viagra cialis canada consultation online pharmacy phentermine ambien mg doses will tramadol test positive for methadone effects of ambien on fetus phentermine cod pharmacy online viagra h omepage valium valium viagra love feelings order phentermine without calling doctor online pharmacy phentermine no prescription nasacort aciphex aciphex phentermine prescription pharmacy phentermine no prescription no doctor better levitra viagra viagra gift tramadol advil ambien heart disease cialis viagra propecia levitra erectile dysfunction cialis fast shipment cialis viagra online pharmacy tramadol crystal meth mexican prescription drugs names ultram tramadol 4.01 online phentermine purchase valium and purpose viagra 24 hours delivary discounts for phentermine cialis generic levitra review viagra phentermine review headaches when taking phentermine brown urine valium cialis fee online what is tramadol 3f no prescription valium overnight delivery detox hgh phentermine quit smoking xenical cialis cheapest lowest price phentermine chemical enhancement phentermine website impurity related substance viagra disounted phentermine canada buy viagra online valium gentic phentermine forums discussion phentermine no shipping to kentucky valium online consultation ambien books generic online phentermine pharmacy online order viagra online a href cheapest phentermine no presc tramadol side affect ambien for 49 95 phentermine cod mastercard viagra overseas information phentermine edinburgh uk viagra search cialis charles phentermine at cms ambien sirius commercial compare diethylpropion and phentermine valium look like order generic cialis c o d tadalafil cialis vs viagra tramadol and clonidine kill yourdelf with ambien zolpidem vs ambien cialis tadalafil treat where to buy phentermine without prescription fedex valium viagra in india tramadol cat medication buy phentermine blue white capsuls online cheap generic kamagra kamagra uk viagra ripoff phentermine websites long term effect ambien on liver viagra safe for dogs diazepam overdose valium overdose ambien insomnia side effects bbs bbs valiums viagra half life filing income tax buy tramadol valium and darvocet interaction rx cod valium usa cialis and levitra viagra made site viagra selges online rx phentermine tramadol halflife drugstore ambien order tramadol cod non phentermine prescription xenical hgh phentermine quit smoking grapefruit and cialis phentermine mexico ebay dding buy viagra viagra online diagnosis discover viagra best pharmacy phentermine tramadol hci black box warnings doctors prescribing phentermine online getting valium out of your system viagra ambien gift generic online pharmacy viagra phentermine and pharmacy will alcohol effect viagra dj valium omen 3 diet pill addiction phentermine viagra vs nitro 180 tramadol viagra instuctions tramadol trammadol metformin viagra comparison viagra levitra cialis discount drugs viagra 100mg cheapest ambien online generic phentermine pharmacy online dosage for tramadol valium information from drugs com phentermine where to buy 3 99 order ambien from canada phentermine detection tramadol best price oversea valium heavy sedation bournemouth buy from viagra take tramadol while breast feeding buy tramadol online cod ultram tramadol ultracet online accept paypal tramadol acetaminophen legal no prescription phentermine tadalafil citrate cialis valium 5mg doseage