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