From cfb8fd37ee6e3adbfc2295183035aa59d9d7eaf2 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 15 Nov 2011 15:46:08 +0100 Subject: [PATCH] Added configuration files, directories and README information for deployment. --- README | 84 ++++++++++++++++++++++++++++++++++++++++++++++-- config.ru | 9 ++++++ db/.placeholder | 0 tmp/.placeholder | 0 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 config.ru create mode 100644 db/.placeholder create mode 100644 tmp/.placeholder diff --git a/README b/README index 9b5c655..14201c3 100644 --- a/README +++ b/README @@ -22,13 +22,14 @@ Stop… Camping Time! is a Camping application, so you need: * Camping (>= 2.1) with * Active Record (>= 2.3) * Markaby, and optionally: - * Mongrel + * Mongrel (for testing and deployment without Apache/Rackup) The following Ruby libraries are required: * ActionPack (>= 2.3) for ActionView * ActiveSupport (>= 2.3) * MIME-Types +* Rack (for deployment using Apache/Rackup) * SASS and the following LaTeX programs: @@ -44,13 +45,92 @@ site-wide deployment yet. == Usage -Run from the command line: +Stop… Camping Time! can be deployed directly using the Camping server +(which uses Mongrel, or optionally Webrick). This is for simple +deployments or for testing purposes. +Easy deployment via Apache is possible using Phusion Passenger, aka +_mod_rails_ or _mod_rack_ (see http://modrails.com). See below for the +basic instructions. + +Note that this application is a valid Rack application (see +http://rack.rubyforge.org/) and can be deployed by anything that supports +them. + +=== Camping Server/Mongrel + +Simply run from the command line: $ camping stoptime.rb and head over to http://localhost:3301/ to view and use the web application. +=== Physion Passenger (mod_rails/mod_rack)/Apache + +Camping applications are Rack applications. Deployment follows the +standard way of deploying Rack applications using mod_rack. +Stop… Camping Time! additionally needs to have the +xsendfile+ +module installed. + +*N.B.* Ensure that Apache can, in both types of setups, write in the +db/+ +and +public/+ folder. + +==== Deployment on a virtual host + +Use the following basic configuration: + + + ServerName some.domain.tld + DocumentRoot /path/to/stoptime/public + + Allow from all + Options -MultiViews + + + XSendFile on + + +Now, restart Apache and visit http://some.domain.tld/. + +==== Deployment on a sub URI + +For deployment on a sub URI, let us assume there is some virtual host +serving files under +/path/to/document_root+, i.e. something like: + + + ServerName some.domain.tld + DocumentRoot /path/to/document_root + + + +Then, add a symlink from the +public+ subdirectory of to the document +root, e.g. + + ln -s /path/to/stoptime/public /path/to/document_root/stoptime + +Then, add a +RackBaseURI+ option to the virtual host configuration. +For example: + + + ServerName some.domain.tld + ... + + RackBaseUri /stoptime + + Options -Multiviews + + + XSendFile on + + +Now, restart Apache and visit http://some.domain.tld/stoptime. + +For more extensive information, please refer to the documentat of +Phusion Passenger: +http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_rack_based_ruby_application + == License Stop… Camping Time! is free software; you can redistribute it and/or diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..00c13b0 --- /dev/null +++ b/config.ru @@ -0,0 +1,9 @@ +#!/usr/bin/env rackup + +require "./stoptime" + +StopTime::Models::Base.establish_connection( :adapter => 'sqlite3', + :database => 'db/stoptime.db', + :timeout => 10000 ) +StopTime.create +run StopTime diff --git a/db/.placeholder b/db/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/tmp/.placeholder b/tmp/.placeholder new file mode 100644 index 0000000..e69de29