Server installation

From Promoserv
Jump to: navigation, search

Contents

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)

Proxy

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

Install

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 www.centos.org. 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
visudo


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:

wget http://yum.pgrpms.org/reporpms/9.0/pgdg-centos-9.0-2.noarch.rpm

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  
   [base]  
   name=CentOS-$releasever - Base  
   mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os  
   #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/  
   gpgcheck=1  
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
   exclude=postgresql*  
    
   #released updates  
   [updates]  
   name=CentOS-$releasever - Updates  
   mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates  
   #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/  
   gpgcheck=1  
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5  
   exclude=postgresql*   
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)
wget http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-5.noarch.rpm

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

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

Add line

exclude=postgresql*

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:

PATH=$PATH:/usr/pgsql-9.2/bin
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              127.0.0.1/32            md5
host    all             qc              samenet                 md5
host    all             collector       127.0.0.1/32            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).

munin

Fedora repo but works for centos as well: http://articles.slicehost.com/2010/3/12/installing-munin-on-centos

PHPExcel

  • Library for generating MS-excel-files with PHP
  • http://phpexcel.codeplex.com
  • Installation:
    • sudo pear channel-discover pear.pearplex.net
    • 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 http://oimon.wordpress.com/2011/09/05/msttcorefonts-on-rhel6-centos-6-sl6/ (Usefull tips and background also at http://resalxh.wordpress.com/2009/04/05/installing-msttcorefonts-in-centos-53/ and http://benperove.com/howto/install-microsoft-truetype-fonts-in-fedora-and-ubuntu/ )

  • 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.sh 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


php.ini

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

Mediawiki

  • 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
Namespaces

Variants
Actions
Navigation
Toolbox