Installing Zymonic from Scratch: Difference between revisions

From Zymonic
Content added Content deleted
m (Clarification)
(Added CGI information)
Line 104: Line 104:


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.
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==

You will need to manually setup CGI using the following commands:
<pre>
cd /etc/apache2/mods-enabled
ln -s ../mods-available/cgi.load
service apache2 reload
</pre>


==Install the other required packages==
==Install the other required packages==

Revision as of 16:56, 4 October 2019

Before starting

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

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 _manifests.pm - should also be documented in the MANIFESTS/README file.

6a) sudo zymonic_toolkit_curses.pl 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 zymonic_toolkit.pl 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 (WARNING: INCOMPLETE)

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

Setting up Apache2

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

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
</VirtualHost>

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

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

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

Checkout any required repositories to "/root/..."

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 https://svn.zednax.com/svn/zymonic/trunk /root/trunk --username [USERNAME]

Make repositories/filepaths

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
serverport=7000

# Server address (IP or hostname) - localhost comes
# from /etc/hosts/ (127.0.0.1).
serverhost=localhost

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

# Client port
clientport=7000

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

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

# Path to the error log .xsl
xslpath=/ZymonicErrorLog.xsl

# Email from source 
email_from=EMAIL_FROM@ADDRESS.COM

# Email address for XML errors to be reported to
xmladmin_email_address=EMAIL@ADDRESS.COM

# Email address for DB errors to be reported to
dbadmin_email_address=EMAIL@ADDRESS.COM

# Email address for SysAdmin errors to be reported to
sysadmin_email_address=EMAIL@ADDRESS.COM

# Email address for Developers errors to be reported to
developers_email_address=EMAIL@ADDRESS.COM

# All errors to be delivered to address 
allerrors_email_address=EMAIL@ADDRESS.COM

# 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>

smtpserver=SMTP.YOURDOMAIN.COM
errorurl=https://SERVERNAME/errors/
errordir=WEBROOT/errors/