-CentOS

Aus Limbas Wiki

Wechseln zu: Navigation, Suche
Diese Seite ist eine übersetzte Version der Seite -CentOS und die Übersetzung ist zu 100 % abgeschlossen sowie aktuell.

<-- backt to 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 Hints

If LIMBAS is installed on a virtual machine, it is recommended to set up an SSH access, e.g. to paste the command line commands by copy-and-paste. For this, the following steps should be carried out on the server installation:
First the entry SELINUX = disabled can be added in the file /etc/sysconfig/selinux. This can also help to solve connection problems during the LIMBAS installation. After this, the virtual machine must be restarted. The firewall should now be disabled or customized 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-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
  • ttf2pt1
  • perl-Image-ExifTool (Version >= 9)
  • epel-release
$ yum install epel-release
$ yum install httpd php php-gd php-imap php-odbc php-soap php-xml php-ctype php-mbstring unixODBC\
postgresql-odbc postgresql-server postgresql ImageMagick poppler-utils pdftohtml\
perl-Image-ExifTool wget unzip ttf2pt1 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
  • CentOS 5 (32bit)
$ rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
pdftohtml

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

$ yum install pdftohtml.

For CentOS version 5. Older versions of pdftohtm ignore the target path for the format conversion (bug). Therefore, a more recent version must be used. Successfully tested with the following packages or later:

  • poppler-0.8.7-7.fc10.i386.rpm
  • poppler-utils-0.8.7-7.fc10.i386.rpm
  • openjpeg-libs-1.3-6.el5.1.i386.rpm
ttf2pt1

This tool can be installed via the EPEL repository

yum install ttf2pt1

PostgreSQL 8.4

LIMBAS was tested on PosgreSQL from V 8.4 or higher. For some distributions, the PostgreSQL database and especially its ODBC driver must be updated.

The following commands can be used to perform an update.

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

Database Setup

Limbas supports multiple databases. Depending on the database, different installations must be carried out. By default, the PostgreSQL database is used.
see Database

PostgreSQL

From Version 2.0.22 onwards, LIMBAS supports UTF8. 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.
See also PostgreSQL

  • Stop Database Server:
$ /etc/init.d/postgresql stop
or
$ systemctl stop postgresql.service
  • If a database cluster already exists, the corresponding directory content "/var/lib/pgsql/data" has to be deleted.

(Warning: Already existing databases are deleted).

  • Create new Database Cluster without Localization:
$ su - postgres
# initdb --local=C
  • Start the database server and check the status if necessary:
$ /etc/init.d/postgresql start
$ systemctl start postgresql.service        ( alternative)

  • Check Status
$ /etc/init.d/postgresql status
$ systemctl status postgresql.service   ( alternative )
  • Create Database (Possible encodings would be LATIN1 or SQL_ASCII or UTF8) and if necessary check for existence:
$ su - postgres
# psql
psql (9.5.1)
Enter »help« for help.

postgres=# create user <limbasuser> password '<limbasuserPW>';
CREATE ROLE

postgres=# create database <limbasDB> WITH ENCODING 'SQL_ASCII' OWNER <limbasuser>;
CREATE DATABASE

postgres=#\q

# createlang plpgsql <limbasDB>
# psql -l

                                 List of Databases
   Name    | Owner | Encoding | Collation | Character Type | Access Rights
-----------+------------+-----------+--------------+-------------+-----------------------
<limbasDB> |<limbasuser>| SQL_ASCII | C            | C           |
 postgres  | postgres   | SQL_ASCII | C            | C           |
 template0 | postgres   | SQL_ASCII | C            | C           | =c/postgres
                                                                 : postgres=CTc/postgres
 template1 | postgres   | SQL_ASCII | C            | C           | =c/postgres
                                                                 : postgres=CTc/postgres
(4 Zeilen)

# createlang -l <limbasDB>
Procedural Languages
  Name   | Familiar?
---------------------
 plpgsql | yes


UTF-8

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

postgres=# create database <limbasDB> WITH ENCODING 'UTF-8' OWNER <limbasuser> template template0;
CREATE DATABASE


Configure ODBC

There are two variants of connecting LIMBAS to the database:

  • Connection with direct ODBC driver access
  • Connection with ODBC-resource

The following two points are to be carried out for both variants:

  • 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

In the file found in "DRIVERS" (here "/etc/odbcinst.ini") add the drivers with file name and path:

# Setup from the unixODBC package
[PostgreSQL]
Description     = ODBC for PostgreSQL
Driver          = /usr/lib/psqlodbcw.so
Setup           = /usr/lib/libodbcpsqlS.so
Driver64        = /usr/lib64/psqlodbcw.so
Setup64         = /usr/lib64/libodbcpsqlS.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

  • In the file found in "SYSTEM DATA SOURCES" (here "/etc/odbc.ini") add the following entry:
[<limbasOdbcResourceName>]
Description             = PSQL
Driver                  = <postgreSQL>
Trace                   = No
TraceFile               =
Database                = <limbasDB>
Servername              = localhost
Username                = <limbasuser>
Password                = <limbasuserPW>
Port                    = 5432
Protocol                = 6.4
ReadOnly                = No
RowVersioning           = No
ShowSystemTables        = No
ShowOidColumn           = No
FakeOidIndex            = No
ConnSettings            =
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!!


The following settings should also be added Security:

  • magic_quotes_gpc = off
  • file_uploads = On
  • upload_max_filesize = 10M
  • post_max_size = 16M
  • memory_limit = 128M
  • max_input_vars = 10000

If PHP 5.4 or higher is not available, the following entry should be used instead of magic_quotes_gpc:

  • magic_quotes = Off

Apache HTTP Server Setup

The root directory of the Apache server and Apache users as well as their group must be known for the LIMBAS installation. These can be found in the /etc/httpd/conf/httpd.conf file:

  • 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 (by default "apache").

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

LIMBAS Installation

$ wget http://sourceforge.net/projects/limbas/files/limbas%20source%20package/2.x/openlimbas_2.9.11.1161.tar.gz/download
  • Save the download file (here "openlimbas_2.9.11.1161.tar.gz") in <DocumentRoot> and extract it there:
$ tar xzfv openlimbas_2.9.11.1161.tar.gz
When extracting, the directory "<DocumentRoot>/openlimbas" is created with the following subdirectories:
  • limbas_src: Contains the LIMBAS source files, which will be overwritten in the case of an update, while individual settings won't be deleted.
  • independent: Contains external applications which are used by LIMBAS. An update of these applications that is decoupled with LIMBAS is possible though not recommended, because the compatibility is only tested with the versions shipped by LIMBAS.
  • public: Contains for example a SOAP application. The files in this directory are optional and not required by LIMBAS.
  • dependent: Is the main working directory, which also stores individual settings. Die directories and files from limbas_src point to this directory 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://<LIMBAS Host IP-Adresse>/openlimbas/dependent/admin/install/
  • In the installation mask, the parameters of the created PostgreSQL database instance must now be entered. Depending on the way LIMBAS connects to the database, these differ:
    • Connection with direct ODBC driver access
      • Database Vendor: PostgreSQL
      • Database Host: localhost
      • Database Name: <limbasDB> (see Setup Database)
      • Database User: <limbasuser> (see Setup Database)
      • Database Password: <limbasuserPW> (see Setup Database)
      • Database Scheme: public
      • SQL Driver (unixODBC): <postgreSQLDriver> (see Configure ODBC)
    • Connection with ODBC-resource
      • Database Vendor: PostgreSQL
      • Database Host: localhost
      • Database Name: <limbasOdbcResourceName> (see Configure ODBC)
      • Database User: (no entry required)
      • Database Password: (no entry required)
      • Database Scheme: 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