Installing Zymonic from Scratch: Difference between revisions
(Added another cpan module) |
(Changed install instructions) |
||
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 (WARNING: INCOMPLETE)= |
|||
=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. |
|||
==Setting up Apache2== |
|||
sudo su |
|||
For a basic server without virtual hosts, this is remarkably simple. First you'll need to install the apache service: |
|||
<pre> |
|||
=Install required packages= |
|||
This gets the required server applications installed. |
|||
apt install build-essential checkinstall zlib1g-dev -y |
|||
apt install subversion |
|||
apt install make |
|||
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 |
apt install apache2 |
||
</pre> |
|||
Next you'll want to allow Apache through the firewall of the server: |
|||
<pre> |
|||
ufw allow 'Apache' |
|||
</pre> |
|||
Get the server IP address using the following command: |
|||
=Install required ssl= |
|||
<pre> |
|||
hostname -I |
|||
This sets up SSL |
|||
</pre> |
|||
mkdir ~/perl5 |
|||
mkdir ~/perl5/perlbrew |
|||
mkdir ~/perl5/perlbrew/openssl |
|||
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 |
|||
=Checkout any required repositories to root= |
|||
This gets the core Zymonic module checked out onto the server, feel free to add more repositories of XML for Zymonic systems. |
|||
svn co https://svn.zednax.com/svn/zymonic/trunk /root/trunk |
|||
=Make repositories/filepaths= |
|||
Check you can now access your webpage through "http://[IP_ADDRESS]" |
|||
This sets the Zymonic filesystem up. |
|||
==Setting up SSL on Apache2== |
|||
cd /root/trunk/modules/Zymonic |
|||
perl Makefile.PL && make install |
|||
cd /root/trunk/modules/MANIFESTS |
|||
perl Makefile.PL && make install |
|||
mkdir /var/errors |
|||
mkdir /etc/zymonic |
|||
vi /etc/zymonic/error.conf [PUT ERROR CONFIG DETAILS IN HERE] |
|||
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: |
|||
=Install required CPAN modules= |
|||
<pre> |
|||
a2enmod ssl |
|||
</pre> |
|||
Now run the following commands to create the certificate and key files in the correct location: |
|||
These are required for Zymonic to be able to use the external dependencies. |
|||
<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): |
|||
cpan XML::Parser |
|||
<pre> |
|||
cpan XML::Simple |
|||
<VirtualHost *:443> |
|||
cpan Exception::Class |
|||
ServerAdmin webmaster@localhost |
|||
cpan Date::Manip |
|||
DocumentRoot /var/www/html |
|||
cpan Date::Calc |
|||
ErrorLog ${APACHE_LOG_DIR}/error.log |
|||
cpan Clone |
|||
CustomLog ${APACHE_LOG_DIR}/access.log combined |
|||
cpan POSIX::strptime |
|||
SSLEngine on |
|||
cpan File::Slurp |
|||
SSLCertificateFile /etc/apache2/ssl/ca.crt |
|||
cpan DBI |
|||
SSLCertificateKeyFile /etc/apache2/ssl/ca.key |
|||
cpan File::Which |
|||
</VirtualHost> |
|||
cpan GraphViz |
|||
</pre> |
|||
cpan CGI |
|||
cpan XML::LibXML |
|||
cpan JSON |
|||
cpan Taint::Util |
|||
cpan Data::Compare |
|||
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::Linux::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 |
|||
Finally, run an apache restart using the following command: |
|||
=Configuring Apache= |
|||
<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. |
|||
(Assuming you're using apache2) |
|||
Due to zymonic forcing https, you will need to configure apache to allow https. |
Revision as of 15:13, 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.