Let's say you want to host domains first.com and second.com.
Create folders for their files:
| #!/bin/bash | |
| echo "Generating URL..." | |
| FULL_PATH="/Users/tbenzige/Projects/aws" | |
| #Count is kept based on a list.txt file | |
| #list.txt is a plain text file meant to show relationships between URLs | |
| #Instead of a running count, we just count the lines in list.txt | |
| INITIAL=`echo -n $(cat $FULL_PATH/list.txt | wc -l)` | |
| NUM="$INITIAL/4" |
The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).
In a nutshell,
So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.
| # How to give your devise controllers all the same layout (e.g. "authentication" below) | |
| class ApplicationController < ActionController::Base | |
| layout :setup_layout | |
| def setup_layout | |
| return "authentication" if | |
| [ConfirmationsController, PasswordsController, SessionsController, | |
| RegistrationsController, UnlocksController].include? self.class | |
| "application" | |
| end |
| $ autotest | |
| loading autotest/rails_rspec2 | |
| style: RailsRspec2 | |
| -------------------------------------------------------------------------------- | |
| /Users/dchelimsky/.rvm/rubies/ruby-1.8.7-p249/bin/ruby -rrubygems /Users/dchelimsky/.rvm/gems/ruby-1.8.7-p249/gems/rspec-core-2.0.0.beta.6/bin/rspec /Users/dchelimsky/tmp/example/spec/models/widget_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/show.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/edit.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/new.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/controllers/widgets_controller_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/index.html.erb_spec.rb | |
| *................... |