How to Install Cerb on CentOS 7

Updated on March 10, 2017
How to Install Cerb on CentOS 7 header image

Cerb is an open-source application for web-based collaboration and automation. Cerb can also be used for sending a high volume of emails. Cerb is written in PHP and uses MySQL/MariaDB to store its data. In this tutorial, you will learn how to install Cerb on CentOS 7.

Prerequisites

  • A Vultr CentOS 7 server instance.
  • A sudo user.

Step 1: System update

Before installing any packages on a CentOS server instance, it is recommended to update the system. Login using the sudo user and run the following commands to update the system.

sudo yum -y install epel-release
sudo yum -y update
sudo shutdown -r now

Once the system has finished rebooting, log in again as the sudo user and proceed to the next step.

Step 2: Install Apache web server

Run the following command to install the Apache web server.

sudo yum -y install httpd

Once Apache is installed, run the following command to start Apache and enable it to automatically start at boot time.

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install PHP 7

Cerb is compatible with any version of PHP greater than 5.5. You can use the latest version of PHP 7 in order to get maximum performance. Add and enable the Remi repository on your system.

sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php71

Install the latest version of PHP with Cerb's required modules.

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

Edit /etc/php.ini using your favorite editor.

sudo nano /etc/php.ini

Update the following lines.

memory_limit = 128M         # 128M or Higher according to the memory available
upload_max_filesize = 2M    # 32M or Higher
post_max_size = 8M          # 32M or Higher
;upload_tmp_dir =           # Uncomment and change it to upload_tmp_dir = /tmp

Save the file and exit from the text editor. Then, restart Apache.

sudo systemctl restart httpd.service

Step 4: Install MariaDB

Install MariaDB using the following command. MariaDB is a fork of MySQL.

sudo yum -y install mariadb mariadb-server

Once MariaDB has been installed, run the following command to start MariaDB and enable it to automatically start on boot.

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Now secure your MariaDB installation using the following command.

sudo mysql_secure_installation

You will be asked for the current root password. As we have just installed MariaDB, the root password is not set. Press the "Enter" key to proceed. Set a strong root password for your MySQL server and answer Y for all of the other questions asked. All the questions asked are self explanatory.

Step 5: Create a database for Cerb

Login to the MySQL shell as the root user using the following command.

mysql -u root -p

Provide the password for root user you just set earlier.

Now run the following queries to create the database and database user for the Cerb installation.

CREATE DATABASE cerb_data;
CREATE USER 'cerb_user'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON cerb_data.* TO 'cerb_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Make sure that you use a semicolon at the end of each query above. You can replace the database name cerb_data and database username cerb_user according to your needs. Be sure to change StrongPassword with a very strong password.

Step 6: Install Cerb

Install git if you do not have it already installed.

sudo yum -y install git

Now, switch to the webroot directory of Apache and clone the latest version of Cerb using the following command.

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

Provide appropriate ownership and file permissions using the following commands.

cd /var/www/html/cerb
sudo chown -R apache:apache .
sudo chmod -R u+w framework.config.php storage

You may also need to allow HTTP traffic on port 80 through the system firewall.

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

Now complete the installation using a web browser.

Step 7: Finish installation

Go to the following link using your favorite web browser.

http://192.0.2.1/cerb

Replace 192.0.2.1 with the IP address of your server. If you have followed the tutorial correctly, you should have all of the requirements satisfied. On the "Database Setup" interface, choose the driver MySQLi and engine InnoDB. Also provide the database name and credentials that you have created earlier. Once the database connection is checked, it will ask to provide details of your SMTP server to send outgoing emails. Finally, create the administrator user.

Cerb is now installed on your server.

Run the following command to delete the install directory before using it.

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

You can now use Cerb through your web browser.