-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
117 lines (71 loc) · 2.67 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Virginia Voter Log Analytics
============================
Requirements
------------
* Ruby 1.9.3
* Sqlite3 (development), MySQL 5+ (production)
Installation
------------
* Get the most recent source code.
* Install required gems:
$ bundle install
* Start the application server:
$ rails server thin
Deployment prerequisites
------------------------
* MySQL 5+
* Ruby 1.9.3-p0 (see Installing Ruby section)
* Apache 2 with Passenger 3.0.11 (see Installing Passenger section)
Deployment
----------
* (locally) Copy config/deploy.rb.sample to config/deploy.rb
* Change "domain" to either IP or domain address of the target system
* Change "user" / "runner" to the name of the Unix user you will be SSH'ing into the "domain" as
* Change "branch" to the branch name (i.e. "master", "release" etc)
or to the release tag (i.e. "1.1", see below "Release tagging" section)
* (locally) Setup the remote location:
$ cap deploy:setup
* (locally) Verify the setup:
$ cap deploy:check
* (remotely) Create configuration files:
* create database for the application (i.e. va_analytics)
* create <deploy_to>/shared/config/config.yml (see sample in config/config.yml.sample)
* create <deploy_to>/shared/config/database.yml (see sample in config/database.yml.sample) with only the "production" environment, like this:
production:
adapter: mysql2
database: va_analytics
host: localhost
username: <db_user>
password: <db_password>
socket: <path_to>/mysql.sock
* (locally) Make initial one-time deployment:
$ cap deploy:cold
* (locally) Seed the database from db/seed.rb
$ cap db:seed
* (remotely) Configure Apache virtual host with:
<VirtualHost *:8888>
ServerName server.com
DocumentRoot <deploy_to>/current/public
</VirtualHost>
Release tagging
---------------
To tag a release you:
* (locally) Mark a certain commit on "master" branch:
$ git tag 1.1
* (locally) Push tags to remote repository:
$ git push --tags
Installing Ruby
---------------
Detailed installation instructions can be found here:
http://www.ruby-lang.org/en/downloads/
You can either build it from source code or use RVM.
Installing Passenger
--------------------
Once you have Ruby and Apache 2 installed, to install Passenger you run:
$ gem install passenger
$ passenger-install-apache2-module
The installation requires some development libraries of Apache server
and the configuration script will show which of them are missing.
Upon installation, you need to add Passenger module configuration to
your httpd.conf or a separate file in `/etc/httpd/conf.d/passenger.conf`
(recommended).