Koozali.org: home of the SME Server

[Announce] Install and configure Mharc

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
[Announce] Install and configure Mharc
« on: May 23, 2005, 02:44:24 AM »
If you like this maillist to html manager, follow this how to.
Seean example here: http://www.mhonarc.org/archive/html/mhonarc-users/2005-05/threads.html

Mharc is a set of preconfigured scripts that utilizes Mhonarc to produce browsable html pages from mailing list manager. In this howto I assume the use of ezmlm mailing list manager. Anyway you can use with other mailing list manager. Mharc utilizes the great and huge variables set of Mhonarc to produce a formated results. If you want, you can utilize directly Mhonarc, but it has a lot of configurations and templating issues.
Mhonarc support archives format produced by ezmlm (IE files under directory /archives), but not Mharc. Mharc support the old Unix mail format “mbox”.  Mharc author’s say “in the future support “maildir” qmail schema”. SME server utilize qmail MTA. For integrate Mharc to “maildir” schema, is necessary to use some device to interface previous to convert to html files. Use of maildir2mbox script run ok for our purposes.
There are some configurations you can use. Shortly, Mhonarc support mbox and archives generated by ezmlm mailing list manager (I don’t try with other mailing list manager). See this link if you want to use only Mhonarc to process the ezmlm archive:
http://www.mhonarc.org/archive/html/mhonarc-users/1998-07/msg00046.html

or see this link for utilize Mhonarc with “maildir” format.

http://www.mhonarc.org/archive/html/mhonarc-users/1999-04/msg00039.html

In the first case, you don’t need to create an user because Mhonarc extract directly from ezmlm archives subfolder. In the second case you need to create an user and subscribe to your list for extract mail archives from the maildir directory.

But the purposse of the present howto is to use Mharc to simplify the use of Mhonarc environment.

The first step is to configure some mailing list manager. I assume you use EZMLM. See this link from Ray Mitchell to install and configure EZMLM.

http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/howto/ezmlm-web%20HOWTO%20for%20sme%20server.htm

For my opinion, EZMLM is the best mailing list manager. Read the entire doc from Ray to customize your messages, allow or not HTML messages, etc.

Once you have configurated your EZMLM, create an user in your SME server, unlock the account with some password, and subscribe the user to the mailing list. In this howto I assume you create the user “publisher”. If you want other, you need to modify the file “convert”.
 Then follow these commands fron your console:

Code: [Select]
mkdir /root/mhinst
cd /root/mhinst
wget http://www.mhonarc.org/release/MHonArc/tar/MHonArc-2.6.11.tar.gz
gzip -dc MHonArc-2.6.11.tar.gz | tar xvf -
cd MHonArc-2.6.11
perl install.me


When prompt accept the default

Code: [Select]
cd /root/mhinst

The following install namazu search engine for Mharc (and your web pages if you want. See namazu.org for configurations)
Code: [Select]

wget http://www.todomecanica.com.ar/archivos/kakasi-2.3.4-3.i386.rpm
wget http://www.todomecanica.com.ar/archivos/namazu-2.0.10-4.i386.rpm
wget http://www.todomecanica.com.ar/archivos/namazu-cgi-2.0.10-4.i386.rpm
wget http://www.todomecanica.com.ar/archivos/namazu-devel-2.0.10-4.i386.rpm
wget http://www.todomecanica.com.ar/archivos/perl-NKF-1.71-2.i386.rpm
wget http://www.todomecanica.com.ar/archivos/perl-Text-Kakasi-1.04-4.i386.rpm

rpm -Uvh *.rpm


Code: [Select]
wget http://www.mhonarc.org/release/mharc/tar/mharc-0.7.3.tar.gz
gzip -dc mharc-0.7.3.tar.gz | tar xvf -
cd mharc-0.7.3
perl install.pl



When prompt pathname for install mharc choose /opt/mharc

When prompt Root URL for archives choose /mharc

Answer “n” for the questions about edit some files (later you can configurate).

Code: [Select]
cd /root/mhinst

wget http://www.todomecanica.com.ar/archivos/maildir2mbox.tar.gz
gzip -dc maildir2mbox.tar.gz | tar xvf -
mv maildir2mbox /usr/bin


Download Crontab-manager from MasterSleepy site:

Code: [Select]
wget “http://www.vanhees.cc/modules.php?op=modload&name=Downloads&file=index&req=getit&lid=232”
rpm -ivh sme-crontab_manager-1.1-1.noarch.rpm

Code: [Select]
wget http://www.todomecanica.com.ar/archivos/enable
wget http://www.todomecanica.com.ar/archivos/convert
wget http://www.todomecanica.com.ar/archivos/test
mv enable convert test /opt/mharc
wget http://www.todomecanica.com.ar/archivos/config.sh
wget http://www.todomecanica.com.ar/archivos/lists.def
mv config.sh lists.def /opt/mharc/lib


and replace the existing ones.

Code: [Select]
cd /opt/mharc/lib

Edit the ADMIN_ADDRESS in config.sh

Edit the file lists.def. Uncomment the example lines and custom with your values. If you have more than one list, you need to repeat the same lines with the new values for the list.
This file tell Mharc to process only the emails refered to the address you set in the “address” in your lists.def. If the user “publisher” receive emails fron other address, they are not process. Remember maildir2mbox script convert to mbox and then delete all mails from “maildir” directory for the user “publisher”.
Go to the root Mharc installation:

Code: [Select]
cd /opt/mharc

Run this commands:

Code: [Select]
make configure
make


Please, read all documentation from mharc. Every time you modify any /lib file run "make configure" command at /opt/mharc directory. When you modify lists.def file, run the "make" command at /opt/mharc directory. Type “make help” to see the commands available

Code: [Select]
mv /opt/mharc/etc/logrotate.conf /etc/logrotate.d/mharc

mcedit /etc/rc.d/rc.local


and add at the end:

/opt/mharc/enable

Uncomment the line 15 (alias) in apache.conf.in found in /opt/mharc/etc directory

Return to the root mharc directory /opt/mharc and run again "make configure"

Code: [Select]
mv /opt/mharc/etc/apache.conf /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/mharc

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
service httpd restart


Some bugs well documented in the Mharc mail list about NAMAZU=>Mharc integration are fixed with the following replacement:
To fix namazu mhonarc filter:

Code: [Select]
cd /root/mhinst
wget http://www.todomecanica.com.ar/archivos/mhonarc.pl
mv mhonarc.pl /usr/share/namazu/filter


and replace the existing one.

Well, now your Mharc is installed. To test, first enable Mharc. When you boot your server, the above mod to the rc.local file enables automatically Mharc. For now:

Code: [Select]
cd /opt/mharc
sh enable


Send any message to the list, and wait for the return to your inbox. Once receive the email go to the directory /home/e-smith/files/users/publisher/Maildir/new to see if “publisher” user has received an email. If not check your EZMLM address list configuration.

Then go to:

cd /opt/mharc/mbox

and see if empty.

Go to  mharc root:

Code: [Select]
cd /opt/mharc

And execute convert
Code: [Select]

sh convert


Then go again to mbox and see is has any file or directory. If yes, run all ok.
Go to /opt/mharc/html directory and see if you have any directory. Return to mharc root and execute:
Code: [Select]

sh test


Go again to html directory and see if you have a new directory named same as your mail list. If yes, all ok.

Now is time to see in the web:

http://youdomain/mharc/html/lists.html


For a better aspect download the following files and replace the existing:

Code: [Select]
cd /root/mhinst
wget http://www.todomecanica.com.ar/archivos/custom/common.mrc.in
wget http://www.todomecanica.com.ar/archivos/custom/mharc-logo-small.png
wget http://www.todomecanica.com.ar/archivos/custom/stylesheet.css.in
wget http://www.todomecanica.com.ar/archivos/custom/.namazurc.in

For Spanish speaker download:
Code: [Select]
wget http://www.todomecanica.com.ar/archivos/custom/common.mrc.es.in


Code: [Select]
mv common.mrc.in /opt/mharc/lib
mv mharc-logo-small.png stylesheet.css /opt/mharc/html
mv .namazu.in /opt/mharc/cgi-bin

and replace the existing one.

For Spanish
Code: [Select]
mv common.mrc.es.in /opt/mharc/lib
and put at the botton of the common.mrc.in the follow:
Code: [Select]
<Include>
common.mrc.es
</Include>


Then go to mharc root and execute make configure.
To see the changes you need to send another message to the list and then execute “test”
Hit CTRL-F5 in your browser to see the changes

If you need to transkate to other language, rename the file common.mrc.en.in to common.mrc.xx.in where xx is the two letters of your language. Then edit the file and include as mention above ate the botton of common.mrc.in

Of course, for more options see the documentations at
http://www.mhonarc.org/mharc
http://www.mhonarc.org
http://www.namazu.org

After you finish the configuration, put the events in crontab through crontab-manager or directly.

This is my mharc crontab settings:

Code: [Select]
55 * * * * root /opt/mharc/convert
56 * * * * root /opt/mharc/bin/logcmd -log /opt/mharc/log/cron.log -- /opt/mharc/bin/read-mail
57 * * * * root /opt/mharc/bin/logcmd -log /opt/mharc/log/cron.log -- /opt/mharc/bin/gc-search-indexes
57 * * * 7 root /opt/mharc/bin/logcmd -log /opt/mharc/log/cron.log -- /opt/mharc/bin/compress-mboxes



Any suggestions to improve this howto are welcome.
Any one can translate this howto to a real good English?
Any contribs.org admin can make me a directory under contribs to store some howtos I have?

Sorry for any mistakes in this howto

Enjoy.

Normando Hall