-CentOS

From Limbas Wiki

Jump to: navigation, search
This page is a translated version of the page -CentOS and the translation is 100% complete.

Main Page



This guide is based on a standard CentOS 6 or 7 installation, with Version 7 showing some differences to previous CentOS versions. The minimum server package selection in the CentOS installation setup is sufficient. However, the web server setup can also be chosen in order to make fewer basic adjustments for network ssh access, etc. If the client (browser) is running on another host (which is usually the case), no "desktop" installation is necessary. The description refers to a 32 or 64 bit system.

Note: Labels in brackets <> can be replaced with any text, but they must be consistently consistent in order to successfully install LIMBAS. Unless otherwise specified, the following calls from the command line are made by the user "root".

Installation Tips

If LIMBAS is installed on a virtual machine, it is recommended to set up SSH access, e.g. to insert the command line commands via copy-and-paste. To do this, the following steps should be performed on the server installation:
First, in the file /etc/sysconfig/selinux the entry SELINUX=disabled can be added. This can also help solving connectivity issues with the LIMBAS installation. After that, the virtual machine must be restarted. The firewall should now be disabled or adjusted as follows:

CentOS 7

systemctl start firewalld
systemctl enable firewalld
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload

CentOS 6

/etc/init.d/iptables save
service iptables stop
chkconfig iptables off

Third make sure that openssh server is already installed and start it with the following commands:

CentOS 7

yum install openssh-server
systemctl start sshd.service

CentOS 6

yum install openssh-server
/sbin/service sshd start

CentOS 7 Package Selection

In addition to the minimalist installation, the following base packages have be installed as well for LIMBAS:

  • httpd
  • php
  • php-gd
  • php-imap
  • php-odbc | php-pdo
  • php-pgsql | php-mysql
  • php-soap
  • php-xml
  • php-ctype
  • php-mbstring
  • unixODBC
  • postgresql-odbc
  • postgresql
  • postgresql-server
  • ImageMagick
  • poppler-utils (pdftohtml version >= 0.10.5)
  • wget
  • unzip
  • pdftotext
  • pdftohtml
  • perl-Image-ExifTool (Version >= 9)
  • epel-release

$ yum install epel-release

$ yum install httpd php php-gd php-imap php-pdo php-pgsql php-soap php-xml php-ctype php-mbstring unixODBC\

postgresql-odbc postgresql-server postgresql ImageMagick poppler-utils pdftohtml\
perl-Image-ExifTool wget unzip t1lib
$ yum update

Additional Packages (optional)

External repositories can be integrated for some required tools that are not available with the standard package management. Depending on the CentOS version, different repositories must be selected. This allows the following additional packages to be installed if they are not already.
Below are a few suggestions which repositories can already contain many of the additional packages:

  • CentOS 7 (64bit)

$ yum install epel-release

  • CentOS 6 (32bit)

$ rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

pdftohtml

For CentOS Version 7, pdftohtml has already been installed with the poppler-utils package. For CentOS Version 6, the current version is available with the pdftohtml:

Database Setup

Limbas supports several databases. Depending on the database, different installations have to be carried out. By default, the PostgreSQL database is recommended. MySQL/mariadb is supported until version 5.5. Older versions have not yet been successfully tested with Limbas.

PostgreSQL

Limbas supports PostgreSQL 8.2 or higher. The following commands can optionally install a higher PostgreSQL version than offered by CentOS.

$ wget http://yum.pgsqlrpms.org/reporpms/X.X/pgdg-centos-X.X.noarch.rpm
$ rpm -i pgdg-centos-X.X.noarch.rpm
$ yum update

If UTF8 is not required, ISO encoding is recommended. LIMBAS converts the date and time formats independently and requires the date format "DD.MM.YYYY". Since PostgreSQL is installed with localization as standard, a few additional steps must be considered.

  • Stop Database Server

$ /etc/init.d/postgresql stop or

$ systemctl stop postgresql.service

  • If a database cluster already exists, the following step can be skipped.
  • Create Database Cluster:
$ su - postgres
# initdb
  • Start the Database Server and, if necessary, check the status:

$ /etc/init.d/postgresql start

$ systemctl start postgresql.service        ( alternative )
  • Check Status

$ /etc/init.d/postgresql status

$ systemctl status postgresql.service   ( alternative )
  • Determine the paths of the configuration files of unixODBC:
$ odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /<user>/.odbc.ini
$ su - postgres

# psql
psql (9.5.1)
Geben Sie »help« für Hilfe ein.
postgres=# create user {limbasuser} password '{limbasuserPW}';
CREATE ROLE
postgres=# create database {limbasdb} WITH ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C' OWNER {limbasuser} TEMPLATE template0;
CREATE DATABASE
postgres=#\q
# createlang plpgsql {limbasdb}
# psql -l
                                 Liste der Datenbanken
   Name    | Eigentümer | Kodierung | Sortierfolge | Zeichentyp  | Zugriffsrechte
-----------+------------+-----------+--------------+-------------+-----------------------
{limbasdb} |{limbasuser}| SQL_ASCII | C            | C           |
 postgres  | postgres   | SQL_ASCII | C            | C           |

Now the rights to the database have to be adjusted. To do this, set the necessary permissions in the file /var/lib/pgsql/data/pg_hba.conf:

local all all trust


If the database is created in UTF-8 encoding, the following statement can be used:

postgres=# create database {limbasdb} WITH ENCODING 'UTF-8' LC_COLLATE 'C' LC_CTYPE 'C' OWNER {limbasuser} template template0;
CREATE DATABASE


Note: It is important to use the original PostgreSQL ODBC driver (psqlodbcw.so) of the package "postgresql-odbc" and not the enclosed driver of unixODBC!!
Note: Latest ODBC version 10 or later drivers seem to be causing problems. However, ODBC version 9 ODBC drivers can also be used with PostScript 10 or higher with Limbas.

MySQL/MariaDB

This documentation refers to mariadb 5.5, which is available as standard with CentOS 7 via the package management. Other versions of MySQL may have different features that will not be discussed here. Especially version 10 or higher could not be successfully tested with Limbas.

yum install mysql mysql-server mysql-connector-odbc

systemctl restart mariadb.service
sudo systemctl enable mariadb.service
mysql_secure_installation
systemctl restart mariadb.service
mysql -u root
CREATE DATABASE <limbasdb>;
CREATE USER '<limbasuser>'@localhost IDENTIFIED BY '<limbaspass>';
GRANT USAGE ON <limbasdb>.* TO '<limbasuser>'@localhost IDENTIFIED BY '<limbaspass>';
GRANT ALL ON <limbasdb>.* TO <limbasuser>@localhost IDENTIFIED BY '<limbaspass>';
use mysql;
update user set plugin='' where User='<limbasuser>';
flush privileges;
exit;

You can check the rights with the help of:

SHOW GRANTS FOR '<limbasuser>'@localhost;
SELECT host,user,password,plugin FROM mysql.user;


Note: For Limbas versions smaller than 4, the case-inscription for table names must be deactivated. To do this, the file

"</etc/mysql/mariadb.conf.d/50-server.cnf" has to be adjusted. Further information can be found under Mysql.

[mysqld]
 lower_case_table_names = 1
Note: When using the MYSQL/maria database, version 5.5 is recommended. Version 10 or higher has not yet been tested successfully with Limbas.

Configure PDO

Limbas can connect to the database either via PDO or ODBC. PDO is only supported for PostgreSQL and MySQL. For other databases the ODBC interface can be used. Limbas can not use both database modules at the same time. If PDO is to be used, the odbc module must be deactivated or uninstalled.

The following packages are to be installed for the PDC module:

  • php-pdo
  • php-pgsql | php-mysql

Folgende Packete sind für für das PDO Modul nicht mehr notwendig und müssen deaktiviert sein:

  • php-odbc

$ yum install php-pdo php-pgsql

$ yum erase php-odbc

The Limbas installation wizard automatically detects which module is to be used.

Configure ODBC

The database connection via ODBC is necessary if PostgreSQL or MYSQL are not used as a database or PDO is not available. Setting up ODBC is more time-consuming and involves not only installing the necessary packages, but also setting up UnixODB and the database ODBC driver.

The following packages are to be installed for the PDO module:

  • php-odbc
  • unixODBC
  • postgresql-odbc | mysql-odbc

$ yum install php-odbc unixODBC postgresql-odbc


There are two variants of connecting LIMBAS to the database via ODBC:

  • Connection with direct ODBC driver access
  • Connection with ODBC-resource
  • /etc/odbc.ini
  • /etc/odbcinst.ini
[PSQL]
Description     = ODBC for PostgreSQL (ANSI version)
Driver          = /usr/lib/psqlodbca.so
Setup           = /usr/lib/libodbcpsqlS.so
Driver64        = /usr/lib64/psqlodbca.so
Setup64         = /usr/lib64/libodbcpsqlS.so
FileUsage       = 1

[PSQLUTF8]
Description     = ODBC for PostgreSQL (Unicode version)
Driver          = /usr/lib/psqlodbcw.so
Setup           = /usr/lib/libodbcpsqlS.so
Driver64        = /usr/lib64/psqlodbcw.so
Setup64         = /usr/lib64/libodbcpsqlS.so
FileUsage       = 1

[MySQL]

Description     = ODBC for MySQL
Driver          = /usr/lib/libmyodbc5.so
Setup           = /usr/lib/libodbcmyS.so
Driver64        = /usr/lib64/libmyodbc5.so
Setup64         = /usr/lib64/libodbcmyS.so
FileUsage       = 1
WARNING: For older PostgreSQL versions (<= 8.3) the following driver can be used:
Driver = /usr/lib/psqlodbc.so

The following point is only necessary for a connection using ODBC-resource

  • Add the following entry to the configuration file "SYSTEM DATA SOURCES" (in this case "/etc/odbc.ini"):

[{limbasPsqlOdbcResourceName}]

Description             = PSQL
Driver                  = {postgreSQL}
Database                = {limbasdb}
Servername              = localhost
Username                = {limbasuser}
Password                = {limbasuserPW}

[{limbasMysqlOdbcResourceName}]

Description             = MySQL
Driver                  = MySQL
Database                = {limbasdb}
Port                    = 3306
Server                  = 127.0.0.1


Apache HTTP Server Setup

For the LIMBAS installation, the root directory of the Apache server and the Apache user and its group must be known. These can be taken from the file '/etc/httpd/conf/httpd.conf':

  • The root directory of the Apache server can be determined from the "DocumentRoot" entry (by default "/var/www/html").
  • The Apache user and his group can be determined from the "User" and "Group" entries ("apache" by default).

In order to display all characters correctly, the following line must be deleted or canceled in the file "/etc/httpd/conf/httpd.conf":

  1. AddDefaultCharset UTF-8 DELETE THIS LINE or OFF!!

For the .htaccess files used in the LIMBAS directories to be interpreted by the Apache server, add the following entry to "/etc/httpd/conf/httpd.conf":

<Directory "<DocumentRoot>/openlimbas/dependent">
      AllowOverride All
</Directory>

Start Apache HTTP Server:

$ /etc/init.d/httpd start
$ systemctl start httpd.service (alternative)

For problems with newer Apache versions (from 2.4) the activation of the access_compat-module can contribute to the solution. If this does not help, in every .htaccess-file

Order allow,deny
Allow from all

has to be changed to

Require all granted

Require all granted

LIMBAS Installation

$ wget http://sourceforge.net/projects/limbas/files/limbas%20source%20package/2.x/openlimbas_2.9.11.1161.tar.gz/download

  • Save and extract the download file (here "openlimbas_2.9.11.1161.tar.gz") {DocumentRoot} here:

$ tar xzfv openlimbas_2.9.11.1161.tar.gz

When extracting, the directory "<DocumentRoot>/openlimbas" is created with the following subdirectories:
  • limbas_src: Here are the LIMBAS source files, which can be overwritten in the event of an update, without individual settings getting lost.
  • independent: Here are standalone external applications used by LIMBAS. Although an update of these applications detached from LIMBAS is possible, it is not recommended, since the interaction is only tested with the versions included in the LIMBAS installation.
  • public: Here is an example of a SOAP application. The files from this directory are not required for the functionality of LIMBAS.
  • dependent: This is the actual working directory in which individual settings are stored. The directories and files of the limbas_src directory must be present here as symbolic links.
  • If the files and directories from "{DocumentRoot}/openlimbas/limbas_src" are copied into "{DocumentRoot}/openlimbas/dependent" instead of being symbolic links (on some systems there might be problems with extracting symbolic links), then proceed as shown in Known Solutions:
Note: LIMBAS needs write-access to "./openlimbas/dependent" and all its sub directories that individual settings can be saved. To grant access rights, simply set the apache user as owner (in this case "apache").
$ chown -R apache:apache openlimbas/dependent
  • If the client browser runs on a different host, ensure that the firewall configuration grants access from this client to the LIMBAS host.
  • The LIMBAS database structure can now be created using a browser. To do this, the LIMBAS installation script must be called with the following URL:
http://{LimbasIP}/openlimbas/dependent/admin/install/
  • Now the parameters of the created PostgreSQL database instance must be entered into the installation mask. Depending on how LIMBAS connects to the database, they differ:
    • Connection with direct ODBC driver access
      • Database Vendor: PostgreSQL
      • Database Host: localhost
      • Database Name: {limbasdb} (siehe Database Setup)
      • Database User: {limbasuser} (see Database Setup)
      • Database Password: {limbasuserPW} (siehe Database Setup)
      • Database Schema: public
      • SQL Driver (unixODBC): {postgreSQL driver} (see configure ODBC)
    • Connection with ODBC-resource
      • Database Vendor: PostgreSQL
      • Database Host: localhost
      • Database Name: {limbasOdbcResourceName} (siehe configure ODBC)
      • Database User: (no entry required)
      • Database Password: (no entry required)
      • Database Schema: public
      • SQL Driver (unixODBC): (no entry required)
The Web Interface tries to automatically enter all the paths correctly. If this does not happen or the fields remains empty, the php.ini should be rechecked.
  • When clicking on "check", LIMBAS checks if all required functions are available. The installation can only proceed, if the minimum requirements are satisfied. This is indicated by the green and yellow check marks. If this is the case, you can select the desired installation:
    • demo.tar.gz: The database will contain user data for demonstration purposes of LIMBAS.
    • clean.tar.gz: The database does not contain user data.
  • When clicking on "install", the installation will start. The progress of the installation is shown by the green progress bar.
  • User "root": The installation script copies the database settings into the file "<DocumentRoot>/openlimbas/dependent/inc/include_db.lib". If this file is changed, then it won't anymore be possible for LIMBAS to access the database. In order to prevent unintended manipulations or corruptions, all write access rights should be removed from this file.

chmod 444 {DocumentRoot}/openlimbas/dependent/inc/include_db.lib

  • After a successfull installation, LIMBAS can be started by clicking on the link "test installation" or from the following URL:
http://localhost/openlimbas/dependent
Right after opening the URL, authentication will be requested. Use the following credentials for the user which is setup by default with all administration rights:
  • Username: admin
  • Password: limbas