How to install NicTool on CentOS 6

This documentation will walk you through a step by step installation of NicTool on a minimal install of CentOS 6. This doc supports both 32 and 64 bit installations of CentOS.

Update CentOS

First step is to update the system to the latest and greatest version of CentOS

yum update

Use EPEL repo

The default CentOS repo does not provide all the required prerequisites, so we'll being in the EPEL repo

yum install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Install required packages

Since CentOS is a rpm based system we try and use as many of the provided RPM's as possible, what's left we'll install from source (CPAN)

yum install mysql mysql-server mysql-devel httpd httpd-devel mod_perl mod_perl-devel mod_ssl curl gcc \
                  make gettext gettext-devel rsync libxml2 libxml2-devel perl-Net-IP perl-XML-Parser  \
                  perl-XML-LibXML perl-Digest-HMAC perl-JSON perl-RPC-XML perl-CGI perl-SOAP-Lite perl-CPAN \
                  wget perl-Apache-DBI perl-Params-Validate perl-parent perl-Time-HiRes perl-MIME-Base32 \
                  perl-DBIx-Simple perl-YAML expat bind perl-Encode-Locale perl-IO-Compress-Bzip2 \
                  perl-Test-Simple perl-Module-Build perl-Crypt-SSLeay perl-Class-Inspector perl-Task-Weaken
export PERL_MM_USE_DEFAULT=1 
cpan -i Test::More
cpan -i BIND::Conf_Parser
cpan -i -f Net::DNS::Zone::Parser
cpan -i -f TestConfig
cpan -i Time::TAI64

Start MySQL

chkconfig mysqld on
service mysqld start 

Install NicTool Server, Client, API

mkdir -p /usr/src/nictool
cd /usr/src/nictool
rm -rf server client
wget http://www.nictool.com/download/NicTool-2.25.tar.gz
tar zxvf NicTool-2.25.tar.gz
tar zxvf client/NicToolClient-2.25.tar.gz
tar zxvf server/NicToolServer-2.25.tar.gz
mkdir -p /usr/local/nictool
/bin/cp -af NicToolClient-2.25 /usr/local/nictool/client
/bin/cp -af NicToolServer-2.25 /usr/local/nictool/server
cd /usr/local/nictool/client
test -f lib/nictoolclient.conf || cp lib/nictoolclient.conf.dist lib/nictoolclient.conf
perl Makefile.PL && make && make install clean
cd /usr/local/nictool/server
test -f lib/nictoolserver.conf || cp lib/nictoolserver.conf.dist lib/nictoolserver.conf
perl Makefile.PL && make &&  make install clean

Run NicTool dependency installer

We run this script just to be sure we have everything NicTool needs

cd /usr/local/nictool/server 
perl bin/nt_install_deps.pl
cd /usr/local/nictool/client
perl bin/install_deps.pl

Install NicTool database

cd /usr/local/nictool/server/sql
perl create_tables.pl

Modify nictoolserver.conf

Modify this configuration file and populate it with our database details.

vi nictoolserver.conf

Modify Apache configuration

Download the provided config and use sed to make a couple changes

wget -O /etc/httpd/conf.d/z_nictool.conf  http://www.nictool.com/download/nictool.conf
sed -i '/Listen 443/d' /etc/httpd/conf.d/z_nictool.conf
sed -i "s/dns\.example\.net/`hostname |sed 's/\./\\./g'`/g" /etc/httpd/conf.d/z_nictool.conf

Next you need to edit /etc/httpd/conf.d/ssl.conf and remove the default SSL VirtualHost entry. Edit the file and find the line that starts with <VirtualHost _default_:443>. Remove it and everything below it until you reach a line matching </VirtualHost>. Remove that line too.

Start Apache

service httpd restart

Now you can start using nictool. Go to https://YOUR.SERVER.IP/ and login!