Server installation

From Promoserv
Jump to: navigation, search


Installing promoserv-server with Centos 6.x

These instructions have been made for installing Promoserv-server. They can be used also in installing any other Centos-based servers. Installed packages and software depends on needs (e.g. kqc1 program is only needed when working with weather observation database).

This document gives all needed information for installation. However, this is not step-by-step procedure, so basic understanding of computers and IT is required. For example you have able to select and configure correct keyboard, timezones, storage mediums etc.

Few notable issues:

  • Use sudo always when possible, avoid working as root.
  • Remember to check the correct architecture for all programs/downloads!

Installing Centos 6.x

Installation to Centox 6.x Linux differs in some areas from installation to previous Centos 5.x version. Installation documents provided with kqc1-rpm are made for Centos 5.x.

This document has been made for Centos 6.0 and tested again with 6.3 (test ongoing)


Depending on network design, following programs may need proxy-settings:


Install Centos 6.x (newest). (netinstall image is fine. Although it requires lot of downloading during installation, it is recommended version.).

Netinst requires almost instant network configuration.

If unsure, it is safer to leave out IPv6.

Mirror url

Locate best mirror-site from Try to select nearest mirror and locate image for your architecture (for modern computers, usually x86_64)

Centos requires full url, which is quite easy to find out using www-browser from other computer. NOTE: Url may be different at different mirrors.

Mirror used in Vietnam :

Mirror used in Finland (DO NOT use this unless you are located in Finland):

Hard drive selections

Select and configure your hardrives. For testing purposes, you can use options 'Use All Space' and probably accept defaults proposed by installer. NOTE! All previous data in harddrives will be deleted with this selection!

Predefined setups

It is recommended to select minimal desktop -setup with following customations (Select: 'Customize now'):

  • Base System -> Perl support
  • Base System -> Networking Tools
  • Other setup-options (or none) can be used.

It is possible to use none of readymade setup-options, but this requires extensive Centos knowledge and is not recommended

After first boot

Add administrative users to group "wheel" so they can use sudo anywhere.

As root:
usermod --append -G wheel userx

Log out and back in with userx for changes to take effect.

Check file /etc/sudoers

In /etc/sudores there should be line:

%wheel	ALL=(ALL)	ALL

If there is comment-character '#' remove it. It is best to use visudo-program for editing /etc/sudoers-file. It checks the syntax after editing (without visudo, it would be possible to prevent access to sudo-command due broken configuration file).

Default editor is vi which is not very easy. So for visudo it is recommended to use more userfriendly editor like nano with commands:

export EDITOR=nano

Install updates

sudo yum update

Installing required software

General tips: Do not use root-account, use: sudo yum install package1 package2 instead!

Postgresql version 9.x

READ detailed instructions about installation from links:


sudo rpm -i pgdg-centos-9.0-2.noarch.rpm 
   [root@server1 ~]# cd /etc/yum.repos.d  
   [root@server1 yum.repos.d]# vi CentOS-Base.repo  
   name=CentOS-$releasever - Base  
   #released updates  
   name=CentOS-$releasever - Updates  
yum list postgres*
sudo yum install postgresql90 postgresql90-devel postgresql90-server postgresql90-libs
sudo yum install postgresql90-plperl
Enable postgresql-9.0 at boot-time

Postgresql version 9.2

  • Select correct file for your architecture! (i386/x86_64)

sudo rpm -i pgdg-centos92-9.2-5.noarch.rpm 

Edit /etc/yum.repos.d/CentOS-Base.repo

Add line


to base and updates -stanzas.

Install postgresql-packages:

sudo yum install postgresql92 postgresql92-devel postgresql92-server postgresql-92-libs postgresql92-contrib

Initialize database

sudo service postgresql-9.2 initdb

Start database

sudo service postgresql-9.2 start

Login to postgres-user

sudo su - postgres

Fix path-settings at .bash_profile, add lines:

export PATH

Password for postgres database-superuser (NOT server-account) is empty by default and should be set

psql postgres postgres
ALTER USER postgres WITH password 'XXXXXXX';

Modify the pg_hba.conf file for allowing connections with TCP/IP. (Think carefully which hosts or users really need remote access. Example and recommendation is to allow logins from localhost using linux-useraccounts matching database accounts without password (authentication is done by server) and to other accounts by connecting via TCP/IP from localhost).

Install other usefull or needed packages

  • nedit rpm-build svn telnet system-config-firewall system-config-firewall-base system-config-firewall-tui screen finger gcc php-pdo

Install packages needed for listeners

  • perl-DBD-Pg perl-Config-Simple

Packages from CPAN (perl)

perl -MCPAN -e shell
 install Log::Log4pperl
 install Net::Server

Configure or disable selinux

  • /etc/selinux/config

Creating personal useraccounts

Using root-account is not recommended, create personal user accounts instead and configure sudo program

  • Add needed users to group wheel
  • login as normal user
  • run programs lie sudo programx and give password for useraccount (not for root) when prompted.
  • See other sudo-options from file /etc/sudoers (edit with command visudo)

Configuring database

Initialize database

  • service postgresql-9.0 initdb
  • service postgresql-9.0 start

Setup access-entries

  • for qc and collector-database -users
  • File: /var/lib/pgsql/9.0/data/pg_hba.conf

See example below

#file /var/lib/pgsql/9.0/data/pg_hba.conf
host    all             qc                md5
host    all             qc              samenet                 md5
host    all             collector            md5
host    all             collector       samenet                 md5

Recommended software

In addition of the required software, it is recommended to consider version control software such as subversion, Wiki for documentation (e.g. MediaWiki).


Fedora repo but works for centos as well:


  • Library for generating MS-excel-files with PHP
  • Installation:
    • sudo pear channel-discover
    • sudo pear install pearplex/PHPExcel
    • vi /etc/php.ini <-- add /usr/share/pear to include_path

Needed fonts

jpgraph needs some fonts which might be usefule for other applications as well. Install msttfcorefonts as described in (Usefull tips and background also at and )

  • Install with: sudo yum localinstall --nogpgcheck rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
  • needs also packages cabextract rpm-build

Adjusting fontpaths

Quick-and-dirty solution:

  • sudo mkdir /usr/share/fonts/truetype
  • cd /usr/share/fonts/truetype
  • sudo ln -s ../msttcorefonts/verdana.ttf verdana.ttf
    • Do ln -s for all verdana?.ttf -files as well as arial?.ttf files

Installing & config kqc1

Install latest package of kqc1-vietnam -program (provided by FMI)

sudo rpm -Uvh kqc1-vietnam-11.4.7-3.el6.fmi.noarch.rpm 
change to postgres-superuser for database-initialization
sudo su - postgres
sh  /usr/kqc1-vietnam/bin/ init

Problems in Vietnam installations

These problems will be corrected by FMI, either during next visit or remotely, for now, most of them have workaround solution

  • /usr/kqc1-vietnam/include/Utility.class.php
    • wrong config_file -setting, fix by rebuilding rpm
  • Missing packages
    • sudo yum install php-pgsql phpPgAdmin
  • configure logrotate
  • install jpgraph
  • grant all on parameter_conversions_id_seq to qc;
  • Fatal error: Undefined class constant 'FLAG_RESERVED' in /usr/kqc1-vietnam/include/Flag.class.php on line 80 <-- uncomment definition


  • include_path = ".:/php/includes:/usr/local/share/php"
  • error_reporting, display_errors <-- development values


  • CentOS mediawiki116-package is a bit broken. Installation can be completed relatively easy, but requires knowledge. Check the Alias-directives in /etc/httpd/conf.d/mediawiki.conf and extra symbolic link in config-directory

Other installed programs

Personal tools