Share

Server Installation

ServiceView Server Installation

Redhat Server Install


Before you start

You will have to decide on the following before you start the ServiceView installation:

  • A ServiceView admin password
  • Domain for ServiceView
  • MySQL database name <db_name> and connect username <db_user> and password
  • If you want to run on SSL then a SSL Cert for the domain


Install Package

  • yum install httpd
  • yum install mysql-server
  • yum install php
  • yum install php-ldap
  • yum install php-xml
  • yum install php-mysql
  • yum install phpmyadmin
  • yum install fontconfig
  • yum install ,xorg-x11-fonts*,
  • yum install perl-libwww-perl


Download and extract the code

Download the ServiceView application from http://www.serviceview.org into:

/var/www cd /var/www GET http://serviceview.org/downloads/core/release/ServiceView_<version>.tar.gz  > ServiceView_<version>.tar.gz 

Extract the source code

tar -xzf ServiceView_<version>.tar.gz 

Will create a directory containing the ServiceView code called serviceview_<version>


Create temporary directories

mkdir  serviceview_<version>/tmp
chmod 777 serviceview_<version>/tmp  
mkdir serviceview_<version>/htdocs/tmp 
chmod 777 serviceview_<version>/htdocs/tmp

Set phantomjs to be executable

 mkdir serviceview_<version>/backup
mkdir serviceview_<version>/backup/snapshots

Create a symbolic link into this version of ServiceView we will use in the apache virtual host as well as the crontab. This will allow updates to the code to be done by changing the symbolic link.

ln -s serviceview_<version> serviceview 


Configure Services on Start-up

 /sbin/chkconfig httpd on
 /sbin/chkconfig mysqld on 


Configure the server to use UTC

 cd /etc 
 ln -sf /usr/share/zoneinfo/UTC localtime 


Configure PHP

 vi /etc/php.ini -change the timezone to UTC 
date.timezone = "UTC" 


MySQL Database

 vi /etc/my.cnf  -add line
max_allowed_packed = 128M
 /etc/init.d/myqld restart. 

Create a root password for mysql if it doesn't already exist.

mysqladmin -u root password <mysql root password> 

Create a mysql database for each ServiceView instance.

/var/www/serviceview/bin/mkMysql.pl <db_name><db_user><db_pass>

Enter the mysql root password

Load in the empty database schema

 mysql -u <db_user>-p<db_pass><db_name>< 
 /var/www/serviceview/documentation/InitialDatabase.sql 


Configure cron

Cron is used to run monitoring, send out emails and SMS and other routine jobs. To create the cron jobs use the following command:

crontab -e 
58 23 * * * cd /var/www/serviceview/bin; /usr/bin/php backupDatabase.php
 * * * * *   cd /var/www/serviceview/bin; /usr/bin/php runCron.php >>
 /tmp/serviceview_cron.txt
 50 1 * * *  cd /var/www/serviceview/bin; /usr/bin/php updateTimezones.php >>
/tmp/exports.txt


Configure the Apache config file

Create the directory if not already present.

mkdir  /etc/httpd/conf/includes
vi /etc/httpd/conf/httpd.conf - Copy or uncomment the following lines to the bottom of the file: 
#
# Use name-based virtual hosting. 
# 
NameVirtualHost *:80 
NameVirtualHost *:443  
Include conf/includes/*.conf 
 cd /etc/httpd/conf/includes 

ServiceView virtual hosts must live in /etc/http/conf/includes and be of the format sv_<domain>,conf

  Cron will look at all files starting with sv_ for scheduled jobs and pull database connect details from the apache config file.



vi sv_<domain>.conf

Create one virtual host file for each ServiceView instance:

<VitualHost *:80>

 DocumentRoot "/var/www/serviceview_<version>/htdocs"
 ServerName <domain>

 <Directory "/var/www/serviceview_<version>/htdocs">
  Options all
  AllowOverride All
  RewriteEngine On
  Order allow,deny
  allow from all
</Directory>

  SetEnv DATABASE_USER <db_user>
  SetEnv DATABASE_PASS <db_pass>
  SetEnv DATABASE_HOST 127.0.0.1
  SetEnv DATABASE_NAME <db_name>
  SetEnv SECRET <secret>
  SetEnv HEADER_MSG "Optional Message - ie Dev System"
  SetEnv SV_ADMIN_PASS <admin_pass> 
  SetEnv SV_URL http://<domain>
  SetEnv SC_ENCRYPTION_KEY_SOMERANDOMCHARACTERS
   LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{Useragent}i\""
   TransferLog  /var/log/httpd/<domain>_access_log
   ErrorLog  /var/log/httpd/<domain>_error_log

</VirtualHost>
/etc/init.d/httpd restart

Connect to the IP address or <domain> with a browser to continue setup using the Administrators guide located at: http://serviceview.org