| 1 | OpenGuides installation instructions |
|---|
| 2 | ==================================== |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | If while following the instructions below or while trying to use your |
|---|
| 6 | OpenGuides install you see an error that you don't understand, please |
|---|
| 7 | consult the TROUBLESHOOTING file. |
|---|
| 8 | |
|---|
| 9 | For details about installing multiple OpenGuides sites on a single |
|---|
| 10 | server, see further down this file. |
|---|
| 11 | |
|---|
| 12 | * Basic installation |
|---|
| 13 | |
|---|
| 14 | Unpack the distribution (using for example 'tar' or 'WinZip'), and set |
|---|
| 15 | your working directory to be the top level of the distribution. |
|---|
| 16 | |
|---|
| 17 | If you have an existing "wiki.conf" configuration file and you wish |
|---|
| 18 | to keep using the values in that, copy it to this directory. |
|---|
| 19 | |
|---|
| 20 | Now execute the following commands: |
|---|
| 21 | |
|---|
| 22 | perl Build.PL |
|---|
| 23 | perl Build |
|---|
| 24 | perl Build test |
|---|
| 25 | perl Build install |
|---|
| 26 | |
|---|
| 27 | The very first of these commands asks a number of questions regarding |
|---|
| 28 | the installation. |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | "Skip OpenGuides configuration?" |
|---|
| 32 | |
|---|
| 33 | Answer "n" to this question unless you really know what you're doing. |
|---|
| 34 | It's mainly there for developers. |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | "What type of database do you want the site to run on?" |
|---|
| 38 | |
|---|
| 39 | Answer "postgres", "mysql", or "sqlite". |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | "What's the name of the database that this site runs on?" |
|---|
| 43 | "...the database user that can access that database?" |
|---|
| 44 | "...the password that they use to access the database?" |
|---|
| 45 | |
|---|
| 46 | You should create (or ask your ISP/sysadmin to create) a database |
|---|
| 47 | specifically for the use of OpenGuides. If you have more than one |
|---|
| 48 | OpenGuides installation, for example if you run guides for more than |
|---|
| 49 | one city, each installation will need its own database. |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | "...the machine that the database is hosted on? (blank if local" |
|---|
| 53 | |
|---|
| 54 | If the database is running on a local machine with username/password |
|---|
| 55 | authentication then just press RETURN to skip this question. If it |
|---|
| 56 | is running on a local machine with IDENT authentication then you may |
|---|
| 57 | need to answer "localhost" to this question. If it is running on a |
|---|
| 58 | remote machine then enter the full hostname of that machine. |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | "What do you want the script to be called?" |
|---|
| 62 | |
|---|
| 63 | The default is for the main script to be called "wiki.cgi", but |
|---|
| 64 | you may prefer to name it after your city - "leeds-guide.cgi" for |
|---|
| 65 | example. Note that your webserver may be configured to only allow |
|---|
| 66 | execution of scripts ending in, for example, ".cgi" |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | "What directory should I install it in?" |
|---|
| 70 | |
|---|
| 71 | You need to pick a directory for the OpenGuides software to be |
|---|
| 72 | installed in. This must be one known to the webserver as containing |
|---|
| 73 | CGI scripts. You will need to have write permission on this directory |
|---|
| 74 | when you come to run "perl Build install"; unless this is a private |
|---|
| 75 | directory belonging to you then this might require an 'su' or 'sudo' |
|---|
| 76 | to root under Unix. |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | "What directory should I install the templates in?" |
|---|
| 80 | "Where should I look for custom templates?" |
|---|
| 81 | |
|---|
| 82 | Normally these will be in the install directory, but they can be anywhere. |
|---|
| 83 | Custom templates are intended to be user-modified, so you might want to |
|---|
| 84 | put them somewhere in /etc. |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | "What URL does the install directory map to?" |
|---|
| 88 | |
|---|
| 89 | Give the full address needed to access the installation directory with |
|---|
| 90 | a web browser - for example http://london.openguides.org/cgi-bin/ |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | "Do you want me to munge a custom lib path into the scripts?" |
|---|
| 94 | |
|---|
| 95 | If you have installed some or all of the required Perl modules (or indeed |
|---|
| 96 | the OpenGuides modules themselves) into a private directory, you will |
|---|
| 97 | need to tell the scripts where to find these modules. Enter the paths |
|---|
| 98 | to search here just as you would enter them in a 'use lib qw( ... );' |
|---|
| 99 | in a Perl script. |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | "Do you want to use Plucene for searching?" |
|---|
| 103 | |
|---|
| 104 | From version 0.39 of OpenGuides, you have the option of using Plucene |
|---|
| 105 | to index your wiki instead of Search::InvertedIndex. If you answer |
|---|
| 106 | yes to this question, you will need to make sure you have installed |
|---|
| 107 | both Plucene, and CGI::Wiki version 0.56 or later. |
|---|
| 108 | |
|---|
| 109 | If you are changing to Plucene from Search::InvertedIndex, you will |
|---|
| 110 | need to do two things: |
|---|
| 111 | - either delete your old indexes (they're just files in the index |
|---|
| 112 | directory) or use a different index directory |
|---|
| 113 | - reindex your entire wiki (see reindex.pl in the examples/ |
|---|
| 114 | directory of this distribution) |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | "What directory can I use to store indexes in for searching?" |
|---|
| 118 | |
|---|
| 119 | You need a directory to store files used as indexes for the site. The |
|---|
| 120 | user that your script will run as will need write permission on this |
|---|
| 121 | directory. Under some webserver configurations this might be a |
|---|
| 122 | dedicated user - 'nobody' or 'www-data' for example, but for many |
|---|
| 123 | multi-user systems this will just be yourself. |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | "Do you want to enable page deletion?" |
|---|
| 127 | "Please specify a password for the site admin." |
|---|
| 128 | |
|---|
| 129 | The default is to disable page deletion. If you choose to enable the |
|---|
| 130 | page deletion mechanism then you will need to add a password to your |
|---|
| 131 | wiki.conf by answering the question above or manually using a line such as |
|---|
| 132 | admin_pass = putyourpasswordhere |
|---|
| 133 | Users who know this password will be able to delete unwanted pages - |
|---|
| 134 | along with all their history - from your wiki. |
|---|
| 135 | *** USE WITH CAUTION. DELETED PAGES CANNOT BE RECOVERED. *** |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | "What's the URL of the site's stylesheet?" |
|---|
| 139 | |
|---|
| 140 | Supplying an answer to this question is optional. There are example |
|---|
| 141 | stylesheets in the examples/ directory - note that these will not be |
|---|
| 142 | automatically installed. |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | "What's the wiki called?" |
|---|
| 146 | |
|---|
| 147 | This is a title which will appear at the top of every page. If you have |
|---|
| 148 | more than one OpenGuides installation at the same site then each should |
|---|
| 149 | have a unique name, since this name is used to manage user preferences. |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | "Do you want the navigation bar included on the home page?" |
|---|
| 153 | |
|---|
| 154 | Answer "y" or "n". |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | "What should the home page of the wiki be called?" |
|---|
| 158 | "How would you describe the wiki?" |
|---|
| 159 | |
|---|
| 160 | Self-explanatory. |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | "What city is the wiki based in?" |
|---|
| 164 | "What country is the wiki based in?" |
|---|
| 165 | |
|---|
| 166 | If the wiki will not be city or country specific you can leave either or |
|---|
| 167 | both of these blank. |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | "Contact email address for the wiki admin?" |
|---|
| 171 | |
|---|
| 172 | Self explanatory. |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | "What language will the site be in? (Please give an ISO language code.)" |
|---|
| 176 | |
|---|
| 177 | eg "en" for English, "it" for Italian. |
|---|
| 178 | See http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | "What's the name of the node or page to use for the text formatting |
|---|
| 182 | rules link?" |
|---|
| 183 | "What URL do you want to use for the text formatting rules" |
|---|
| 184 | |
|---|
| 185 | From 0.19, OpenGuides allows users to choose whether or not to have a |
|---|
| 186 | permanent link to the text formatting rules node or page in their navbar. |
|---|
| 187 | You need to put the name of that node or URL in here for it to work, though. |
|---|
| 188 | You might want to call the node "Text Formatting Examples", |
|---|
| 189 | "Text Formatting Rules", "House Style" or whatever. |
|---|
| 190 | |
|---|
| 191 | Note that these the latter question will override the former, so if you |
|---|
| 192 | want to use a local node make sure to leave the latter blank. |
|---|
| 193 | |
|---|
| 194 | "Make node titles link to node backlinks (C2 style)?" |
|---|
| 195 | |
|---|
| 196 | This refers to turning titles into links which bring up a list of referring |
|---|
| 197 | pages. This was the convention with older wikis, but is not intuitive. |
|---|
| 198 | |
|---|
| 199 | "Do you have a Google Maps API key to use with this guide?" |
|---|
| 200 | |
|---|
| 201 | If you want Google Maps integration, you need to register with Google to get |
|---|
| 202 | an API key. Visit http://www.google.com/apis/maps/signup.html and follow the |
|---|
| 203 | instructions. Paste the great long string into the console window where you |
|---|
| 204 | are installing. See README.GMAPS for more information. |
|---|
| 205 | |
|---|
| 206 | "What is the longitude of the centre point of a map to draw for your guide?" |
|---|
| 207 | "What is the latitude of the centre point of a map to draw for your guide?" |
|---|
| 208 | |
|---|
| 209 | It's probably a good idea to pick some notionally central point for your |
|---|
| 210 | guide. For example, Carfax for Oxford, Charing Cross for London. |
|---|
| 211 | |
|---|
| 212 | "What default zoom level shall we use for Google Maps?" |
|---|
| 213 | "What default zoom level shall we use for Google Maps in the search results?" |
|---|
| 214 | |
|---|
| 215 | The defaults are probably appropriate in most cases. |
|---|
| 216 | |
|---|
| 217 | "Forcibly treat stored lat/long data as if they used the WGS84 ellipsoid?" |
|---|
| 218 | |
|---|
| 219 | Default this answer if you don't know what it means. |
|---|
| 220 | |
|---|
| 221 | "Distance calculation methods available are: |
|---|
| 222 | 1) British National Grid |
|---|
| 223 | 2) Irish National Grid |
|---|
| 224 | 3) UTM ellipsoid |
|---|
| 225 | Which would you like to use?" |
|---|
| 226 | |
|---|
| 227 | (and if you choose UTM ellipsoid) |
|---|
| 228 | "Which ellipsoid would you like to use? (eg 'Airy', 'WGS-84')" |
|---|
| 229 | |
|---|
| 230 | See http://www.vterrain.org/Projections/ for how this all works. |
|---|
| 231 | A UTM (Universal Transverse Mercator) ellipsoid maps latitude and |
|---|
| 232 | longitude to eastings and northings on a square grid, which allows |
|---|
| 233 | more accurate distance calculations within the guide. The British and |
|---|
| 234 | Irish National Grids are scaled and parametrised versions of UTM |
|---|
| 235 | ellipsoids (Airy 1830 in the British case, Modified Airy in the Irish). |
|---|
| 236 | |
|---|
| 237 | Please note that at the moment there is no provision for changing your |
|---|
| 238 | mind later about which ellipsoid to use, but it shouldn't be too hard |
|---|
| 239 | to write a conversion script so don't worry too much about picking the |
|---|
| 240 | wrong one. However do note that once you've entered some location |
|---|
| 241 | data you should not change this value in the config file without running |
|---|
| 242 | some kind of converter. |
|---|
| 243 | |
|---|
| 244 | If you decide to use the British or Irish National Grid, your users |
|---|
| 245 | will be able to choose between entering location data as lat/long |
|---|
| 246 | or as grid co-ordinates. |
|---|
| 247 | |
|---|
| 248 | You must have Geography::NationalGrid::GB installed to use the British |
|---|
| 249 | National Grid, Geography::NationalGrid::IE to use the Irish National |
|---|
| 250 | Grid, and Geo::Coordinates::UTM to use a UTM ellipsoid. |
|---|
| 251 | |
|---|
| 252 | If you want to use a UTM ellipsoid, WGS-84 is the best choice, as it |
|---|
| 253 | will allow you to use the Google Maps support with the minimum of fuss. |
|---|
| 254 | |
|---|
| 255 | * Dependency errors |
|---|
| 256 | |
|---|
| 257 | If, after you have answered these questions, the build script complains |
|---|
| 258 | about missing dependencies, don't panic! Simply install them from CPAN and |
|---|
| 259 | then try again. Note that a wiki.conf file will have been written out at |
|---|
| 260 | this point, so if you retain it you won't have to answer all the questions |
|---|
| 261 | again. |
|---|
| 262 | |
|---|
| 263 | * Custom templates and CSS |
|---|
| 264 | |
|---|
| 265 | Once you have installed OpenGuides you may wish to edit templates that |
|---|
| 266 | provide site-specific design. These templates are stored in the directory |
|---|
| 267 | custom-templates/ by default and are described in the file CUSTOMISATION. |
|---|
| 268 | The id and class tags used for the CSS in OpenGuides are specified in |
|---|
| 269 | README.CSS. |
|---|
| 270 | |
|---|
| 271 | * Security |
|---|
| 272 | |
|---|
| 273 | The installer will try to create (or modify an existing) a .htaccess file |
|---|
| 274 | to protect wiki.conf, which contains sensitive data (ie passwords). |
|---|
| 275 | However we cannot tell whether apache (or any other web server you may be |
|---|
| 276 | using) is using this file, so you should check that it functioning and that |
|---|
| 277 | you cannot access wiki.conf over HTTP. |
|---|
| 278 | |
|---|
| 279 | You should also configure wiki.conf with the minimum permissions required |
|---|
| 280 | so that local users cannot read the file. This is difficult to automate, |
|---|
| 281 | but the file should be probably be mode 0640, owned by root or an admin |
|---|
| 282 | user, and set to the group the web server runs with. |
|---|
| 283 | |
|---|
| 284 | * Web server configuration |
|---|
| 285 | |
|---|
| 286 | In order to let your web server serve up OpenGuides correctly, you will |
|---|
| 287 | have to tell it to recognise your installation directory as one |
|---|
| 288 | containing CGI scripts. However you can make your URLs nicer by |
|---|
| 289 | employing mod_rewrite as well. The following Apache configuration |
|---|
| 290 | directives show how: |
|---|
| 291 | |
|---|
| 292 | Alias /myguide /usr/lib/cgi-bin/myguide |
|---|
| 293 | <Directory /usr/lib/cgi-bin/myguide> |
|---|
| 294 | Options FollowSymLinks Indexes ExecCGI |
|---|
| 295 | RewriteEngine on |
|---|
| 296 | RewriteBase /myguide/ |
|---|
| 297 | RewriteRule ^$ wiki.cgi [L] |
|---|
| 298 | </Directory> |
|---|
| 299 | Redirect /cgi-bin/myguide/ http://www.example.com/myguide/ |
|---|
| 300 | |
|---|
| 301 | You will of course need to make the appropriate substitutions for |
|---|
| 302 | your site. You also need to make sure that mod_rewrite is enabled in |
|---|
| 303 | your web server before adding such a configuration. The final step in |
|---|
| 304 | this URL tidying is to tell OpenGuides that the main CGI script can be |
|---|
| 305 | assumed to be called from the root of the install directory; do this by |
|---|
| 306 | setting the script name to be empty in wiki.conf: |
|---|
| 307 | |
|---|
| 308 | # what do you want the script to be called? |
|---|
| 309 | script_name = |
|---|
| 310 | |
|---|
| 311 | Currently the Build script does not support this value, so you will |
|---|
| 312 | have to make sure that you fix this up after an upgrade. |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | * Multiple installations |
|---|
| 316 | |
|---|
| 317 | If you want to run multiple OpenGuides sites on one machine, you can use |
|---|
| 318 | some tricks to make life easier. This isn't currently part of the official |
|---|
| 319 | install routine, but will generally work. In the rest of this section we |
|---|
| 320 | will assume that you already have a working OpenGuides install for a |
|---|
| 321 | single site. |
|---|
| 322 | |
|---|
| 323 | Make a directory for the new site, and populate it with a set of symlinks |
|---|
| 324 | to the main installation directory (ie. for wiki.cgi, supersearch.cgi, |
|---|
| 325 | newpage.cgi, preferences.cgi, and the templates directory). wiki.conf |
|---|
| 326 | will not be a symlink, since this will differ from the original site. |
|---|
| 327 | In this case, simply copy the wiki.conf from the original install and |
|---|
| 328 | modify it in the obvious way; most importantly, by giving it a different |
|---|
| 329 | database name (we'll create the database in a moment). Don't forget to |
|---|
| 330 | set up a separate directory for indices for the new site. |
|---|
| 331 | |
|---|
| 332 | Normally, the database is created by the installation process described |
|---|
| 333 | above; however since we only want one copy of the modules and CGI |
|---|
| 334 | programs, it isn't appropriate to run them again. So we will make use of |
|---|
| 335 | the utility program "cgi-wiki-setupdb" which is included with the |
|---|
| 336 | CGI::Wiki distribution. Documentation for this command can be found in |
|---|
| 337 | its man page; run this with the appropriate arguments to create the |
|---|
| 338 | new database. |
|---|
| 339 | |
|---|
| 340 | Once the key step of setting up the database has been performed, and the |
|---|
| 341 | web server configured appropriately, the new site should be ready to go! |
|---|