Menu

Installing

Bogdan Drozdowski

Initial steps - most are one-time

Install Perl, along with the following modules (available from CPAN / metacpan):

  • Config::Simple,
  • Data::ICal,
  • DateTime::Format::ICal,
  • DateTime::Set,
  • DateTime::TimeZone::ICal,
  • DBD::Pg,
  • DBI,
  • Fcntl,
  • Getopt::Long,
  • HTTP::DAV,
  • Log::Log4perl,
  • MIME::Base64,
  • MIME::Parser,
    with all their dependencies (the list may include but not be limited to: Module::Install, Test::NoWarnings, Test::LongString, Class::Accessor, DateTime, DateTime::TimeZone, Moo, Set::Infinite, Test::Requires, Class::Accessor-Chained, Class::ReturnValue, DateTime::Event::ICal, DateTime::Event::Recurrence, Params::Validate, Text::vFile::asData).

Actual mail sending requires the Net::SMTP and Net::Domain Perl modules,

A PostgreSQL database, version 9.2 or newer, must be running.
On a Linux system, you would do one of:

  • login to the system as the database user postgres (you can do su - postgres as root to log in to that account on Linux) and run:
    pg_ctl start
  • login as root and run:
    systemctl start postgresqlXX (XX being the version)
  • login as root and run:
    service postgresql start

A mail (SMTP) server must be running.
On a Linux system with Postfix, you would do one of (as root):

  • this:
    systemctl start postfix
  • or this:
    service postfix start

Create the database user to host the application's database.
On PostgreSQL, login to the system as the database user postgres and run:

    createuser -P meqaris

Create the application's database.
On PostgreSQL, login to the system as the database user postgres and run:

    createdb -O meqaris meqaris

NOTE for older database versions
On PostgreSQL versions older than 13.0, you may need to perform one additional step before running Meqaris - install the btree_gist extension manually in the Meqaris database you've just created. Meqaris cannot do this, because only the database superuser (usually postgres) is allowed to do it.
Substitute the hostname and port number where necessary and run this command to install the extension:

    psql -U postgres -h <hostname> -p <port number> -d meqaris -c 'create extension if not exists btree_gist;'

Database access rules must be created within the database server, unless you wish to leave the default rules.
On PostgreSQL, you would do (as the database user postgres or root):

    cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf-backup
    echo local meqaris meqaris scram-sha-256 >> /var/lib/pgsql/data/pg_hba.conf
    echo host all all 127.0.0.1/32 scram-sha-256 >> /var/lib/pgsql/data/pg_hba.conf

(Note the double >>- it's CRUCIAL to use double >>, a single > would OVERWRITE the target file).
On older PostgreSQL versions replace scram-sha-256 with md5.

If you'll need to access the database from another computer:

  • a line similar to the host all all 127.0.0.1/32 scram-sha-256 should be added to pg_hba.conf, containing the correct IP address
  • firewall rules may need to be adjusted
  • the /etc/hosts.allow file (tcpwrappers) may need to be adjusted

After changing the access rules for the database server, restart it. On Linux with PostgreSQL, you would do one of:

  • login to the system as the database user postgres and run:
    pg_ctl restart
  • login as root and run:
    systemctl restart postgresqlXX (XX being the version)
  • login as root and run:
    service postgresql restart

Installation

To install:

  • Choose 4 paths:
    • BINDIR - a directory for the Meqaris program (like /usr/bin),
    • CONFDIR - a directory for the Meqaris' configuration (like /etc),
    • DATADIR - a directory for the Meqaris' data files (like /var/lib). The data files will be installed in DATADIR/meqaris,
    • DOCDIR - a directory for the Meqaris' documentation (like /usr/share/doc). The documentation will be installed in DOCDIR/meqaris,
    • MANDIR- a directory for the manual files (like /usr/share/man). The manual page will be installed in MANDIR/man1.
  • Copy bin/meqaris to BINDIR
  • Edit config/meqaris.ini to match your directories and database settings (see below)
  • Edit config/meqaris-log4perl.cfg and choose your log file's location
  • Copy the whole sql directory and the config/meqaris-log4perl.cfg file to DATADIR/meqaris. The DATADIR/meqaris directory must be writable for your mail server
  • Copy config/meqaris.ini to CONFDIR
  • Copy config/meqaris.logrotate to a directory expected to contain logrotate configuration files (like CONFDIR/logrotate.d)
  • Copy the manual to a place suitable for documentation, like /usr/share/doc

Alternatively, if you have the make program and some common Linux utilities, you can run make install, passing the target directories.. Examples:

    make install BINDIR=/usr/bin CONFDIR=/etc DATADIR=/var/lib DOCDIR=/usr/share/doc MANDIR=/usr/share/man
    make install BINDIR=$HOME/tools/meqaris/bin \
        CONFDIR=$HOME/tools/meqaris/etc \
        DATADIR=$HOME/tools/meqaris/data \
        DOCDIR=$HOME/tools/meqaris/doc \
        MANDIR=$HOME/tools/meqaris/man

All the above directories and their parent directories must be reachable by your mail server.

The log file (/var/log/meqaris.log by default) must be created writable for your mail server. Alternatively, the directory which would contain it must be writable by your mail server.

The necessary database structures will be automatically created by the application itself while operating, but to avoid concurrent database upgrades (all of which except one would fail), it is recommended to run the database installation/upgrade scripts manually by calling

    meqaris --upgrade-db

See also:

Uninstallation

To uninstall, if needed:

  • remove the meqaris script from the directory you installed it to,
  • remove the meqaris.ini file from the directory you installed it to
  • remove the meqaris logrotate configuration file from the directory you installed it to
  • remove the meqaris-log4perl.cfg file from the directory you installed it to
  • remove the application SQL file(s) from the directory you installed them to
  • remove the documentation file(s) from the directories you installed them to
  • delete the application's database - run as postgres:
    dropdb meqaris
  • delete the application's database user - run as postgres:
    dropuser meqaris

Alternatively, if you have the make program and some common Linux utilities, you can run make uninstall, passing the same directories that were used during installation. Examples:

    make uninstall BINDIR=/usr/bin CONFDIR=/etc DATADIR=/var/lib DOCDIR=/usr/share/doc MANDIR=/usr/share/man
    make uninstall BINDIR=$HOME/tools/meqaris/bin \
        CONFDIR=$HOME/tools/meqaris/etc \
        DATADIR=$HOME/tools/meqaris/data \
        DOCDIR=$HOME/tools/meqaris/doc \
        MANDIR=$HOME/tools/meqaris/man

Related

Wiki: CalDAV configuration
Wiki: Features
Wiki: Home
Wiki: Mail server configuration
Wiki: Meqaris INI file

MongoDB Logo MongoDB