source: trunk/INSTALL @ 1145

Last change on this file since 1145 was 1145, checked in by Earle Martin, 14 years ago

Add '--force' option to Build.PL to skip all questioning.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.8 KB
Line 
1OpenGuides installation instructions
2====================================
3
4
5If while following the instructions below or while trying to use your
6OpenGuides install you see an error that you don't understand, please
7consult the TROUBLESHOOTING file.
8
9For details about installing multiple OpenGuides sites on a single
10server, or installing OpenGuides into a directory that isn't where
11your system Perl library is, see further down this file.
12
13* Basic installation
14
15Unpack the distribution (using for example 'tar' or 'WinZip'), and set
16your working directory to be the top level of the distribution.
17
18If you have an existing "wiki.conf" configuration file and you wish
19to keep using the values in that, copy it to this directory.
20
21Now execute the following commands:
22
23perl Build.PL
24perl Build
25perl Build test
26perl Build install
27
28The very first of these commands asks a number of questions regarding
29the installation.
30
31
32  "Skip OpenGuides configuration?"
33
34Answer "n" to this question unless you really know what you're doing.
35It's mainly there for developers. (If you already have a configuration
36file, and wish to use it without the build script asking you this
37question, run Build.PL with the option --force. This will also skip
38the "Continue with install?" question.)
39
40
41  "What type of database do you want the site to run on?"
42
43Answer "postgres", "mysql", or "sqlite".
44
45
46  "What's the name of the database that this site runs on?"
47  "...the database user that can access that database?"
48  "...the password that they use to access the database?"
49
50You should create (or ask your ISP/sysadmin to create) a database
51specifically for the use of OpenGuides.  If you have more than one
52OpenGuides installation, for example if you run guides for more than
53one city, each installation will need its own database.
54
55
56  "...the machine that the database is hosted on? (blank if local"
57
58If the database is running on a local machine with username/password
59authentication then just press RETURN to skip this question.  If it
60is running on a local machine with IDENT authentication then you may
61need to answer "localhost" to this question.  If it is running on a
62remote machine then enter the full hostname of that machine.
63
64
65  "What do you want the script to be called?"
66
67The default is for the main script to be called "wiki.cgi", but
68you may prefer to name it after your city - "leeds-guide.cgi" for
69example.  Note that your webserver may be configured to only allow
70execution of scripts ending in, for example, ".cgi"
71
72
73  "What directory should I install it in?"
74
75You need to pick a directory for the OpenGuides software to be
76installed in.  This must be one known to the webserver as containing
77CGI scripts.  You will need to have write permission on this directory
78when you come to run "perl Build install"; unless this is a private
79directory belonging to you then this might require an 'su' or 'sudo'
80to root under Unix.
81
82
83  "What directory should I install the templates in?"
84  "Where should I look for custom templates?"
85
86Normally these will be in the install directory, but they can be anywhere.
87Custom templates are intended to be user-modified, so you might want to
88put them somewhere in /etc.
89
90
91  "What URL does the install directory map to?"
92
93Give the full address needed to access the installation directory with
94a web browser - for example http://london.openguides.org/
95
96
97  "Do you want me to munge a custom lib path into the scripts?"
98
99If you have installed some or all of the required Perl modules (or indeed
100the OpenGuides modules themselves) into a private directory, you will
101need to tell the scripts where to find these modules.  Enter the paths
102to search here just as you would enter them in a 'use lib qw( ... );'
103in a Perl script.
104
105
106  "Do you want to use Plucene for searching?"
107
108This question is no longer asked, but documentation here is retained for
109the benefit of people upgrading.
110
111If you are changing to Plucene from Search::InvertedIndex, you will
112need to do two things:
113    - either delete your old indexes (they're just files in the index
114      directory) or use a different index directory
115    - reindex your entire wiki (see reindex.pl in the examples/
116      directory of this distribution)
117
118
119  "What directory can I use to store indexes in for searching?"
120
121You need a directory to store files used as indexes for the site. The
122user that your script will run as will need write permission on this
123directory.  Under some webserver configurations this might be a
124dedicated user - 'nobody' or 'www-data' for example, but for many
125multi-user systems this will just be yourself.
126
127
128  "Do you want to enable page deletion?"
129  "Please specify a password for the site admin."
130
131The default is to disable page deletion.  If you choose to enable the
132page deletion mechanism then you will need to add a password to your
133wiki.conf by answering the question above or manually using a line such as
134  admin_pass = putyourpasswordhere
135Users who know this password will be able to delete unwanted pages -
136along with all their history - from your wiki.
137*** USE WITH CAUTION.  DELETED PAGES CANNOT BE RECOVERED. ***
138
139
140  "What's the URL of the site's stylesheet?"
141
142Supplying an answer to this question is optional.  There are example
143stylesheets in the examples/ directory - note that these will not be
144automatically installed.
145
146
147  "What's the wiki called?"
148
149This is a title which will appear at the top of every page.  If you have
150more than one OpenGuides installation at the same site then each should
151have a unique name, since this name is used to manage user preferences.
152
153
154  "Do you want the navigation bar included on the home page?"
155
156Answer "y" or "n".
157
158
159  "Do you want the ten most recent changes included on the home page?"
160
161Answer "y" or "n".
162
163
164  "Do you want the Random Page link to avoid returning a locale page?
165  "Do you want the Random Page link to avoid returning a category page?
166
167Answer "y" or "n".  The defaults are "n", which means that Random Page is as
168likely to return a category or locale page as anything else.  If the category
169and locale pages on your Guide are generally just lists of things in that
170category/locale, you probably want to pick "y" here.  If, on the other hand,
171your category/locale pages generally have substantial content of their own,
172you may prefer to choose "n".
173
174
175  "Do you want the content to appear above the navbar in the HTML?"
176
177Answer "y" or "n".  The default is "n", for reasons of backwards
178compatibility with existing stylesheets, but the recommended answer is
179"y", as this will help search engines to find the most relevant parts
180of your pages.
181
182
183  "What should the home page of the wiki be called?"
184  "How would you describe the wiki?"
185
186Self-explanatory.
187
188
189  "What city is the wiki based in?"
190  "What country is the wiki based in?"
191
192If the wiki will not be city or country specific you can leave either or
193both of these blank.
194
195
196  "Contact email address for the wiki admin?"
197
198Self explanatory.
199
200
201  "What language will the site be in? (Please give an ISO language code.)"
202
203eg "en" for English, "it" for Italian.
204See http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
205
206
207  "What's the name of the node or page to use for the text formatting
208   rules link?"
209  "What URL do you want to use for the text formatting rules"
210
211From 0.19, OpenGuides allows users to choose whether or not to have a
212permanent link to the text formatting rules node or page in their navbar.
213You need to put the name of that node or URL in here for it to work, though.
214You might want to call the node "Text Formatting Examples",
215"Text Formatting Rules", "House Style" or whatever.
216
217Note that these the latter question will override the former, so if you
218want to use a local node make sure to leave the latter blank.
219
220  "Make node titles link to node backlinks (C2 style)?"
221
222This refers to turning titles into links which bring up a list of referring
223pages. This was the convention with older wikis ("C2" refers to the original
224wiki at http://c2.com/cgi/wiki), but is not intuitive.
225
226  "Do you have a Google Maps API key to use with this guide?"
227
228If you want Google Maps integration, you need to register with Google to get
229an API key. Visit http://www.google.com/apis/maps/signup.html and follow the
230instructions. Paste the great long string into the console window where you
231are installing. See README.GMAPS for more information.
232
233  "What is the longitude of the centre point of a map to draw for your guide?"
234  "What is the latitude of the centre point of a map to draw for your guide?"
235
236It's probably a good idea to pick some notionally central point for your
237guide. For example, Carfax for Oxford, Charing Cross for London. As a
238convenience, you may paste in a Google Maps URL for the centre longitude
239question and the (long,lat) will be parsed out from the URL.
240
241  "What default zoom level shall we use for Google Maps?"
242  "What default zoom level shall we use for Google Maps in the search results?"
243
244The defaults are probably appropriate in most cases.
245
246  "Would you like to display a Google Map on every node that has geodata?"
247
248Answer "y" or "n".  Note that an answer of "y" will only take effect if you've
249supplied a Google Maps API key above.  Note further that users can choose to
250turn this off in their preferences.
251 
252  "Forcibly treat stored lat/long data as if they used the WGS84 ellipsoid?"
253
254Default this answer if you don't know what it means.
255
256  "Do you have a Google Analytics key to use with this guide?"
257
258If you'd like to use Google Analytics to track the traffic on your guide,
259visit http://www.google.com/analytics/ to sign up for a key.  The answer to
260this question is the string in quotes in the HTML fragment they ask you to
261paste into your HTML, something along the lines of _uacct = "UA-1234567-1"
262- it's the UA-1234567-1 part that you need to put in here.  If you've
263forgotten your key, go to Analytics Settings, click "Edit" under Settings,
264then click "Check Status" in the top right-hand corner of the box with grey
265stripes.
266
267
268  "What licence will you use for the guide?"
269
270We strongly recommend that you think at the outset about the licence your
271guide will use, for maximum usefulness. In particular for a guide that will
272be on the OpenGuides network, we recommend the
273"Creative Commons Attribution-ShareAlike 2.5" licence.
274
275  "What is the URL to your licence?"
276
277If you used our recommendation above the URL you will want here is:
278http://creativecommons.org/licenses/by-sa/2.5/
279
280  "What is the URL to your local page about your licensing policy?"
281
282You should probably include a page on your wiki about your local licensing
283policy, but you can leave this blank for now if you don't have one yet.
284
285  "What module would you like to use for spam detection? (optional)"
286
287The module you choose should have a method called "looks_like_spam", which
288accepts a hash with content and metadata as keys, and returns true or false
289to the question of whether the edit should be considered to be spam.
290
291  "What directory should we install static content (CSS, images, javascript)
292   to?"
293
294OpenGuides comes with some static content which will be installed
295automatically.
296
297  "What is the URL corresponding to the static content?"
298
299You will need to configure the above directory in your web server, then
300input the URL the content will be visible at here.
301
302  "Should we send email notifications when a moderated node is edited?"
303
304For spam avoidance, you can configure certain nodes to require moderation.
305To ensure that such edits are noticed, OpenGuides can email you.
306
307  "Distance calculation methods available are:
308      1) British National Grid
309      2) Irish National Grid
310      3) UTM ellipsoid
311   Which would you like to use?"
312
313  (and if you choose UTM ellipsoid)
314  "Which ellipsoid would you like to use? (eg 'Airy', 'WGS-84')"
315
316See http://www.vterrain.org/Projections/ for how this all works.
317A UTM (Universal Transverse Mercator) ellipsoid maps latitude and
318longitude to eastings and northings on a square grid, which allows
319more accurate distance calculations within the guide.  The British and
320Irish National Grids are scaled and parametrised versions of UTM
321ellipsoids (Airy 1830 in the British case, Modified Airy in the Irish).
322
323Please note that at the moment there is no provision for changing your
324mind later about which ellipsoid to use, but it shouldn't be too hard
325to write a conversion script so don't worry too much about picking the
326wrong one.  However do note that once you've entered some location
327data you should not change this value in the config file without running
328some kind of converter.
329
330If you decide to use the British or Irish National Grid, your users
331will be able to choose between entering location data as lat/long
332or as grid co-ordinates.
333
334You must have Geography::NationalGrid::GB installed to use the British
335National Grid, Geography::NationalGrid::IE to use the Irish National
336Grid, and Geo::Coordinates::UTM to use a UTM ellipsoid.
337
338If you want to use a UTM ellipsoid, WGS-84 is the best choice, as it
339will allow you to use the Google Maps support with the minimum of fuss.
340
341* Dependency errors
342
343If, after you have answered these questions, the build script complains
344about missing dependencies, don't panic! Simply install them from CPAN and
345then try again. Note that a wiki.conf file will have been written out at
346this point, so if you retain it you won't have to answer all the questions
347again.
348
349* Custom templates and CSS
350
351Once you have installed OpenGuides you may wish to edit templates that
352provide site-specific design. These templates are stored in the directory
353custom-templates/ by default and are described in the file CUSTOMISATION.
354
355The id and class tags used for the CSS in OpenGuides are specified in
356README.CSS.
357
358* Security
359
360The installer will try to create (or modify an existing) a .htaccess file
361to protect wiki.conf, which contains sensitive data (ie passwords).
362However we cannot tell whether apache (or any other web server you may be
363using) is using this file, so you should check that it functioning and that
364you cannot access wiki.conf over HTTP.
365
366You should also configure wiki.conf with the minimum permissions required
367so that local users cannot read the file. This is difficult to automate,
368but the file should be probably be mode 0640, owned by root or an admin
369user, and set to the group the web server runs with.
370
371* Web server configuration
372
373In order to let your web server serve up OpenGuides correctly, you will
374have to tell it to recognise your installation directory as one
375containing CGI scripts. However you can make your URLs nicer by
376employing mod_rewrite as well. The following Apache configuration
377directives show how:
378
379        Alias /myguide /usr/lib/cgi-bin/myguide
380        <Directory /usr/lib/cgi-bin/myguide>
381            Options FollowSymLinks Indexes ExecCGI
382            RewriteEngine on
383            RewriteBase /myguide/
384            RewriteRule ^$      wiki.cgi        [L]
385        </Directory>
386        Redirect /cgi-bin/myguide/ http://www.example.com/myguide/
387
388You will of course need to make the appropriate substitutions for
389your site. You also need to make sure that mod_rewrite is enabled in
390your web server before adding such a configuration. The final step in
391this URL tidying is to tell OpenGuides that the main CGI script can be
392assumed to be called from the root of the install directory; do this by
393setting the script name to be empty in wiki.conf:
394
395        # what do you want the script to be called?
396        script_name =
397
398Currently the Build script does not support this value, so you will
399have to make sure that you fix this up after an upgrade.
400
401* Custom install locations
402
403If you wish to install the OpenGuides modules in a private directory,
404you will need to specify this when you run the Build.PL.
405
406If you are using version 0.20 or newer of Module::Build, do:
407
408  perl Build.PL install_path=lib=/path/to/my/modules/ \
409                install_path=script=/path/to/my/bin/ \
410        install_path=arch=/path/to/my/modules/auto/ \
411                install_path=libdoc=/path/to/my/man/ \
412                install_path=bindoc=/path/to/my/man/
413
414Or for earlier versions of Module::Build, do:
415
416  perl Build.PL config='sitelib=/path/to/my/modules/'
417
418If any or all of the modules required by the OpenGuides scripts are in
419a private directory, then you'll need to tell the scripts where to find
420them. See the section above about munging in a custom lib path.
421
422----------------------------------------------------------------------
423
424Important note for those using SQLite:
425
426The user your CGI is running as must have write access to not only the
427database file itself, but the directory that the file is in, in order
428that it can write a lockfile. If it doesn't have write access to the
429database file, you'll see errors like "Unhandled error: [DBD::SQLite::db
430do failed...".
431
432----------------------------------------------------------------------
433
434* Multiple installations
435
436If you want to run multiple OpenGuides sites on one machine, you can use
437some tricks to make life easier. This isn't currently part of the official
438install routine, but will generally work. In the rest of this section we
439will assume that you already have a working OpenGuides install for a
440single site.
441
442Make a directory for the new site, and populate it with a set of symlinks
443to the main installation directory (ie. for wiki.cgi, supersearch.cgi,
444newpage.cgi, preferences.cgi, and the templates directory). wiki.conf
445will not be a symlink, since this will differ from the original site.
446In this case, simply copy the wiki.conf from the original install and
447modify it in the obvious way; most importantly, by giving it a different
448database name (we'll create the database in a moment). Don't forget to
449set up a separate directory for indices for the new site.
450
451Normally, the database is created by the installation process described
452above; however since we only want one copy of the modules and CGI
453programs, it isn't appropriate to run them again. So we will make use of
454the utility program "cgi-wiki-setupdb" which is included with the
455Wiki::Toolkit distribution. Documentation for this command can be found in
456its man page; run this with the appropriate arguments to create the
457new database.
458
459Once the key step of setting up the database has been performed, and the
460web server configured appropriately, the new site should be ready to go!
Note: See TracBrowser for help on using the repository browser.