Installing Zymonic from Scratch

From Zymonic

Before starting[edit]

Before starting you need to be familiar with the following terms/concepts:

Repository - this is where code resides and is maintained by the developers. In general the guide uses the term repository to refer to a location on a version control server that contains one or more 'manifests'.

Manifest - In the context of Zymonic a Manifest contains a list of files to be installed and instructions to run after install that the installer will use to install the files needed to provide a particular piece of functionality, e.g., Core or Decryptor

Installing Zymonic from Scratch[edit]

Checkout the Zymonic code from our repository to a working copy

Follow instructions in [zymonic working copy]/modules/Zymonic/README

Correct as of 04-10-2018:

1) cd to [zymonic working copy]/modules/Zymonic

2) sudo perl Makefile.PL && sudo make install

3) cd to [zymonic working copy]/modules/MANIFESTS

4) sudo perl Makefile.PL && sudo make install

5) For each additional repository desired, checkout the working copy, locate the MANIFESTS subdirectory and do

sudo perl Makefile.PL && sudo make install
  • note the base name (i.e. filename with no directory or .pm extension) of the file in MANIFESTS/lib/Zymonic/Manifest/ that ends with - should also be documented in the MANIFESTS/README file.

6a) sudo Installer - then select 'Installer -> install' from the menu, populate the manifests field with a comma separated list with no spaces of core, core_manifest and all of the _manifest files identified in 5 e.g. core,core_manifests,medoc_manifests,zednax_manifests - populate the remainder of options as appropriate for your server.

6b) If you do not have curses or don't wish to use it then do; sudo Installer install --manifests [ list of manifests

e.g. core,core_manifests,medoc_manifests,zednax_manifests ]

7) Under guidance from your supplier/developer install the remaining needed manifests, create and config build a system and then build the documentation for it - the Installer/updater command is further documented in the full documentation.

How to setup Zymonic from a new Ubuntu 18.04.3 LTS server[edit]

All commands given here are under the assumption you are logged in as the root user (achieved by using "sudo su").

Guide written on Thursday October 10th, 2019.

Setting up Apache2[edit]

For a basic server without virtual hosts, this is remarkably simple. First you'll need to install the apache service:

apt install apache2

Next you'll want to allow Apache through the firewall of the server:

ufw allow 'Apache'

Get the server IP address using the following command:

hostname -I

Check you can now access your webpage through "http://[IP_ADDRESS]"

Setting up SSL on Apache2[edit]

This is required to run Zymonic later, as Zymonic forces you to use https. This guide is assuming you will be using a self-signed certificate.

First enable the SSL engine on your server:

a2enmod ssl

Now run the following commands to create the certificate and key files in the correct location:

mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
openssl genrsa -out ca.key 2048
openssl req -nodes -new -key ca.key -out ca.csr
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt

Add the following to "/etc/apache2/sites-enabled/000-default.conf" using your preferred text editor (nano, vim etc):

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/ca.crt
        SSLCertificateKeyFile /etc/apache2/ssl/ca.key

Finally, run an apache restart using the following command:

service apache2 restart

Check you can access your webpage through "https://[IP_ADDRESS]" - don't worry about the secuirty error as it's using a self-signed certificate.

Set up CGI[edit]

You will need to manually setup CGI using the following commands:

cd /etc/apache2/mods-enabled
ln -s ../mods-available/cgi.load
service apache2 reload

Install the other required packages[edit]

You will need to run the following commands to install the rest of the required packages:

apt install build-essential checkinstall zlib1g-dev -y
apt install subversion -y
apt install autoconf -y
apt install libexpat1-dev -y
apt install libtool -y
apt install graphviz -y
apt install libssl-dev -y
apt install libnet-ssleay-perl -y
apt install libcrypt-ssleay-perl -y
apt install libio-socket-ssl-perl -y
apt install openjdk-8-jdk -y
apt install ant -y
apt install libsaxon-java -y
apt install libxml-commons-resolver1.1-java -y
apt install libxml-commons-external-java -y
apt install libxerces2-java -y
apt install apache2-dev -y
apt install libperl-dev -y
apt install libperl-dev -y
apt install imagemagick -y
apt install gcc -y
apt install perlmagick -y
apt install libmagickcore-dev -y
apt install cpanminus -y
apt install libapache2-request-perl -y
apt install mariadb-server -y
apt install ncurses-dev -y
apt install libreadline-dev -y

Checkout any required repositories to "/root/..."[edit]

This gets the core Zymonic module (dev code) checked out onto the server, feel free to add more repositories of XML for Zymonic systems to a different folder in "/root".

svn co /root/trunk --username [USERNAME]

Make repositories/filepaths[edit]

This sets the Zymonic filesystem up.

cd /root/trunk/modules/Zymonic
perl Makefile.PL && make install
cd /root/trunk/modules/MANIFESTS
perl Makefile.PL && make install
mkdir WEBROOT/errors
chmod 666 WEBROOT/errors
mkdir /etc/zymonic
cp /root/trunk/stylesheets/ZymonicErrorLog.xsl WEBROOT/ZymonicErrorLog.xsl

Next open "/etc/zymonic/error.conf" and put the following details in (don't forget to customise it for your own system):

# Server port the error rating daemon listens on

# Server address (IP or hostname) - localhost comes
# from /etc/hosts/ (

# Client address (IP or hostname) - localhost comes
# from /etc/hosts/ ( This will nearly always
# be localhost.

# Client port

# The difference in seconds between each syslog error
# message. For example, the default settings means
# 1 message every 60 seconds. 

# The difference in seconds between each email error
# message. For example, the default settings means
# 1 message every 60 seconds. 

# Path to the error log .xsl

# Email from source 

# Email address for XML errors to be reported to

# Email address for DB errors to be reported to

# Email address for SysAdmin errors to be reported to

# Email address for Developers errors to be reported to

# All errors to be delivered to address 

# Email subject template
email_subject_template=System Error Reported: {ZZerror_id}

# Email body template
email_body_template=Error reported on [SERVERNAME]  <a href="{ZZerrorfileurl}">{ZZerrorfile}</a>


Install required CPAN modules[edit]

These are required for Zymonic to be able to use the external dependencies.

cpan XML::Parser
cpan XML::Simple
cpan Exception::Class
cpan Date::Manip
cpan Date::Calc
cpan Clone
cpan POSIX::strptime
cpan File::Slurp
cpan DBI
cpan File::Which
cpan GraphViz
cpan CGI
cpan XML::LibXML
cpan JSON
cpan Taint::Util
cpan Data::Compare
cpan HTML::TreeBuilder
cpan HTML::FormatText
cpan HTML::FormatText::WithLinks
cpan Crypt::CBC
cpan Crypt::OpenSSL::RSA
cpan IPC::ShareLite
cpan Term::ReadKey
cpan Net::SSLeay
cpan IO::Socket::SSL
cpan Config::Simple
cpan Apache::ConfigParser
cpan Sys::Info::OS
cpan Sys::Info::Driver::OS
cpan Text::CSV::Encoded
cpan Business::CreditCard
cpan Data::Structure::Util
cpan List::MoreUtils
cpan Locale::Currency::Format
cpan MIME::Lite
cpan Mail::Sendmail
cpan Unix::Syslog
cpan Module::Reload
cpan LWP::Protocol::https
cpan Sys::Info::Driver::Linux::OS
cpan APR::Status
cpan Business::Barcode::EAN13
cpan Crypt::OpenSSL::AES
cpan Data::UUID
cpan Date::Business
cpan DateTime
cpan DateTime::Format::Strptime
cpan Expect
cpan File::Touch
cpan HTML::Scrubber
cpanm Algorithm::FloodControl -n
cpanm Image::Magick -n
cpan Math::Round
cpan Net::LDAP
cpan Net::LDAP::Schema
cpan PPI
cpan Pod::Snippets
cpan Test::Taint
cpan Apache2::Connection
cpan Apache2::Const
cpan Apache2::Cookie
cpan Apache2::RequestIO
cpan Apache2::RequestRec
cpan Apache::DBI
cpan CGI::Apache2::Wrapper
cpan Term::ReadLine::Gnu
cpan Algorithm::CheckDigits

Final Steps[edit]

Run the following to install the core manifests:

cd /etc/apache2 Installer install --manifests "core,core_manifests,client,modperl" --apacheconf /etc/apache2/apache2.conf