Updated README.

This commit is contained in:
Wlodek Bzyl 2009-06-02 11:41:10 +02:00
parent 427c17e4b5
commit be6c5e3012
2 changed files with 21 additions and 7 deletions

View File

@ -142,8 +142,11 @@ The `example` directory contains two reusable Sinatra applications:
*rsummer*, *rwinter* and a rackup file `rconfig.ru` which *rsummer*, *rwinter* and a rackup file `rconfig.ru` which
dispatches these applications to `/summer` and `/rsummer` sub URI: dispatches these applications to `/summer` and `/rsummer` sub URI:
require 'rsummer/summer' $LOAD_PATH.unshift('rsummer')
require 'rwinter/winter' require 'summer'
$LOAD_PATH.unshift('rwinter')
require 'winter'
map '/summer' do map '/summer' do
run Sinatra::Summer.new run Sinatra::Summer.new
@ -153,18 +156,26 @@ dispatches these applications to `/summer` and `/rsummer` sub URI:
run Sinatra::Winter.new run Sinatra::Winter.new
end end
This rackup file could be used to deploy to virtual host's root: Run `rconfig.ru` file with:
rackup -p 3000 rconfig.ru
This file can be used to deploy to virtual host's root with Passenger.
To this end, create an Apache2 configuration file with the following
content:
<VirtualHost *:80> <VirtualHost *:80>
ServerName hitch.local ServerName hitch.local
DocumentRoot /srv/www/hitch.local DocumentRoot /srv/www/hitch.local
</VirtualHost> </VirtualHost>
To this end, create directories required by Passenger: Next, create directories required by Passenger:
mkdir /srv/www/hitch.local/{public,tmp} mkdir /srv/www/hitch.local/{public,tmp}
and move `config.ru` into `/srv/www/hitch.local`. and copy `config.ru` into `/srv/www/hitch.local` and
update `LOAD_PATH` in the copied file.
With everything in place, after restarting Apache2, With everything in place, after restarting Apache2,
the applications are accessible from the the applications are accessible from the

View File

@ -1,5 +1,8 @@
require 'rsummer/summer' $LOAD_PATH.unshift('rsummer')
require 'rwinter/winter' require 'summer'
$LOAD_PATH.unshift('rwinter')
require 'winter'
map '/summer' do map '/summer' do
run Sinatra::Summer.new run Sinatra::Summer.new