How to Install Cerb Collaboration and Email Automation on CentOS 7

Cerb is a free and open source web-based application software for collaboration and email automation. It is written in PHP language and uses MySQL/MariaDB as a database. It is used for sending a large number of emails.

Here, we will explain how to install Cerb on CentOS 7 server.

Requirements

  • A CentOS 7 server installed on your system.
  • A sudo user with root privileges.

1 Getting Started

Let's start by installing EPEL repo and updating the system with the latest stable version.

You can do this by running the following command:

sudo yum install epel-release -y
sudo yum update -y

2 Install LAMP Server

Before starting, you will need to install LAMP server (Apache, MariaDB and PHP) in your system.

First, install Apache and MariaDB with the following command:

sudo yum install httpd mariadb mariadb-server -y

Once the installation is complete, start the Apache and MariaDB service and enable them to start on boot:

sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb

Next, install PHP and other required modules with the following command:

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

Next, you will need to make some changes in /etc/php.ini file:

sudo nano /etc/php.ini

Change the following lines:

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

Save the file when you are finished.

3 Configure Database

First, you will need to secure MariaDB. You can secure it by running mysql_secure_installation script.

sudo mysql_secure_installation

Answer all the questions as shown below:

Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Next, login to MySQL shell and create a database and user for Cerb:

mysql -u root -p

Enter your root password and press Enter, then create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE curbdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON curbdb.* TO 'cerb'@'localhost' IDENTIFIED BY 'cerbpassword';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

4 Install Cerb

Once Database is configured, you will need to install Cerb. You can download the latest version of Cerb from GitHub repository with the following command:

cd /var/www/html/
sudo git clone git://github.com/wgm/cerb.git cerb

Next, provide proper permissions to the cerb directory:

sudo chown -R apache:apache cerb
sudo chmod -R 777 cerb

5 Configure Apache for Cerb

Next, you will need to create a virtual host server block for Cerb. You can do this by creating cerb.conf file inside /etc/httpd/conf.d/ directory:

sudo nano /etc/httpd/conf.d/cerb.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/cerb.conf"
ServerName your-server-ip
ErrorLog "/var/log/httpd/cerb-error_log"
CustomLog "/var/log/httpd/cerb-access_log" combined
<Directory "/var/www/html/cerb/">
Options Indexes MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Save and close the file when you are finished, then restart Apache service:

sudo systemctl restart httpd

6 Access Cerb Web Interface

Before accessing Cerb web interface, you will need to allow HTTP traffic on port 80 through the system firewalld.

You can do this by running the following command:

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

Now open your web browser and type the URL http://your-server-ip, then complete all required steps to finish the installation.

Once Cerb is installed, delete the install directory before using it with the following command:

sudo rm -rf /var/www/html/cerb/install

That's it, you can now easily access and use Cerb through your web browser.

Share this page:

Suggested articles

2 Comment(s)

Add comment

Comments

From: Niek

Good how-to, but never use 777 permissions on files and directories! Use 755 for directories and 644 for files. 

Also the webserver block has a small mistake. 

 

<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/var/www/html/cerb" ServerName your-server-ip ErrorLog "/var/log/httpd/cerb-error_log" CustomLog "/var/log/httpd/cerb-access_log" combined<Directory "/var/www/html/cerb/"> Options Indexes MultiViews FollowSymlinks AllowOverride All Order allow,deny Allow from all</Directory></VirtualHost>

From: Robert M

The Version of PHP included with RHEL/CentOS 7 is to old to run Cerberus 7.3.  You need to include a newer version of php by either using a 3rd party repo or compling and installing a none package version.