How to install Cerb with Apache as web server on CentOS 7

install cerb - logo

Introduction

Cerb is a workflow and email automation system, excellent for large teams. Cerb is written in PHP and uses either MySQL or MariaDB as a database system.

Its main features are:

  • High-volume email management
  • Shared mailboxes
  • Dashboards for real-time monitoring and goal tracking
  • Notifications
  • Task management
  • Mobile functionality
  • REST-based API

Cerb is evolving based on 15+ years of community feedback. Although the source code is available on GitHub, the software is distributed under a commercial open source license, called Devblocks Public License (DPL). It should be noted that licensing is based on the maximum number of workers able to log in simultaneously.

Server configuration

In the following steps we’ll look at how to install and configure the tools required by Cerb: Apache, MariaDB and PHP.

First of all, let’s install EPEL:

# yum -y install epel-release

Install Apache

Now, we’ll install the Apache Web Server with yum:

# yum install -y httpd

Start  Apache and enable it to start at boot time using systemd:

# systemctl start httpd
# systemctl enable httpd

Check its status:

# systemctl status httpd

httpd.service - The Apache HTTP Server
 Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
 Active: active (running)

Install PHP

As stated in the introduction, Cerb is written in PHP. More specifically, we’ll need PHP 5.5 (or a later version) with the following extensions:

  • curl
  • dom
  • gd
  • imap
  • pcre
  • session
  • simplexml
  • spl
  • xml
  • json
  • mailparse
  • mbstring
  • mysqli
  • openssl

In this tutorial, we’ll be using PHP 7. To install this version, add the Remi repository using the following commands:

# rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Enable the repository, like this:

# yum-config-manager --enable remi-php71

Now, it’s possible to install PHP with all the extensions mentioned above:

# yum install -y php php-curl php-mysqli php-openssl php-dom php-gd php-json php-pcre php-imap php-mbstring php-session php-simplexml php-xml php-spl php-mailparse

We’ll need to change some settings in php.ini for Cerb. In particular, the file_uploadsmemory_limitupload_max_filesize and post_max_size lines, as follows:

file_uploads = On
upload_max_filesize = 64M
memory_limit = 256M
post_max_size = 64M
upload_tmp_dir = /tmp

Save these changes, exit and restart Apache:

# systemctl restart httpd

Install MariaDB

Now, we’ll install MariaDB with yum:

# yum install -y mariadb mariadb-server

Start MariaDB and configure the root account:

# systemctl start mariadb
# mysql_secure_installation

During this process you’ll be asked several questions, respond as we have here:

New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

Remove anonymous users? [Y/n] 
 ... Success!

Disallow root login remotely? [Y/n] 
 ... Success!


Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reload privilege tables now? [Y/n] 
 ... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Create a new database

Next we’ll create a database for Cerb. First, log in to the MariaDB shell:

# mysql -u root -p

Create the database and a new user:

MariaDB [(none)]> CREATE DATABASE cerbdb;
MariaDB [(none)]> CREATE USER 'cerbusr'@'localhost' IDENTIFIED BY 'usr_strong_password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON cerbdb.* TO 'cerb'@'localhost' IDENTIFIED BY 'usr_strong_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Cerb installation

The next step is to download and install Cerb. You’ll want to switch to the web root directory in the server:

# cd /var/www/html

Clone the Cerb repository, using git:

# git clone git://github.com/wgm/cerb.git cerb

Make sure that Cerb’s files are owned by the web server’s user and group which, with Apache as the web server, are both www-data.

# cd cerb
# chown-R www-data:www-data .
#chmod -R u+w framework.config.php storage

framework.config.php is the configuration file, while storage/ is where third-party plugins, attachments, temporary files and caches are stored.

Now, allow HTTP traffic on port 80 through the system firewall:

# firewall-cmd --zone=public --permanent --add-service=http
# firewall-cmd --reload

The last step is to go to: http://localhost/cerb and finish the Cerb installation. Once complete, Cerb will be ready for use!

Conclusions

In this tutorial we have seen how easy can be to install and configure Cerb in a server based on CentOS 7 and Apache, using MariaDB as database. Just follow the guide and start using Cerb! In a fast-paced and dynamic work environment, a workflow and email automation system like Cerb can make or break your work day. It’s worth it!