Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 138 lines (97 sloc) 4.13 kb
23971cf1 »
2011-05-09 add INSTALL document
1 Dependencies:
2 perl 5.12.0 or later
3 DBIx::Class::Tree::NestedSet from https://github.com/moritz/DBIx-Class-Tree-NestedSet
5ce33415 »
2011-05-17 Added missing perl module DBICx::TestDatabase
4 DBICx::TestDatabase
23971cf1 »
2011-05-09 add INSTALL document
5 ISBN::Country from https://github.com/moritz/ISBN-Country
6 DBD::Pg
7 Mojolicious
8 Locales
9 Crypt::Eksblowfish::Bcrypt
10 KinoSearch
f472a4c9 »
2011-05-15 [INSTALL] missed a dependency
11 aliased
441dbf04 »
2011-06-26 note missing dependency
12 Test::Exception
23971cf1 »
2011-05-09 add INSTALL document
13
fb2f7c5b »
2011-05-09 more INSTALL docs
14 A postgresql database server, and ideally three databases, one each for
15 development, testing and production.
16
17 For example under Debian, you'd install
18
afd6c352 »
2011-05-17 Added postgresql-server-dev-8.4
19 aptitude install postgresql-8.4 postgresql-client-8.4 postgresql-server-dev-8.4
fb2f7c5b »
2011-05-09 more INSTALL docs
20
21 And then create the databases:
22
23 su - postgres
24
25 # create a database user:
26 createuser -S -D -R -P quelology_db
27 # you will be asked for a password. Enter one and write it down somewhere
28
29 # create the actual databases
30 createdb --encoding UTF-8 --owner quelology_db quelology-dev 'Quelology development database'
31 createdb --encoding UTF-8 --owner quelology_db quelology-test 'Quelology test database'
32 createdb --encoding UTF-8 --owner quelology_db quelology-prod 'Quelology production database'
33
34 # set them up to support triggers:
35 createlang -d quelology-dev plpgsql
36 createlang -d quelology-test plpgsql
37 createlang -d quelology-prod plpgsql
38
39 # stop being user 'postgres':
40 exit
41
42
43 Create a file called config.json in the quelology source tree root,
44 with contents like that (and replace <password> with the actual
45 database password:
46
47 {
74f710cb »
2011-05-09 [INSTALL] add web secret
48 "web_secret": "<long, random string goes here>",
fb2f7c5b »
2011-05-09 more INSTALL docs
49 "dev": {
50 "dbname": "quelology-dev",
51 "dbhost": "localhost",
7dcdc3ff »
2011-05-17 Corrected DB user quelology_db
52 "dbuser": "quelology_db",
fb2f7c5b »
2011-05-09 more INSTALL docs
53 "dbpass": "<password>"
54 },
55 "test": {
56 "dbname": "quelology-test",
57 "dbhost": "localhost",
7dcdc3ff »
2011-05-17 Corrected DB user quelology_db
58 "dbuser": "quelology_db",
fb2f7c5b »
2011-05-09 more INSTALL docs
59 "dbpass": "<password>"
60 },
61 "prod": {
62 "dbname": "quelology-prod",
63 "dbhost": "localhost",
7dcdc3ff »
2011-05-17 Corrected DB user quelology_db
64 "dbuser": "quelology_db",
fb2f7c5b »
2011-05-09 more INSTALL docs
65 "dbpass": "<password>"
66 }
67 }
68
69 Set permissions so that no other use can read your passwords:
70
71 chmod 600 config.json
72
73 Populate the development database with a schema:
74
7dcdc3ff »
2011-05-17 Corrected DB user quelology_db
75 psql -h localhost -U quelology_db quelology-dev < schema.sql
fb2f7c5b »
2011-05-09 more INSTALL docs
76
77 With a bit of luck, you should now be able to run
78
79 perl web/quelology daemon
80
81 And get a response like this:
82
83 Mon May 9 09:48:22 2011 info Mojo::Server::Daemon:297 [29749]: Server
84 listening (http://*:3000)
85 Server available at http://127.0.0.1:3000.
86
87 Now point your web browser to http://127.0.0.1:3000/ and admire a nearly empty
88 page :-).
89
90 Kill the server again by pressing Ctrl+C in the console where you started it.
91
92 To avoid having to enter your database passwords whenever you import or export
93 data (which also happens during automated unit tests), create a file called
94 .pgpass in your home directory, with contents like this:
95
96 localhost:5432:quelology-dev:quelology:<password>
97 localhost:5432:quelology-test:quelology:<password>
98 localhost:5432:quelology-prod:quelology:<password>
99
100 (without the leading spaces, and again substitute <password> for the actual
101 database password).
102
103 You can import a bunch of data which makes development much more fun:
104
105 wget http://moritz.faui2k3.org/tmp/quelology-latest.sql.gz
106 zcat quelolog-latest.sql.gz | psql -h localhost -U quelology quelolog-dev
107
a782a229 »
2011-06-09 [INSTALL] correct information about creating indexes
108 Now create the search indexes (currently requires postgres 8.4 or newer):
fb2f7c5b »
2011-05-09 more INSTALL docs
109
a782a229 »
2011-06-09 [INSTALL] correct information about creating indexes
110 perl tools/create-ksx-index.pl
fb2f7c5b »
2011-05-09 more INSTALL docs
111
112 And start the web server again:
113
114 perl web/quelology daemon
115
116 And browse http://127.0.0.1:3000/
117
019a6859 »
2011-05-22 update INSTALL and README
118
119 Some features of quelology require access to the Amazon advertising API.
120 This is necessary for the amazon search, and for importing raw publications
121 from amazon.
122
123 To use these features, you must sign up at
124 https://affiliate-program.amazon.com/ to obtain a "token" and a "secret key".
125
126 Add those two strings to the config.json file, with keys "amazon_token"
127 and "amazon_secret_key".
128
43565a02 »
2011-06-18 document optional depencies. Add a tool for importing data from libri…
129 Some tools in the tools/ directory require additional modules to run.
130 Most developers don't need those, many concern additional data mining
131 tasks. Those additional modules are
132
133 WebService::Libris
134 WWW::Wikipedia::Links
135
019a6859 »
2011-05-22 update INSTALL and README
136
fb2f7c5b »
2011-05-09 more INSTALL docs
137 Have fun!
Something went wrong with that request. Please try again.