1 [mharc Top] mharc Installation
3 This document describes how to install and configure mharc on your system.
4 You should read this document in its entirety before performing any of the
7 NOTE: If performing an upgrade, make sure to read the NEWS document for any
8 important release notes.
23 * Defining your crontab
24 * Web Server Configuration
25 * Maintenance Operations
26 * Archive Customizations
27 * Applying Software Updates
29 * Managing List Administration Messages
31 + mharc-based Solution
34 ---------------------------------------------------------------------------
38 If you have problems installing mharc, a mailing list exists that provides
39 a forum for help and general discussions. Information about the list, and
40 how to subscribe, is provided in Contacts.
42 If you want professional help to setup your list archives, please send a
43 message to mhonarc@mhonarc.org with your request.
45 ---------------------------------------------------------------------------
49 Shell examples are rendered as follows:
51 +-------------------------------------------------------------------------+
53 |bin/ etc/ images/ log/ msgid.cache README |
54 |cgi-bin/ .htaccess@ info/ Makefile NEWS TODO |
55 |COPYING html/ lib/ mbox/ procmailrc.mharc VERSION |
56 +-------------------------------------------------------------------------+
58 The text prompt> represents your shell prompt. Text you would type into the
59 shell is rendered like this: text you enter. Any other text is example
60 output generated by the computer.
62 ---------------------------------------------------------------------------
66 This document's intended audience is people familiar with working in
67 Unix-type environments. The following prerequisite knowledge is beneficial:
69 * Know how to start and use a command-line shell.
71 * Experienced using any one of the myriad of text editors available on
72 your system. Vi and emacs are the most common, but some of the GUI
73 environments provide additional text editors.
75 * Familiar with cron: a daemon to execute scheduled commands. You should
76 know how to register crontab entries. If you are not familar with cron,
77 see the crontab(1) and crontab(5) manpages.
79 ---------------------------------------------------------------------------
83 The typical usage model for mharc is to have a special user account to
84 perform all mharc-related duties. The account is subscribed to all mailing
85 lists you want archived. For example, say the account you use is mailarch
86 and the mail address for the account is mailarch@example.com. For each list
87 you archive, the address mailarch@example.com must be subscribed to each
90 This usage model allows mharc to be independent of the mailing list
91 management software. If changes are made to list management software, mharc
92 is unaffected. The model also allows a division of labor on who manages the
93 lists and who manages the archives.
95 NOTE: Tips on how to handle list administration messages, like subscribe
96 confirmations, are provided in Managing List Administration Messages
98 This document assumes this type of usage model. However, due to the
99 configurable nature of mharc, alternate usage models are possible.
101 ---------------------------------------------------------------------------
107 mharc runs on any Unix-like operating system. If using a Win32 system, you
108 will may need to install Cygwin or equivalent software package providing
113 mharc requires the following software:
116 <http://www.mhonarc.org/>:
118 MHonArc converts messages into HTML and provides the periodic date and
119 thread indexes. It also allows customization of archive page layout.
120 v2.5.12, or later, is recommended.
123 <http://www.procmail.org/>:
125 Procmail pre-filters incoming mail into the raw mail archives. Note:
126 The programs formail and lockfile are needed and they are part of the
127 standard Procmail distribution, but some Unix distributions may include
128 these programs in separate packages.
131 <http://www.namazu.org/>:
133 Namazu provides searching. mharc takes advantage of Namazu's awareness
134 of MHonArc message pages to provide useful archive navigational aids.
135 Note: The program namazu.cgi is needed and is part of the standard
136 Namazu distribution, but some Unix distribtions may include it in a
140 <http://www.perl.com/>:
142 mharc scripts are written in Perl.
146 The make program is not strictly required, but the master Makefile
147 provides a convenient interface to invoking mharc scripts. GNU make is
148 recommended (and is sometimes installed as gmake), but other variations
149 should work. make is generally provided on all Unix-like distributions.
151 NOTE: The install.pl installation script checks for programs required by
152 mharc. If it cannot locate a program, it generates a warning message.
154 If you cannot locate any of the above programs or are not sure what is
155 installed on your system, contact your system administrator (and while your
156 at it, you may want to ask your sys admin to install mharc for you :-).
158 ---------------------------------------------------------------------------
162 NOTE: You should be logged into the archive account when installing mharc.
164 Extract the tar bundle into any temporary location to start the
165 installation process. The following command extracts the tar.gz
168 +-------------------------------------------------------------------------+
169 |prompt> gzip -dc mharc-X.X.X | tar xvf - |
171 |mharc-X.X.X/README |
172 |mharc-X.X.X/INSTALL |
174 |mharc-X.X.X/COPYING |
176 |mharc-X.X.X/install.pl |
179 |...[file list snipped for brevity]... |
181 +-------------------------------------------------------------------------+
183 where X.X.X represents the version number of mharc you are extracting.
185 CAUTION: Do not not use mharc under a priviledged user account, like root,
186 since it may open up security vulnerabilities.
188 ---------------------------------------------------------------------------
192 After you extract the tar bundle, execute the following commands to run the
193 mharc installation script:
195 +-------------------------------------------------------------------------+
196 |prompt> cd mharc-X.X.X |
197 |prompt> perl install.pl |
198 +-------------------------------------------------------------------------+
200 The install.pl program will perform some system checks and prompt you for
201 an installation location. If performing a new install, install.pl prompts
202 you for some initial configuration information. The following is an example
203 session of a new install:
205 +-------------------------------------------------------------------------+
206 |Looking for 'make' program... '/usr/bin/gmake' |
207 |Looking for 'tar' program... '/bin/tar' |
208 |Looking for 'cp' program... '/bin/cp' |
209 |Looking for 'mkdir' program... '/bin/mkdir' |
210 |Looking for 'pwd' program... '/bin/pwd' |
211 |Looking for 'mhonarc' program... '/usr/local/bin/mhonarc' |
212 |Looking for 'mknmz' program... '/usr/local/bin/mknmz' |
213 |Looking for 'namazu.cgi'... '/usr/local/libexec/namazu.cgi' |
214 |Looking for 'procmail' program... '/usr/bin/procmail' |
215 |Looking for 'formail' program... '/usr/bin/formail' |
216 |Looking for 'lockfile' program... '/usr/bin/lockfile' |
218 |Pathname to install mharc: /home/mailarch/archives |
219 |"/home/mailarch/archives" does not exist, create? ['y'] |
220 |Copying files into "/home/mailarch/archives"... |
221 |Copying files into "/home/mailarch/archives/html"... |
222 |Copying files into "/home/mailarch/archives/cgi-bin"... |
223 |Determine MHonArc library path from '/usr/local/bin/mhonarc'... \ |
224 | '/usr/local/lib/perl5/site_perl/5.6.1' |
226 |Root URL for archives |
227 |(You can set this later in lib/config.sh): /archives |
228 |Would you like to edit "lib/config.sh" with "vi"? ['y'] |
229 |... [edit session not shown] ... |
231 |Would you like to edit "lib/lists.def" with "vi"? ['y'] |
232 |... [edit session not shown] ... |
234 |You are using MHonArc v2.6.7 |
235 |Applying configuration (this may take awhile)... |
236 | ----------------------------------------------------------------------- |
237 || Please read the mharc installation document to finish the installation |
238 || process. A copy is located at: |
239 || /home/mailarch/archives/doc/install.html |
240 | ----------------------------------------------------------------------- |
241 +-------------------------------------------------------------------------+
243 When prompted to edit a file, the editor used is taken from the EDITOR
244 environment variable. If the environment variable is not set, vi is used.
245 You are not required to edit files like lib/config.sh and lib/lists.def
246 during install.pl execution. These files can be edited later as described
247 in Checking Configuration and Editing lists.def.
249 NOTE: The installation script provides diagnostics warning you of any
250 conditions that may prevent mharc from operating properly. Each
251 warning message provides you with information on what you can do to
254 NOTE: The MHonArc version shown may be different than what is shown above.
255 The version shown should reflect the version of MHonArc found on your
258 TIP: If you get stuck in vi, you can type the following key strokes to
259 abandon any changes and exit: <Esc>:q!<Enter>, where <Esc> represents
260 the Esc key and <Enter> represents the Enter key. Type the following
261 if you want to save any changes before exiting: <Esc>:wq<Enter>.
263 ---------------------------------------------------------------------------
267 Change your current working directory to the location you installed mharc:
269 +-------------------------------------------------------------------------+
270 |prompt> cd /home/mailarch/archives |
271 +-------------------------------------------------------------------------+
273 Replace /home/mailarch/archives with the pathname location you specified
274 when running install.pl.
276 Examine the lib/config.sh mharc configuration file created by install.pl
277 and make any edits as needed. Run the following command to have your
280 +-------------------------------------------------------------------------+
281 |prompt> make configure |
282 |./bin/apply-config -verbose |
283 |Processing "lib/common.mrc.in" |
284 |Processing "lib/mrc/_nothread.mrc.in" |
285 |Processing "lib/mrc/_logo.mrc.in" |
287 |... [files processed snipped for brevity] ... |
289 |./bin/mhonarc-check |
290 |You are using MHonArc v2.6.7 |
291 |============================================================= |
292 |* Make sure to rerun 'make configure' when you change |
293 |* lib/config.sh or change a .in template file. |
294 |============================================================= |
295 +-------------------------------------------------------------------------+
297 NOTE: If you edited lib/config.sh while running install.pl, then any
298 changes you made then would have already been applied.
300 In general, when you make changes to lib/config.sh, make sure to run make
303 NOTE: Make sure to review all variable settings in lib/config.sh. Proper
304 values are critical for the archiving system to work properly.
306 ---------------------------------------------------------------------------
310 Once you have finished the main configuration step, you need to define the
311 lists you want archived. To do this, you edit lib/lists.def. The syntax of
312 the file is documented in the mk-procmailrc manpage. After editing, run the
315 +-------------------------------------------------------------------------+
317 |You are using MHonArc v2.6.7 |
318 |./bin/mk-procmailrc |
319 +-------------------------------------------------------------------------+
321 A filed called procmailrc.mharc will be created that is used during the
322 processing of incoming mail. Anytime, you make changes to lib/lists.def,
323 rerun make to regenerate procmailrc.mharc.
325 ---------------------------------------------------------------------------
327 Defining your crontab
329 To get automatic processing of your archives, you must edit the account's
330 crontab. The file etc/crontab serves as a template of the crontab entries
331 needed. To register the file as your crontab, do the following:
333 +-------------------------------------------------------------------------+
334 |prompt> crontab etc/crontab |
335 +-------------------------------------------------------------------------+
337 CAUTION: If the account has existing crontab entries, you should run the
338 following command instead:
340 +----------------------------------------------------------------+
341 |prompt> crontab -e |
342 +----------------------------------------------------------------+
344 And copy the entries in etc/crontab into the account's crontab.
346 To customize the mharc-related crontab entries, you can edit etc/crontab.in
349 +-------------------------------------------------------------------------+
350 |prompt> make configure |
351 +-------------------------------------------------------------------------+
353 to create a new etc/crontab file suitable for copying into the account's
356 NOTE: If your system does not support cron, or you are unable to register
357 the execution of programs at periodic intervals, you can manually
358 invoke archive processing by using the various makefile targets shown
359 in Maintenance Operations.
361 ---------------------------------------------------------------------------
363 Web Server Configuration
365 NOTE: This information provided in the section is specific to the Apache
368 The file etc/apache.conf provides sample configuration directives for the
369 Apache HTTP server to control access to your archives. If the default
370 settings are not sufficient for your needs, you can edit etc/apache.conf.in
373 +-------------------------------------------------------------------------+
374 |prompt> make configure |
375 +-------------------------------------------------------------------------+
377 to generate a new etc/apache.conf that can be used in your Apache server
380 If you are on a system where you do not have access to Apache's main server
381 configuration file, a etc/.htaccess can be used to provide local
382 configuration settings.
384 To use this file, copy the generated etc/.htaccess file to the root of the
385 installation when make configure is done, or even better, create a symlink
386 to it by executing the following command from the installation root:
388 +-------------------------------------------------------------------------+
389 |prompt> ln -s ./etc/.htaccess |
390 +-------------------------------------------------------------------------+
392 With the symlink, you do not have to re-copy the file each time you make
395 Make sure Apache allows the execution of CGI programs in the cgi-bin
396 directory. The etc/apache.conf template should allows this via a
397 ScriptAlias directive.
399 An alternative is to have filenames with the extension ".cgi" handled by
400 the cgi-script handler as follows:
402 AddHandler cgi-script .cgi
404 NOTE: If you are using the .htaccess method to control access to your
405 files, you may need to create a .htaccess in the cgi-bin directory
406 with the following settings:
410 ---------------------------------------------------------------------------
412 Maintenance Operations
414 Manual maintenance can be done via the Makefile provided. If you run the
417 +-------------------------------------------------------------------------+
419 |Targets available: |
420 | (default) Generate procmailrc.mharc from ./lib/lists.def. |
421 | configure: Apply ./lib/config.sh settings. |
422 | disable: Disable automated processing of new messages. |
423 | editidx: Edit all mhonarc archive pages. |
424 | editidxonly: Edit only mhonarc archive index pages. |
425 | editrootidx: Edit only top period index pages. |
426 | enable: Enable automated processing of new messages. |
427 | help: This message. |
428 | readmail: Process mail spool. |
429 | rebuild: Rebuild archives from raw message data. |
430 | rootidx: Regenerated top index for archives. |
432 +-------------------------------------------------------------------------+
434 You will get a summary of available targets. Targets exist to manually
435 invoke the mail spool processing, to recreate the entire HTML archives, and
436 other administrative tasks. For example, to invoke the processing of any
437 incoming mail, do the following:
439 +-------------------------------------------------------------------------+
440 |prompt> make readmail |
441 |... [output clipped] ... |
442 +-------------------------------------------------------------------------+
444 Some targets will disable auto-message processing. Targets that do this
445 will output the following message:
447 +-------------------------------------------------------------------------+
448 |============================================================= |
449 |!!! Auto-archive processing is DISABLED !!! |
450 |============================================================= |
451 +-------------------------------------------------------------------------+
455 +-------------------------------------------------------------------------+
456 |prompt> make enable |
457 |============================================================= |
458 |!!! Auto-archive processing is ENABLED !!! |
459 |============================================================= |
460 +-------------------------------------------------------------------------+
462 to re-enable auto-message processing.
464 ---------------------------------------------------------------------------
466 Archive Customizations
468 Files that control archive appearance are controled by template files with
469 the extension ".in". It is recommended to edit the ".in" version of files
470 and execute the make configure command to apply your changes.
472 NOTE: You must run make configure to have mharc recognize any changes made
475 The ".in.dist" files are versions of the templates as defined by the base
476 distribution. These will be overwritten when updating the software and
477 mainly serve as a basis for your custom template files. If you ever you
478 want to revert back to the ".in.dist" version of a file, just remove the
479 ".in" version and rerun make configure.
481 The main MHonArc resource file is lib/common.mrc. To make changes, edit lib
482 /common.mrc.in and run
484 +-------------------------------------------------------------------------+
485 |prompt> make configure |
486 +-------------------------------------------------------------------------+
488 to generate a new lib/common.mrc. You can use @@VARIABLE_NAME@@ references
489 in lib/common.mrc.in to refer to variables defined in lib/config.sh.
490 However, this is normally not required since the web-archive program will
491 pre-define various MHonArc resource variables that reflect settings in lib/
492 config.sh. See the MHonArc documentation for more information on how to
493 edit MHonArc resource files.
495 TIP: To make the maintenance of MHonArc resource settings easier,
496 especially during mharc upgrades, set the MHA_RC variable in lib/
497 config.sh to something like the following:
499 # Pathname to main MHonArc resource file.
500 MHA_RC=$SW_ROOT/lib/default.mrc
502 Then create the file $SW_ROOT/lib/default.mrc.in (make note that the
503 file ends with a ".in" extension) with the following contents:
506 @@SW_ROOT@@/lib/common.mrc
509 <!-- ... customized settings here ... -->
513 +--------------------------------------------------------------------+
514 |prompt> make configure |
515 +--------------------------------------------------------------------+
517 Anytime you want to make MHonArc resource changes, make sure to edit
518 $SW_ROOT/lib/default.mrc.in and rerun make configure.
520 When you upgrade mharc, and mharc contains a new improved lib/
521 common.mrc.in.dist, and you want the new settings to be applied to
522 your archives, you can do the following:
524 +--------------------------------------------------------------------+
525 |prompt> rm lib/common.mrc.in |
526 |prompt> make configure |
527 +--------------------------------------------------------------------+
529 Any additional and/or override settings you have in $SW_ROOT/lib/
530 default.mrc.in are left untouched.
532 The above avoids performing any messing merging of changes in a new
533 lib/common.mrc.in.dist to your customized version of lib/
536 ---------------------------------------------------------------------------
538 Applying Software Updates
540 The software is structured to avoid screwing up an existing installation.
541 When running install.pl, just specify the existing location of your mharc
542 installation. All the ".in.dist" files will get overwritten, but any ".in"
543 files will be left untouched inorder to preserve any local customizations.
545 TIP: If you ever you want to use a new, or revert back to, a ".in.dist"
546 version of a file, just remove the ".in" version and rerun
549 ---------------------------------------------------------------------------
553 A program called mh-month-pack exists for sites that have an existing MH/
554 nmh-based mail filtering setup (either done manually or automatically).
555 This program can be used to import MH/nmh mail into mharc or to serve as a
556 replacement to the filter-spool step if you want to continue to use MH/nmh
557 for handling incoming mail.
559 If you do this, you will have to modify etc/crontab.in to no longer use
560 read-mail, but to call mh-month-pack (or some custom script that uses
561 mh-month-pack) followed by a call to web-archive.
563 TIP: You may just want to create variant version of read-mail that calls
564 mh-month-pack instead of filter-spool. Make sure to call your version
565 something different than read-mail because it will get overridden
566 during mharc upgrades.
568 ---------------------------------------------------------------------------
570 Managing List Administration Messages
572 Most mailing list management software send out administration message to
573 subscribers. Examples are subscribe confirmations and subscribed reminders.
574 A risk exists that these messages can show up in public archives, exposing
575 sensitive information like subscription passwords.
577 Two possible solution to the problem are provided:
581 If procmail is your local delivery agent, you can pre-filter all incoming
582 mail before mharc ever sees it. You can create a .procmailrc file in the
583 archive accounts's home directory and add rules that forward all list admin
584 messages to a real person. The .procmailrc may look something like this:
587 * (^From:(.*[^-a-zA-Z0-9_.])?(majordomo@|mailman-owner@|.*-request@|.*-help@))
588 ! real-person@example.com
590 This method is better than the mharc-based solution since it eliminates the
591 need to poll the archive for any messages and is more secure since any list
592 administration messages are never in a web accessible location.
596 The mharc-based solution is to create a special archive to capture admin
597 messages. For example, the following can be added to the very beginning of
601 Description: Lists Admin Messages
602 From-Address: majordomo@
603 From-Address: mailman-owner@
604 From-Address: .*-request@
605 From-Address: .*-help@
608 This must occur at the beginning of the file since the filtering rules are
609 processed from top to bottom. Since the Final option is set, if any message
610 matches, no further processing is performed.
612 Since .listsadmin starts with a dot, it will be hidden from the
613 all-archives list. But since it is possible to for someone to access it
614 directly, it is best to restrict access to it via HTTP server configuration
615 (remember to restrict both the raw and html archives).
617 Now, all you have to do is check the .listsadmin occasionally to see if
618 anything important has been received.
620 ---------------------------------------------------------------------------
624 * The archive search forms rely on Javascript to pass around the Namazu
625 index name since the namazu.cgi program currently does not provide a
626 namazu template variable for the index name. Hopefully, this limitation
627 of namazu will be removed in the future so the use of Javascript can be
630 If Javascript is disabled, or not supported, in a web client, initial
631 searches from an archive page will work, but trying to do another
632 search from the results page will always return no hits.
634 ---------------------------------------------------------------------------
636 $Date: 2003/08/09 18:06:40 $
638 Copyright © 2002, Earl Hood, earl@earlhood.com