3 BSE installation guide.
7 Note: The installation process below is badly out of date.
9 =head1 SYSTEM REQUIREMENTS
33 with telnet or ssh access
37 that runs your CGI scripts as your user
41 that runs your CGI scripts with the current working directory
42 set to the directory that contains the CGI script.
48 You will need at least the following Perl modules installed:
70 Storable (and this requires Log::Agent sometimes)
102 and their dependants. If you use the CPAN shell to install these then
103 the dependants will be installed automatically.
105 All other modules are either supplied or standard with perl.
107 I assume you know how to use a text editor, and have a basic knowledge
108 of how directories work, and know enough perl to be able to edit
111 If you want to use the SecurePayXML payment module you will also need:
137 Imager - thumbnail displays - B<strongly recommended>
141 FLV::Info - parsing metadata from uploaded FLV video.
145 Net::Amazon::S3 - for maintaining content on the Amazon S3 CDN.
149 Captcha::reCAPTCHA - for displaying CAPTCHA's from Google reCAPTCHA.
153 CSS::Inliner - this is strongly desirable if you need the system to
154 send email to the general public.
166 the layout of directories on your web host: where CGI programs go
167 (cgi-bin), where's the root of the document tree (htdocs), and where
168 can you safely keep static data (datapath). The names in parentheses
169 () will be used in this documentation.
173 how you want your site to look, presumably as one or more HTML files
174 and associated style sheets.
178 order processing information: the email address and public key of
179 the user who will be receiving the order emails. The email address
180 and private key of the sender of the order emails (though this can be
181 generated during installation.
187 Telnet or ssh to the web host.
189 Extract the archive into a working directory:
193 tar xzf workpath/bse-0.04.tar.gz
195 The directories in the archive are:
198 bse/schema Database schema definitions (and some test data)
199 bse/site Laid out site
200 bse/site/htdocs Document root
201 bse/site/cgi-bin CGI programs
202 bse/site/templates Sample page templates
203 bse/site/data Static site data (currently just the stopwords list)
204 bse/site/docs Documentation
205 bse/site/util Utilities
207 If you are running your own host, or have sufficient control over
208 Apache, you may want to extract the archive in it's final directory
209 and simply create a new <VirtualHost..> that uses the extracted
210 directories. If so, skip Copy Files.
215 Replacing the names as decribed in L<PLANNING>
219 cp -R workpath/site/htdocs htdocs/
220 # page templates (you will need to modify these) and static data
221 mkdir datadir/templates
222 cp -R workpath/site/templates datadir/templates/
223 cp -R workpath/site/data datadir/
225 cp -R workpath/site/cgi-bin cgi-bin/
230 Most configuration information is kept in Constants.pm, which is in
231 the cgi-bin/modules directory:
233 vi cgi-bin/modules/Constants.pm
237 $DB should be the name of your mysql database.
239 $UN and $PW should be your mysql login name and password.
241 =head2 Directory structure
243 If your directory structure matches that of the archive, this is
244 simple, set $BASEDIR to point to the site directory. The other
245 variables are set based on that layout.
253 to the directory you are keeping document templates in,
254 'datapath/templates/' if you followed L<COPY FILES>
258 to the directory you are keeping the site document files in, 'htdocs/'
259 if you followed L<COPY FILES>.
263 to the directory that image files are kept in. This should be left as
264 $CONTENTBASE . 'images/'
268 to the directory containing F<stopwords.txt>
272 B<Warning:> these paths I<must> be kept as absolute directories. They
273 must the directories as seen by the running CGI scripts.
278 You should set $URLBASE and $SECURLBASE to the URLs used to access
279 your site in normal and SSL (https). If you currently don't have secure access setup, you can use the same non-secure URL for both.
281 B<Warning:> You I<must> set the $SECURLBASE to a secure URL and
282 regenerate the site before accepting orders on the site.
284 =head2 Level defaults
286 This is probably the most complex item to configure.
288 The %LEVEL_DEFAULTS hash describes how your site will look from the
289 administration interface. It has little effect on how the site looks
290 from a user's perspective, except of course, that it sets defaults for
293 Each level of your site needs an entry in the hash, with the top level
294 being 0 to indicate the whole site. This top-level should only have
295 the C<display> keyword defined.
297 Each level except for level 0 should have the following keywords defined:
303 C<display> defines how the articles at this level is described when
308 C<template> is the default template name used for that level. It
309 should exist in the levels directory under your template directory.
313 C<threshold> is the default threshold used when a new article is
314 created at that level. Thresholds are used to control whether child
315 article are rendered inline, or as summaries.
321 If you set $LINK_TITLES to non-zero, then the links created for the
322 C<article link> and C<url article> tags will include the title as a
323 translated suffix. This allows some search engines to index on the
324 URL as well as the content of the document. Without this suffix the
325 url contains no useful indexable information.
327 For this to work under Apache you will need the following in a
328 .htaccess file in the htdocs/a directory:
331 RewriteRule ^([0-9]+\.html)/[0-9a-zA-Z_]*$ ./$1 [T=text/html]
333 =head2 Search options
335 In geneal the search engine will generate a search index for all
336 listed articles, and exclude unlisted articles.
338 You have some control over the indexing. Set @SEARCH_INCLUDE to the
339 ids of sections that should be indexed, even if not listed. Set
340 @SEARCH_EXCLUDE to the ids of sections that should not be indexed.
342 @SEARCH_EXCLUDE overrides @SEARCH_INCLUDE.
344 Set $SEARCH_LEVEL to the lowest-level (highest number) of the articles
345 to be indexed. Lower level articles will still be indexed, but
346 searches for them will find their parent article (or I<their> parent
347 article, if it still isn't a low enough level.)
349 $SEARCH_ALL is used as the name of the entry in the drop-down list of
350 sections generated by the <:list:> tag on the search template.
352 =head2 Deletion control
354 Some articles are critical to the operation of your site. If the
355 article's id is in @NO_DELETE it cannot be deleted.
359 This is probably the second hardest item to configure.
361 It isn't necessary to configure this section until you need to use the
364 $SHOP_CRYPTO should be set to the supplied class that uses your
365 installed encryption software. Note that currently only Squirrel::GPG
366 has been tested in production. (Patches welcome on the other modules.)
368 $SHOP_SIGNING_ID should be the user id of the key to use for signing
371 $SHOP_GPG, $SHOP_PGPE and $SHOP_PGP are the locations of the specified
372 executables, for GunPG, PGP5 and PGP6 respectively. They only need to
373 be set if the executable isn't in the PATH when the shop.pl runs.
375 $SHOP_SENDMAIL needs to be set to the name of sendmail or a compatible
378 $SHOP_FROM will be used as the sender of the order emails.
380 Processed, encrypted orders will be $SHOP_TO_NAME and $SHOP_TO_EMAIL.
381 There must be a public key in the keyring, which has been signed by
382 the private key $SHOP_SIGNING_ID (or whatever your default private
385 You can set $SHOP_EMAIL_ORDER to 0 to prevent the order being emailed
386 as above. A confirmation email is still sent to the person who made
387 the order. This is only really for testing, since only the encrypted
388 email contains the credit card number and expiry date.
390 =head2 Maintenance Tools
392 $DATA_EMAIL is the email address of a person that the
393 I<Dump database to email> page will send the MySQL database dump to.
395 $MYSQLDUMP is the location of the MySQL C<mysqldump> tool. If this
396 isn't in the PATH you will need to add this here.
398 =head1 DATABASE SETUP
402 You need to install the database schema. Presumably you have already
403 created a user and database for the new site (or your host has.)
405 To install the schema and the base data:
407 mysql -u youruserl -p yourdatabase <bse.sql
409 You will be asked for your password.
411 =head2 Base data load
413 Change directory to the util directory in your workpath.
415 If you moved the files you will need to edit initial.pl to change the line:
417 use lib '../cgi-bin/modules';
419 so that it will specify the correct modules directory.
421 You may want to simply set PERL5LIB to your new modules director instead:
423 PERL5LIB=cgi-bin/modules
426 Once you've done that, you can run initial.pl:
430 B<Warning:> Do not run this after your site is up and has articles you
431 want to keep. This will delete all existing articles from your site.
434 =head1 TEMPLATE SETUP
436 See the site/docs/templates.pod (or .html).
441 Since your web host runs your CGI programs as you, you can make
442 Constants.pm readble only by you.
444 You will need to protect the htdocs/admin and cgi-bin/admin
445 directories with .htaccess files. For example:
448 AuthName "Administrator Only"
449 AuthUserFile "somepath/users.dat"
452 The AuthUserFile needs to point to a file accessible by the user that
453 the web server runs as. So it won't work if you use your home