Displaying articles with tag rack

Hosting on IIS 6.0 revisited

Posted by matt.overstreet, Thu Mar 24 13:56:00 UTC 2011

Assumptions

  • Windows Server 2003 (XP or 2k will not work)
  • IIS 6 (IIS 7 has it's own rewrite filter, so the IIRF instructions would change)
  • Should not interfere with other sites running on the IIS server

Installation and configuration

Ruby and bundler

Install Ruby 1.8.7-p334 from [[http://rubyinstaller.org/downloads]]

In a command window gem install bundler

Ruby Windows DevKit

You will need this in order to build native extensions, such as curb and nokogiri

Install the Ruby Windows DevKit from [[http://rubyinstaller.org/downloads]]

Follow the instructions from the DevKit wiki

  1. Extract the DevKit contents into a directory with no spaces, e.g. – C:\DevKit.
  2. Run ruby.exe dk.rb init
  3. Run ruby.exe dk.rb install

Rake

gem install rake

MSSql gem

In a command window gem install ruby-odbc gem install activerecord-sqlserver-adapter

You will need to setup a ODBC DSN in order to connect to the database. c:\Windows\system32\odbcad32.exe Create a system DSN with the "SQL Native Client adapter".

name: mondial_development select your database server

On the next page, select "With SQL Sever Authentication" and provide valid credentials.

On the next page, set the default database.

On the next page, disable "Perform translation for character data"

git

Install msysgit

Settings are not clear at this time, default to the less invasive options.

This will install a Git folder in your start menu with 2 applications (Git Bash and Git GUI)

reference: Github on installing on Windows

ssh key for github

See help document on Github.com

Pulling down the code

Run Git Bash


    cd /c/
    mkdir rails
    cd rails
    git clone git@github.com:username/appname.git

Install IIRF (Ionic's ISAPI Rewriting Filter) for x64

IIRF allows us to use many of the features of Apache's mod_rewrite for IIS 6. We use it to proxy requests for our rails app to our rails server process (mongrel or thin)

Download the IonicIsapiRewriter-2.1.1.25-Release-x64-bin.zip Note: if you are installing on 32bit windows you can just use the MSI Detailed install instructions for IIS 6 are under the heading "Installing IIRF" here

Roughly (more information at the url above or in the .chm included with IIRF)

  • place the IIRF.dll somewhere in the filesystem. If you have spaces in your path you'll need to make sure you quote the entire path in IIS settings later. (ex. C:\WINDOWS\system32\inetsrv\IIRF\IIRF.dll)

  • you may want to copy the rest of the bin directory to the folder you used above (optional)

  • add an empty IirfGlobal.ini to this same folder. It is used for global IIRF settings and we are putting it here as a placeholder.

  • Make sure your IIS user can see, traverse and read the folder you created. Adding the rights to the IISWPG group _should do the trick, depending on how heavily server modifications.

  • View the properties of your website in IIS Manager.

  • In the "ISAPI filters" tab add: Filter name: IIRF - Ionic ISAPI Rewriting Filter Executable: C:\WINDOWS\system32\inetsrv\IIRF\IIRF.dll

  • Enable the dll as an ISAPI extension so that the proxypass works for POST actions. In properties click Configuration on the "Home Directory" tab

  • Click Add. Executable: C:\WINDOWS\system32\inetsrv\IIRF\IIRF.dll Extension: .iirf Verbs: all Script Engine: on Verify that file exists: off

  • Add an IIRF.ini file to your apps root directory (public/ on a rails app)


    #  IIRF.ini
    #
    #  ini file for proxying to an internal webserver
    #

    RewriteLog c:\logs\iirf
    RewriteLogLevel 3
    IterationLimit 10
    MaxMatchCount 10
    RewriteEngine ON
    StatusInquiry ON

    #  act as a proxy the rails webserver
    RewriteCond         %{REQUEST_FILENAME}     !-f
    ProxyPass           ^/(.*)$   http://127.0.0.1:3000/$1
    ProxyPassReverse    /         http://127.0.0.1:3000/

Setup Mongrel_service

gem install mongrel_service
mongrel_rails service::install -N mondial_mobile_www /
          -c c:\rails\MyApp\ -p 3000 -e production

Notes

Thin instead of Mongrel

gem install thin

and then either the win32-service gem or with the native MS tool Srvany.exe.

Development MSSql server

If you are building a development installation you will also want to download Microsoft SQL Server 2005 Express Edition.

You will also need the .NET 2.0 framework 32-bit or .NET 2.0 framework 64-bit.

0 comments | Filed Under: Blogroll Projects | Tags: rack

December Meeting: Matt Overstreet & URIs

Posted by melriffe, Sun Dec 06 19:35:00 UTC 2009

As 2009 comes to a close, we have one of our own stepping up the plate to talk to us about URI’s and their lifecycle.

Abstract

“Rack::Route301, A rack module to manage old routes”

Moving an existing site from the old and busted to the new hotness involves a million little details. Removing that old table layout, scrubbing the data, selling or sneaking in a new feature or two, etc., etc., all the way down to the zoot. But when all is said and done, where did mysupersite.net/lolfrogz?color=blu&cuteness=-4 go?

URI lifetime matters.

We’ll talk about a few solutions, from .htaccess, to application controllers in RoR, to Rack. And finish with Rack::Route301, an very young Rack based solution that Matt will be releasing as an open source project.

Location

Tuckahoe Public Library, 1901 Starling Drive in Richmond.

Look here for directions: http://www.henricolibrary.org/Libs/tu.html

2 comments | Filed Under: Meetings | Tags: rack

2009 Schedule, the 2d half

Posted by melriffe, Wed Jun 03 23:26:00 UTC 2009

It’s June Already?

I can’t believe this year is already half over. We’ve been fortunate enough to have speakers since last October; the rest of the year is pretty exciting too. And so without further ado, here’s the current line-up from July to December 2009:

Schedule

DateTopicSpeaker
14 JulCreating Mashups w/RubyJess Martin
11 AugQA Testing w/CucumberPatrick Reagan
8 SepMidori, Rails-inspired PHP frameworkYoussef Chaker
OctoberTBAAndy Hunt
10 NovJRuby and ClojureKeith Bennett
8 DecRackMatt Overstreet

Notes

If any of the meetings/speakers change I will send out a notice. Plus, the October meeting will be a joint meeting with the RJUG. As the dates get closer I’ll send out additional details on each speaker and their topic.

See you at the Meetings! Remember, spread the word and bring a friend!

0 comments | Filed Under: Meetings | Tags: rack

April Meeting Follow-up

Posted by melriffe, Tue Apr 21 23:13:00 UTC 2009

Summary

I believe this meeting will go down as one of the strangest meetings in CVREG history. Ben arrived early and as people started coming in it was noted the projector was missing. Oh No! While the projector was getting retrieved I did my best to entertain, but I failed miserably. Thankfully Ben and a few of the Viget Labs crew was on hand to talk about Developer Day and RubyNation.

I must say someone did ask what happened to my hair (my ponytail, actually) and if I was going to grow it out again. Ummm…no comment and maybe ;-)

But the real excitement was Ben’s presentation. Ben devised a way to drastically reduce time to display using a combination of page caching, AJAX and Rails Metal. I believe someone Ben trademark it. :-)

If you were in attendance please consider rating Ben’s presentation on SpeakerRate. I’ve included the link in the Additional Information section.

Attendance

We had 15 people at this month’s meeting. The third double-digit attendance. You guys Rock! We even had three brand new faces in attendance. Very encouraging. Please, keep spreading the word.

I would also encourage you to make suggestions on how we can serve your Ruby needs. Remember we have the mailing list and the IRC channel in which to post your questions and suggestions.

Additional Information

Next Meeting

Stay Tuned for details on May’s Meeting. I don’t have a speaker booked for May because of RailsConf. So, if you or someone you know is attending RailsConf stop by and give us your impressions. If nothing else we can all go to the pub for a pint or two. ;-)

Announcements

beCamp 2009 is happening again. If you’re not familiar if a BarCamp-style two-day conference held in Charlottesville, VA. This year is being held on 8 and 9 May. It looked like several people from the group will be attending. I encourage you to carpool. There will be a one-night hotel stay.

Developer Day is a one-day, developer-centric conference in DC. And did I mention it’s only Fifty Bucks (USD$50) [there is an additional $1.25 Fee when registering]? It’s being held on 30 May, that’s a Saturday if you don’t have a calendar handy. The website has additional information, like speakers, agenda, and a map!

Also, RubyNation 2009 is once again being held in Washington DC on 12-13 June. Registration is still open and be sure to use the discount code NovaRUGFan to get $20.00 off.

Last but definitely not least I want to say something about tonight’s sponsor: Viget Labs. They were kind enough to pay for this month’s dinner.

1 comment | Filed Under: Meetings | Tags: rack

April Meeting: Ben Scofield & Rails Page Caching

Posted by melriffe, Tue Mar 31 23:01:00 UTC 2009

Meeting Details

Date: Tuesday, 14 April
Time: 6:00 – 8:00 PM
Place: Strategy Cafe
Details: Upcoming Event

We would greatly appreciate it if you could go to the Upcoming Event and indicate your intention to attend this meeting.

Meeting Abstract

Over the past year, Rails has gradually (and sometimes quietly) introduced some dramatic new changes. The most obvious of these is the Merb merger, but one of the most important steps on the path to Rails 3.0 was the introduction of Rack support. The effects of that change are wide-ranging, and are often surprising — and include the possibility for new architectures that were impractical or impossible before. Specifically, it is now feasible to build a complex Rails application that can still respond extremely quickly and directly to a specific set of requests, such as those an AJAX service might experience.

Page Caching for your Rails App

In this session, we’ll explore in depth how this strategy reinvigorates a useful, but formerly limited, capability of Rails: page caching. Of the three caching methods built into Rails, page caching is by far the most efficient, but it is also the least flexible. By making use of the Rack support in Rails (with tools like Rails Metal and simple Rack applications), page caching will come into its own as a viable strategy.

Presenter Bio

Ben Scofield is a development director at Viget Labs, where he builds Rails applications for Web 2.0 startups. He’s been using Ruby and Rails for over four years, and is the author of Practical REST on Rails 2 Projects, from Apress. He’s spoken at Railsconf, Rubyconf, Railsconf Europe, and more over the past few years. When he’s not hacking, he spends time with his wife and daughter, reads voraciously, and tries to make the world a better place for web developers everywhere.

0 comments | Filed Under: Meetings | Tags: rack