Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 138 lines (97 sloc) 4.13 kB
23971cf @moritz add INSTALL document
authored
1 Dependencies:
2 perl 5.12.0 or later
3 DBIx::Class::Tree::NestedSet from https://github.com/moritz/DBIx-Class-Tree-NestedSet
5ce3341 @gabimuc Added missing perl module DBICx::TestDatabase
gabimuc authored
4 DBICx::TestDatabase
23971cf @moritz add INSTALL document
authored
5 ISBN::Country from https://github.com/moritz/ISBN-Country
6 DBD::Pg
7 Mojolicious
8 Locales
9 Crypt::Eksblowfish::Bcrypt
10 KinoSearch
f472a4c @moritz [INSTALL] missed a dependency
authored
11 aliased
441dbf0 @moritz note missing dependency
authored
12 Test::Exception
23971cf @moritz add INSTALL document
authored
13
fb2f7c5 @moritz more INSTALL docs
authored
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
afd6c35 @gabimuc Added postgresql-server-dev-8.4
gabimuc authored
19 aptitude install postgresql-8.4 postgresql-client-8.4 postgresql-server-dev-8.4
fb2f7c5 @moritz more INSTALL docs
authored
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 {
74f710c @moritz [INSTALL] add web secret
authored
48 "web_secret": "<long, random string goes here>",
fb2f7c5 @moritz more INSTALL docs
authored
49 "dev": {
50 "dbname": "quelology-dev",
51 "dbhost": "localhost",
7dcdc3f @gabimuc Corrected DB user quelology_db
gabimuc authored
52 "dbuser": "quelology_db",
fb2f7c5 @moritz more INSTALL docs
authored
53 "dbpass": "<password>"
54 },
55 "test": {
56 "dbname": "quelology-test",
57 "dbhost": "localhost",
7dcdc3f @gabimuc Corrected DB user quelology_db
gabimuc authored
58 "dbuser": "quelology_db",
fb2f7c5 @moritz more INSTALL docs
authored
59 "dbpass": "<password>"
60 },
61 "prod": {
62 "dbname": "quelology-prod",
63 "dbhost": "localhost",
7dcdc3f @gabimuc Corrected DB user quelology_db
gabimuc authored
64 "dbuser": "quelology_db",
fb2f7c5 @moritz more INSTALL docs
authored
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
7dcdc3f @gabimuc Corrected DB user quelology_db
gabimuc authored
75 psql -h localhost -U quelology_db quelology-dev < schema.sql
fb2f7c5 @moritz more INSTALL docs
authored
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
a782a22 @moritz [INSTALL] correct information about creating indexes
authored
108 Now create the search indexes (currently requires postgres 8.4 or newer):
fb2f7c5 @moritz more INSTALL docs
authored
109
a782a22 @moritz [INSTALL] correct information about creating indexes
authored
110 perl tools/create-ksx-index.pl
fb2f7c5 @moritz more INSTALL docs
authored
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
019a685 @moritz update INSTALL and README
authored
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
43565a0 @moritz document optional depencies. Add a tool for importing data from libri…
authored
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
019a685 @moritz update INSTALL and README
authored
136
fb2f7c5 @moritz more INSTALL docs
authored
137 Have fun!
Something went wrong with that request. Please try again.