Installing Zymonic from Scratch: Difference between revisions
(Added another cpan module) |
|||
(17 intermediate revisions by 2 users not shown) | |||
Line 44: | Line 44: | ||
documented in the full documentation. |
documented in the full documentation. |
||
=How to setup Zymonic from a new Ubuntu 18.04.3 LTS server= |
|||
=More details - NOT COMPLETE YET= |
|||
For setting up Zymonic from scratch on a Ubuntu server, you will need to do the following: |
|||
=Become root user= |
|||
All commands given here are under the assumption you are logged in as the root user (achieved by using "sudo su"). |
|||
This saves time typing sudo constantly. After setup is finished it's ill advised to continue using it. |
|||
Guide written on Thursday October 10th, 2019. |
|||
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: |
|||
=Install required packages= |
|||
<pre> |
|||
apt install apache2 |
|||
</pre> |
|||
Next you'll want to allow Apache through the firewall of the server: |
|||
This gets the required server applications installed. |
|||
<pre> |
|||
ufw allow 'Apache' |
|||
</pre> |
|||
Get the server IP address using the following command: |
|||
apt install build-essential checkinstall zlib1g-dev -y |
|||
<pre> |
|||
apt install subversion |
|||
hostname -I |
|||
apt install make |
|||
</pre> |
|||
apt install autoconf |
|||
apt install libexpat1-dev |
|||
apt install libtool |
|||
apt install graphviz |
|||
apt install libssl-dev |
|||
apt install libnet-ssleay-perl |
|||
apt install libcrypt-ssleay-perl |
|||
apt install libio-socket-ssl-perl |
|||
apt install apache2 |
|||
Check you can now access your webpage through "http://[IP_ADDRESS]" |
|||
==Setting up SSL on Apache2== |
|||
=Install required ssl= |
|||
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. |
|||
This sets up SSL |
|||
First enable the SSL engine on your server: |
|||
mkdir ~/perl5 |
|||
<pre> |
|||
mkdir ~/perl5/perlbrew |
|||
a2enmod ssl |
|||
mkdir ~/perl5/perlbrew/openssl |
|||
</pre> |
|||
cd ~/perl5/perlbrew/openssl |
|||
wget https://www.openssl.org/source/openssl-1.1.1.tar.gz |
|||
tar -xf openssl-1.1.1.tar.gz |
|||
cd openssl-1.1.1 |
|||
./config shared --prefix=$PERLBREW_ROOT/openssl |
|||
make |
|||
make test |
|||
Now run the following commands to create the certificate and key files in the correct location: |
|||
<pre> |
|||
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 |
|||
</pre> |
|||
Add the following to "/etc/apache2/sites-enabled/000-default.conf" using your preferred text editor (nano, vim etc): |
|||
=Checkout any required repositories to root= |
|||
<pre> |
|||
<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> |
|||
</pre> |
|||
Finally, run an apache restart using the following command: |
|||
This gets the core Zymonic module checked out onto the server, feel free to add more repositories of XML for Zymonic systems. |
|||
<pre> |
|||
service apache2 restart |
|||
</pre> |
|||
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. |
|||
svn co https://svn.zednax.com/svn/zymonic/trunk /root/trunk |
|||
==Set up CGI== |
|||
You will need to manually setup CGI using the following commands: |
|||
=Make repositories/filepaths= |
|||
<pre> |
|||
cd /etc/apache2/mods-enabled |
|||
ln -s ../mods-available/cgi.load |
|||
service apache2 reload |
|||
</pre> |
|||
==Install the other required packages== |
|||
This sets the Zymonic filesystem up. |
|||
You will need to run the following commands to install the rest of the required packages: |
|||
<pre> |
|||
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 |
|||
</pre> |
|||
==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". |
|||
<pre> |
|||
svn co https://svn.zednax.com/svn/zymonic/trunk /root/trunk --username [USERNAME] |
|||
</pre> |
|||
==Make repositories/filepaths== |
|||
This sets the Zymonic filesystem up. |
|||
<pre> |
|||
cd /root/trunk/modules/Zymonic |
cd /root/trunk/modules/Zymonic |
||
perl Makefile.PL && make install |
perl Makefile.PL && make install |
||
cd /root/trunk/modules/MANIFESTS |
cd /root/trunk/modules/MANIFESTS |
||
perl Makefile.PL && make install |
perl Makefile.PL && make install |
||
mkdir |
mkdir WEBROOT/errors |
||
chmod 666 WEBROOT/errors |
|||
mkdir /etc/zymonic |
mkdir /etc/zymonic |
||
cp /root/trunk/stylesheets/ZymonicErrorLog.xsl WEBROOT/ZymonicErrorLog.xsl |
|||
vi /etc/zymonic/error.conf [PUT ERROR CONFIG DETAILS IN HERE] |
|||
</pre> |
|||
Next open "/etc/zymonic/error.conf" and put the following details in (don't forget to customise it for your own system): |
|||
<pre> |
|||
# 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 |
|||
=Install required CPAN modules= |
|||
# from /etc/hosts/ (127.0.0.1). This will nearly always |
|||
# be localhost. |
|||
clienthost=localhost |
|||
# Client port |
|||
These are required for Zymonic to be able to use the external dependencies. |
|||
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/ |
|||
</pre> |
|||
==Install required CPAN modules== |
|||
These are required for Zymonic to be able to use the external dependencies. |
|||
<pre> |
|||
cpan XML::Parser |
cpan XML::Parser |
||
cpan XML::Simple |
cpan XML::Simple |
||
Line 127: | Line 249: | ||
cpan Taint::Util |
cpan Taint::Util |
||
cpan Data::Compare |
cpan Data::Compare |
||
cpan HTML::TreeBuilder |
|||
cpan HTML::FormatText |
|||
cpan HTML::FormatText::WithLinks |
cpan HTML::FormatText::WithLinks |
||
cpan Crypt::CBC |
cpan Crypt::CBC |
||
Line 137: | Line 261: | ||
cpan Apache::ConfigParser |
cpan Apache::ConfigParser |
||
cpan Sys::Info::OS |
cpan Sys::Info::OS |
||
cpan Sys::Info::Driver |
cpan Sys::Info::Driver::OS |
||
cpan Text::CSV::Encoded |
cpan Text::CSV::Encoded |
||
cpan Business::CreditCard |
cpan Business::CreditCard |
||
Line 148: | Line 272: | ||
cpan Module::Reload |
cpan Module::Reload |
||
cpan LWP::Protocol::https |
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 |
|||
</pre> |
|||
==Final Steps== |
|||
=Configuring Apache= |
|||
Run the following to install the core manifests: |
|||
(Assuming you're using apache2) |
|||
<pre> |
|||
Due to zymonic forcing https, you will need to configure apache to allow https. |
|||
cd /etc/apache2 |
|||
zymonic_toolkit.pl Installer install --manifests "core,core_manifests,client,modperl" --apacheconf /etc/apache2/apache2.conf |
|||
</pre> |
Latest revision as of 15:16, 7 February 2020
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 _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[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 </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[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 https://svn.zednax.com/svn/zymonic/trunk /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 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/
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 zymonic_toolkit.pl Installer install --manifests "core,core_manifests,client,modperl" --apacheconf /etc/apache2/apache2.conf