Manual Instalação EVE

This release of the manual describe the installation process in a Linux Red Hat Advance Server or CentOS versions 7.8 for:

  • Apache 2.4.43
  • PHP 7.0.33
  • Oracle 19.6
  • CouchBase 6.5.1

We assume that the media to install the OS was “minimal install” type.

Create OS user

To clearly identify our processes we are going to create a group and an user:

  • groupadd isretail
  • useradd -g isretail eve
  • passwd eve


To avoid problems during installation or while running the system we suggest check the following configuration files:

  • /etc/hostname where you should be defined the server name
  • /etc/sysconfig/network-scripts/ifcfg-eth0/1/… where IP address is defined
  • /etc/hosts where can be defined the address for servers name when no complex DNS services are uses

These files are also to be remembered when a clone of a VM is the base of a new installation.

Firewall rules are also important if you prefer to mantain the firewall service active:

  • check in which zone we are (normally public) with firewall-cmd –get-active-zones
  • list the services with firewall-cmd –zone=public –list-services
  • add the services we need: firewall-cmd –zone=public –add-service=http
  • and make it permanent: firewall-cmd –zone=public –add-service=http –permanent

You may want to do the same for https service and other ports; for example if you need to open port 1235: firewall-cmd –zone=public –add-port=1235/tcp. Remeber to use “–permanent” for definition that must exist after reboot.

Update and Install packages

OS must be up to date and the following packages must be installed:

  • yum update
  • yum groupinstall “Development Tools” -y
  • yum install pcre-devel -y
  • yum install openssl-devel -y
  • yum install libxml2-devel -y
  • yum install libcurl-devel -y
  • yum install libjpeg-devel -y
  • yum install libpng-devel -y
  • yum install freetype-devel -y
  • yum install memcached -y
  • yum install pkgconfig -y
  • yum install openssl098e -y
  • yum install epel-release -y
  • yum install libmcrypt libmcrypt-devel -y
  • yum install mcrypt -y
  • yum install mhash -y
  • yum install wget -y

After this:

  • mkdir -p /root/install
  • cd /root/install

Apache installation

Please run the following commands from console:

  • wget
  • wget
  • wget
  • wget
  • tar -zxvf httpd-2.4.43.tar.gz
  • tar -zxvf apr-1.7.0.tar.gz
  • tar -zxvf apr-util-1.6.1.tar.gz
  • tar -zxvf expat-2.2.9.tar.gz
  • mv apr-1.7.0 httpd-2.4.43/srclib/apr
  • mv apr-util-1.6.1 httpd-2.4.43/srclib/apr-util
  • cd /root/install/expat-2.2.9
  • ./configure
  • make
  • make install
  • cd /root/install/httpd-2.4.43
  • ./configure –prefix=/www –with-mpm=prefork –enable-so –enable-rewrite –enable-vhosts-alias –enable-ssl –enable-modules=’unique-id’ –with-included-apr –with-expat=/usr/local
  • make
  • make install
  • vi /www/conf/httpd.conf to set some parameters:
    • Listen
    • Listen (if you need for voice)
    • LoadModule deflate_module modules/
    • LoadModule expires_module modules/
    • LoadModule proxy_module modules/
    • LoadModule proxy_fcgi_module modules/
    • LoadModule slotmem_shm_module modules/
    • LoadModule rewrite_module modules/
    • User eve
    • Group isretail
    • ServerName [hostname]
    • before DocumentRoot “/www/htdocs”
      • <FilesMatch \.php$>
      • SetHandler “proxy:fcgi://”
      • </FilesMatch>
    • inside directory “/www/htdocs”
      • AllowOverride All
    • end of file:
        • ExpiresActive On
        • ExpiresByType image/x-icon “access plus 15 days”
        • ExpiresByType image/gif “access plus 15 days”
        • ExpiresByType image/png “access plus 15 days”
        • ExpiresByType image/jpg “access plus 15 days”
        • ExpiresByType image/jpeg “access plus 15 days”
        • ExpiresByType text/css “access plus 15 days”
        • ExpiresByType application/javascript “access plus 15 days”
      • </IfModule>
        • SetOutputFilter DEFLATE
        • DeflateCompressionLevel 9
        • BrowserMatch ^Mozilla/4 gzip-only-text/html
        • BrowserMatch ^Mozilla/4.0[678] no-gzip
        • BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
        • SetEnvIfNoCase Request_URI (?:gif|jpe?g|png|swf)$ no-gzip dont-vary
      • </IfModule>
        • ProxySet timeout=600000
        • ProxyPassMatch ^/(..php(/.)?)$ fcgi://$1
        • ProxyPassMatch ^/(status?)$ fcgi://$1
        • SetEnvIf Authorization “(.)” HTTP_AUTHORIZATION=$1
        • SetEnvIf Content-Type “(.)” HTTP_CONTENT_TYPE=$1
        • SetEnvIf Accept “(.*)” HTTP_ACCEPT=$1
      • </IfModule>
      • ExtendedStatus On
        • SetHandler server-status
        • Order Deny,Allow
        • Deny from all
        • Allow from all
      • </Location>
      • AddDefaultCharset Off

Database connections

Before install PHP engine we need to get a client for the database we are going to access.

Oracle client

This step is necessary if you want to access an Oracle Database Server installed in a different machine. If database and application servers are the same you don’t need to.

First obtain from Oracle site the client and the development libraries, then install.

  • wget
  • wget
  • rpm -ivh oracle-instantclient19.6*
  • create a tnsnames.ora file in /usr/lib/oracle/19.6/client64/network/admin

MySQL client

Since PHP 5.4 there is no need to install MySQL client libraries since the MySQL native driver is embedded in the PHP extension.

PHP and modules

The version we are going to install is 7.0.33

Some changes to the configure command suggested may be needed; for example:

  • –with-oci8=instantclient,/usr/lib/oracle/19.6/client64/lib if you are using the instant client from oracle
  • –with-mysqli instead of –with-oci8 if you are using MySQL instead of Oracle

In our case we have Oracle Server in the same machine; so:


  • wget
  • tar -zxvf php-7.0.33.tar.gz
  • cd php-7.0.33
  • ./configure –prefix=/usr/local –with-libdir=/lib64 –enable-fpm –with-xmlrpc –with-iconv –enable-sockets –enable-mbstring –with-curl –with-gd –enable-soap –with-freetype-dir=/usr/local/lib –with-mcrypt=/usr/lib64 –with-openssl –enable-pcntl –enable-posix –enable-shmop –enable-sysvsem –enable-sysvshm –enable-sysvmsg –enable-sigchild –enable-zip –enable-opcache –with-jpeg-dir=/usr/local/lib –with-png-dir=/usr/local/lib64 –with-zlib-dir=/usr/local/lib64 [–with-oci8=$ORACLE_HOME]
  • make && make install
  • cp php.ini-development /usr/local/lib/php.ini and adapt; about usefull settings:
    • max_execution_time = 300
    • max_input_vars = 10000
    • memory_limit = 256M
    • error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
    • display_errors = Off
    • ignore_repeated_errors = On
    • error_log = /www/logs/php_errors.log
    • upload_max_filesize = 4M
    • session.gc_maxlifetime = 3600 (very important since it is used in EVE to decide after how much inactivity an user should re-login)
    • output_buffering = Off
  • cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
  • chmod +x /etc/init.d/php-fpm
  • cp ./sapi/fpm/status.html /www/htdocs/
  • chown eve.isretail -R /www/htdocs/
  • chkconfig php-fpm on
  • cd /usr/local/etc/
  • cp php-fpm.conf.default php-fpm.conf
  • vi php-fpm.conf and adapt; some settings that can be useful:
    • error_log = log/php-fpm.log
    • log_level = notice
    • process.max = 128
  • cd /usr/local/etc/php-fpm.d
  • cp www.conf.default www.conf
  • vi www.conf; some settings that can be useful:
    • user = eve
    • group = isretail
    • pm.max_children = 35
    • pm.start_servers = 5
    • pm.max_requests = 100
    • pm.status_path = /status
    • slowlog = /tmp/$pool.log.slow
    • request_slowlog_timeout = 3s
    • env[PATH] = /usr/local/bin:/usr/bin:/bin
    • env[TMP] = /tmp
    • env[TMPDIR] = /tmp
    • env[TEMP] = /tmp
    • env[ORACLE_HOME] = /opt/oracle/product/19c/dbhome_1
    • env[LD_LIBRARY_PATH] = /opt/oracle/product/19c/dbhome_1/lib:/lib:/usr/lib
    • env[NLS_LANG] = american_america.UTF8
    • env[NLS_SORT] = GENERIC_M_AI
    • env[DOCUMENT_ROOT] = /www/htdocs

At this point if we start php-fpm and we use a phpinfo.php page … it should works.

To start php-fpm: systemctl start php-fpm.service

To restart php-fpm: systemctl restart php-fpm.service

To stop php-fpm: systemctl stop php-fpm.service


In production environment remember to enable opcache from php.ini.

echo >> /usr/local/lib/php.ini

After restart, to verify if ok, execute the command php -i | grep opcache and some output should appear:

opcache.blacklist_filename => no value => no value
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => Off => Off
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.fast_shutdown => 0 => 0
opcache.file_cache => no value => no value


  • cd /root/install
  • wget
  • tar -zxvf igbinary-3.1.2.tgz
  • cd igbinary-3.1.2
  • phpize
  • ./configure CFLAGS=”-O2 -g” –enable-igbinary –with-php-config=/usr/local/bin/php-config
  • make && make install
  • echo >> /usr/local/lib/php.ini

After restart, to verify if ok, execute the command php -i |grep igbinary and the output should be:

igbinary support => enabled
igbinary version => 3.1.2
igbinary APCu serializer ABI => no
igbinary session support => yes
igbinary.compact_strings => On => On
Registered serializer handlers => php_serialize php php_binary igbinary


  • cd /root/install
  • wget
  • tar -zxvf memcache-
  • cd memcache-
  • phpize
  • ./configure
  • make && make install
  • echo >> /usr/local/lib/php.ini

After restart, to verify if ok, execute the command php -i |grep memcache and the output should be:

memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.prefix_host_key => 0 => 0
memcache.prefix_host_key_remove_subdomain => 0 => 0
memcache.prefix_host_key_remove_www => 1 => 1
memcache.prefix_static_key => no value => no value
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_prefix_host_key => 0 => 0
memcache.session_prefix_host_key_remove_subdomain => 0 => 0
memcache.session_prefix_host_key_remove_www => 1 => 1
memcache.session_prefix_static_key => no value => no value
memcache.session_redundancy => 2 => 2
memcache.session_save_path => no value => no value


Warning! This extension must always be declared after opcache when enabled.

  • cd /root/install
  • wget
  • tar -zxvf xdebug-2.7.2.tgz
  • cd xdebug-2.7.2
  • phpize
  • ./configure –enable-xdebug
  • make && make install
  • echo zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/ >> /usr/local/lib/php.ini

After restart, to verify if ok, execute the command php -i |grep xdebug and the output should be:

xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug …

xls2csv – catdoc

To import xls files we need the catdoc package:

  • yum install catdoc -y


With EVE we are going to use more and more NoSQL databases: the immediate purpose is performance; but in the future we cannot exclude some advantages of this kind of approach: geographical distribution, smaller DB server and upgrade on running environments.

The community edition is enough to work with; since we are in a development environment and we can legally install the enterprise edition that give some tools about query analysis and monitoring we will use this one.

  • wget
  • yum install couchbase-server-enterprise-6.5.1-centos7.x86_64.rpm -y
  • firewall-cmd –zone=public –add-port=8091-8092/tcp –permanent
  • firewall-cmd –zone=public –add-port=4396/tcp –permanent
  • firewall-cmd –zone=public –add-port=21100-21199/tcp –permanent
  • firewall-cmd –zone=public –add-port=11209-11211/tcp –permanent
  • firewall-cmd –reload
  • in the browser go to:
Setup New Cluster
Choose a cluster name and a password: for example “EVE” and “isretail”
Accept terms and go to “Configure Disk…”
Example of configuration 1. Don’t use but the host name or the ip address.
Example of configuration 2

After this step you can add the user “eve” from the dashboard and assign a password.

Now the php client:

  • vi /etc/yum.repos.d/couchbase-Base.repo

name=Couchbase Server

name=Couchbase Server (Community Edition)

name = Couchbase SDK package repository
baseurl =$releasever/$basearch
enabled = 1
gpgcheck = 1

  • yum update
  • cd /root/install
  • yum install libcouchbase-devel libcouchbase2-libevent -y
  • wget
  • tar -zxvf couchbase-2.6.2.tgz
  • cd couchbase-2.6.2
  • phpize
  • ./configure
  • make && make install
  • echo >> /usr/local/lib/php.ini

After restart, to verify if ok, execute the command php -i |grep couchbase and the output should be:

couchbase support => enabled
libcouchbase runtime version => 2.10.6 (git: 61e274aae48b6edeecb081afec843dbe31d72790)
libcouchbase headers version => 2.10.6 (git: 61e274aae48b6edeecb081afec843dbe31d72790)
couchbase.decoder.json_arrays => 0 => 0
couchbase.encoder.compression => off => off
couchbase.encoder.compression_factor => 0.0 => 0.0
couchbase.encoder.compression_threshold => 0 => 0
couchbase.encoder.format => json => json
couchbase.log_level => WARN => WARN
couchbase.pool.max_idle_time_sec => 60 => 60

Sistema de teste automático

  • yum install java-1.8.0-openjdk
  • wget
  • tar -xf Katalon_Studio_Linux_64-6.3.2.tar.gz
  • wget
  • yum install google-chrome-stable-76.0.3809.132-1.x86_64.rpm


Usefull staff.

syntax highlight in vi

  • yum -y install vim-enhanced
  • echo alias vi=vim >> /etc/profile.d/

Instalação em PHP 5.5


O objetivo deste documento é identificar/descrever as melhores práticas de instalação WPMS em sistema operativo RHEL 6.5 ou centOS com a versão do php 5.5. Não contempla a vertente Funcional.

Instalação RHEL 6.5 ou centOS

No caso de instalação em RHEL 6.5 deverá fazer o download em da versão para 64 bits para linux.

No caso de escolher o centOS, deve efectuar uma instalação normal da versão centOs 6.5 de 64 bits para linux, disponivel em .


Sugerimos que se instale o webmin para uma gestão mais prática do servidor.

yum install webmin


Para configuração da rede pode editar os seguintes ficheiros:

  • editar ficheiro /etc/hosts (nome do host)
  • editar ficheiro /etc/sysconfig/network-scripts/ifcfg-eth0 (endereço ip e da placa de rede)
  • editar ficheiro /etc/sysconfig/network

Em alternativa pode-se correr o comando:


onde aparece uma janela de opção de modificar e configurar as opções de rede.

Não esquecer de depois no final de se efetuar “reboot” ao servidor.

Atualização de pacotes de software

Pode utilizar a opção existente no webmin para se fazer uma atualização de pacotes sugeridos pelo próprio sistema operativo. Aconselhamos que efetue a atualização nesses pacotes.

Adicionalmente aos pacotes sugeridos, deverá instalar os seguintes pacotes através dos comandos:

yum groupinstall “Development Tools”
yum install pcre-devel -y
yum install openssl-devel
yum install libxml2-devel
yum install libcurl-devel
yum install libjpeg-devel
yum install libpng-devel

yum install freetype-devel
yum install memcached
yum install pkgconfig
yum install openssl098e
mkdir -p /root/install
cd /root/install
rpm -ivh libmcrypt-*
rpm -ivh mhash-
rpm -ivh mcrypt-2.6.8-10.el6.x86_64.rpm

Instalação do Apache

Como não vamos instalar a versão sugerida pelo repositório não iremos utilizar o comando yum install. Como queremos uma versão especifica iremos fazer download dessa versão. Deverá fazer os seguintes comandos:

cd /root/install


tar xfvz httpd-2.4.10.tar.gz



bunzip2 apr-1.5.1.tar.bz2

tar -xvf apr-1.5.1.tar

mv apr-1.5.1 httpd-2.4.10/srclib/apr

bunzip2 apr-util-1.5.3.tar.bz2

tar -xvf apr-util-1.5.3.tar

mv apr-util-1.5.3 httpd-2.4.10/srclib/apr-util

cd httpd-2.4.10

./configure –prefix=/www –with-mpm=prefork –enable-so –enable-rewrite –enable-vhosts-alias –enablessl
–enable-modules=’unique-id’ –with-included-apr


make install

No final será necessário editar o ficheiro /www/conf/httpd.conf. No anexo 1 indicamos uma sugestão de uma configuração no ficheiro httpd.conf.

Caso tenha a firewall ativa no servidor terá que dar autorização ao porto, normalmente o 80. Pode utilizar o webmin para criar essa regra na firewall. Disponível no menu do webmin em “Networking → Linux Firewall”. Na área nos anexos encontra um print das regras que deverá ter na firewall.

Para arrancar o apache deve ser através do comando:

/www/bin/apachectl start

Para parar o apache deve ser feito através do comando:

/www/bin/apachectl stop

Para fazer restart ao apache deve ser feito através do comando:

/www/bin/apachectl restart

Utilizador wpms

Deverá criar um utilizador wpms, poderá fazê-lo através do webmin. Disponível no menu “System → Users and Groups”.

Instalar Oracle Client

Instalar os pacotes oracle-instantclient11.2-devel- e oracle-instantclient11.2-basic- disponiveis no site da oracle para download.

Depois do download e estando na respetiva pasta dos ficheiros correr o comando:

rpm -ivh oracle-instantclient*

Adicionalmente, fazer os comandos:

setsebool -P httpd_can_network_connect 1

cd /usr/lib/oracle/11.2/client64

mkdir network; mkdir network/admin; cd network/admin

Depois editar o ficheiro tnsnames.ora que se deve encontrar nesta pasta e adaptar à nossa configuração.

Atualizar o ficheiro “/etc/hosts” com os servidores de base de dados.

Verificar variáveis de ambiente de root em “$HOME/.bash_profile”:

export SQLPATH
export NLS_LANG
export PATH

Instalação do php 5.5

Existe várias versões do php 5.5, neste documento iremos exemplificar a versão 5.5.16.

Devemos fazer download do php 5.5 através dos comandos:

cd /root/install/

wget 6 .tar.bz2/from/this/mirror – O php-5.5.16.tar.bz2

bunzip2 php-5.5..tar.bz2 tar -xvf php-5.5..tar

cd php-5.5.*

./configure –prefix=/usr/local –with-config-file-path=/etc –with libdir=/lib64 –enable-fpm –with-xmlrpc –enable-wddx –with-iconv –enable-sockets –enable-mbstring –with-curl –with-mysqli –with-gd –enablesoap –with-freetype-dir=/usr/local/lib –with-mcrypt=/usr/lib64 -with-openssl –with-zlib –enable-pcntl –enable-posix –enable-shmop – enable-sysvsem –enable-sysvshm –enable-sysvmsg –enable-sigchild –enable-zip –with-jpeg-dir=/usr/local/lib –with-png-dir=/usr/local/lib64 –with-zlib-dir=/usr/local/lib64 – with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib


make install

Nota: no comando configure estamos a passar os parâmetros para instalação de Oracle e de mysql. Se não for necessário um deles retirar do comando.

Devemos aplicar o patch “ builder-1.38.txt” no ficheiro Builder.php do PEAR para poder utilizar “pecl”.

O ficheiro Builder.php encontra-se em /usr/local/lib/php/PEAR/Builder.php

Na pasta /root/install/php-5.5.16/sapi/fpm:

  • copiar ficheiro php-fpm.conf para /etc/php-fpm.conf e declarar variaveis globais

env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
env[ORACLE_HOME] = /usr/lib/oracle/11.2/client64
env[LD_LIBRARY_PATH] = /usr/lib/oracle/11.2/client64/lib
env[NLS_LANG] = american_america.we8iso8859p15

  • copiar ficheiro init.d.php-fpm para /etc/init.d/php-fpm
  • copiar ficheiro status.html para o document root do apache /www/htdocs/

Devemos registar o serviço php-fpm para facilitar o start e o stop, através do comando:

/sbin/chkconfig php-fpm on

No ficheiro /etc/init.d/php-fpm alterar a linha “php_fpm_CONF=${prefix}/etc/php-fpm.conf” para “php_fpm_CONF=/etc/php-fpm.conf”

Fazer o download do monitor opcache:


Copiar ficheiro opcache.php para document root do apache /www/htdocs/

No final verificar se o php aponta para o php.ini em /etc/php.ini através do comando:

php -i |grep php.ini

Para arrancar o php deve ser através do comando:

/etc/init.d/php-fpm stop

Para fazer um restart ao php deve ser através do comando:

/etc/init.d/php-fpm restart


Após um upgrade deve ser feito um restart ao php


Instalação através dos comandos:

pecl config-set preferred_state beta

pecl install xhprof

echo “” >> /etc/php.ini


Instalação através dos comandos:

pecl install igbinary

echo “” >> /etc/php.ini


Instalação através dos comandos:

pecl install memcache

Enable memcache session handler support? [yes] : yes.


Especificações mínimas sugeridas: 4GB RAM e Dual-core CPU running at 2GHz for key-value store num sistema a 64 bits.

Através de comandos:

cd /root/install/

wget server-community_2.2.0_x86_64.rpm

rpm -ivh couchbase-server-community_2.2.0_x86_64.rpm

wget -O /etc/yum.repos.d/couchbase.repo x86_64.repo

sudo yum check-update

sudo yum install -y libcouchbase2-libevent libcouchbase-devel

pecl install couchbase

No final actualizar o php.ini com “”

Na firewall através do webmin as portas: 8091:8092, 4369, 21100:21199, 11209:11211

Na configuração do couchbase server e bucket, disponivel através do url http://:8091/index.html

  • piscar “enable auto-failover” na aba “Settings->Fail over”
  • criar o data bucket “WPMS_sessions” (o default pode ser eliminado)
  • criar uma view em “_design/dev_sessions” com o nome “sessions_keys” (o emit é: “emit(, meta.expiration);”) e publicar
  • se não é o primeiro servidor lembrar de activar os outros em “Server Nodes”


Ficheiro httpd.conf

Print Firewall

Print Utilizador wpms

Exemplo tnsnames.ora

# TNSNAMES.ORA Network Configuration File: /oracle/client/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.