How to install Cerb collaboration and email automation on CentOS 8

How to install Cerb collaboration and email automation on CentOS 8

Cerb is a free, open source, web-based collaboration and automation tool for sending mass emails. It is written in PHP and uses MySQL or MariaDB as the database backend. It comes with a simple and easy-to-use web interface that can be used for real-time monitoring, task management and target tracking.

In this tutorial, we will learn how to install and configure Cerb on CentOS 8 server.

prerequisites

  • Server running CentOS 8.
  • Point to a valid domain of the server IP. In this tutorial, we will use the cerb.example.com domain.
  • The root password is configured for the server.

getting Started

Before starting, you need to install EPEL and Remi PHP repository in your system. You can install them with the following command:

dnf install epel-release -ydnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -ydnf module enable php:remi-7.4

Once the two repositories are installed, you can proceed to the next step.

Install LAMP stack

Next, you will need to install Apache, MariaDB, PHP and other required PHP extensions in the server. You can install all components with the following command:

dnf install httpd mariadb-server php php-cli php-zip 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 git unzip wget -y

After installing all the packages, edit the php.ini file and change some settings:

nano /etc/php.ini

Change the following lines with the desired values:

memory_limit = 256M
upload_max_filesize = 32M
post_max_size = 32M
date.timezone = Asia/Kolkata

Save and close the file when you are done. Then, use the following commands to start the Apache and MariaDB services and enable them to start when the system restarts:

systemctl start httpdsystemctl start mariadbsystemctl enable httpdsystemctl enable mariadb

Once completed, you can proceed to the next step.

Configure MariaDB server

First, you need to protect MariaDB and set MariaDB root password. You can do this by running the following command:

mysql_secure_installation

Answer all the questions as follows:

Enter current password for root (enter for none): Enter
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

Once your MariaDB installation is secure, use the following command to log in to MariaDB Shell:

mysql -u root -p

Provide your MariaDB root password when prompted, and then use the following commands to create a database and user for Cerb:

MariaDB [(none)]>CREATE DATABASE cerb;MariaDB [(none)]>GRANT ALL PRIVILEGES ON cerb.* TO 'cerb'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Next, use the following command to clear the privileges and exit from the MariaDB shell:

MariaDB [(none)]>FLUSH PRIVILEGES;MariaDB [(none)]>EXIT;

Once completed, you can proceed to the next step.

Install Postfix

Next, you will need to install the Postfix mail server software package on the server. You can install it by running the following command:

dnf install postfix -y

Once Postfix is ​​installed, use the following command to start the Postfix service and enable it to start when the system restarts:

systemctl start postfixsystemctl enable postfix

Once completed, you can proceed to the next step.

Install composer

Composer is a dependency manager for PHP, used to install required dependencies for the project. You can download the Composer installation script using the following command:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

Next, download the signature of the latest Composer installer from Composer’s Github repository w, and then store it in a variable using the following command:

HASH="$(wget -q -O - https://composer.github.io/installer.sig)"

Next, use the following command to verify the installer script:

php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

If everything is ok, you should see the following output:

Installer verified

Finally, install Composer using the following command:

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

You should get the following output:

All settings correct for using Composer
Downloading...

Composer (version 2.0.7) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

You can verify the Composer version using the following command:

composer --version

You should get the following output:

Composer version 2.0.7 2020-11-13 17:31:06

Once completed, you can proceed to the next step.

Download Cerb

Next, use the following command to download the latest version of Cerb from the Git repository to the Apache root directory:

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

After the download is complete, change the directory to cerb and install the required dependencies using the following command:

cd cerbcomposer install

Next, use the following commands to set the ownership and permissions of the cerb directory:

chown -R apache:apache /var/www/html/cerbchmod -R 755 /var/www/html/cerb

Once completed, you can proceed to the next step.

Configure Apache for Cerb

Next, you will need to create an Apache virtual host configuration file for Cerb. You can create it with the following command:

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

Add the following line:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/var/www/html/cerb"
    ServerName cerb.example.com
    ErrorLog "/var/log/httpd/cerb-error_log"
    CustomLog "/var/log/httpd/cerb-access_log" combined
</VirtualHost>

Save and close the file when you are done. Then, restart the Apache service using the following command:

systemctl restart httpd

You can now verify the status of Apache with the following command:

systemctl status httpd

You should get the following output:

? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           ??php-fpm.conf
   Active: active (running) since Tue 2020-11-17 03:35:53 EST; 7s ago
     Docs: man:httpd.service(8)
 Main PID: 5545 (httpd)
   Status: "Started, listening on: port 80"
    Tasks: 213 (limit: 25014)
   Memory: 28.9M
   CGroup: /system.slice/httpd.service
           ??5545 /usr/sbin/httpd -DFOREGROUND
           ??5547 /usr/sbin/httpd -DFOREGROUND
           ??5548 /usr/sbin/httpd -DFOREGROUND
           ??5549 /usr/sbin/httpd -DFOREGROUND
           ??5550 /usr/sbin/httpd -DFOREGROUND

Nov 17 03:35:52 centos8 systemd[1]: Stopped The Apache HTTP Server.
Nov 17 03:35:52 centos8 systemd[1]: Starting The Apache HTTP Server...

Once completed, you can proceed to the next step.

Configure SELinux and firewall

By default, SELinux is enabled in CentOS 8. Therefore, you will need to configure SELinux for Cerb. You can configure it with the following command:

setsebool -P httpd_can_network_connect 1

Next, you will need to allow ports 80 and 443 to pass through Firewalld. You can use the following commands to do so:

firewall-cmd --zone=public --permanent --add-service=httpfirewall-cmd --zone=public --permanent --add-service=https

Use the following command to reload firewalld to apply all changes:

firewall-cmd --reload

Once completed, you can proceed to the next step.

Visit Cerb Web UI

Now, open your web browser and use the URL to access Cerb. http://cerb.example.com. You should see the following page:

Check all dependencies and click carry on Button. You should see the following page:

Install Cerb

Click on I accept Button to accept the license agreement. You should see the following page:

Cerb database settings

Provide your database information and click check database connection. You should see the following page:

Cerb MTA settings

Provide your SMTP details and click check mail set up. You should see the following page:

create an account

Provide your account information and click carry on Button. You should see the following page:

Medicine packet

Select your package and click carry on Button. You should see the following page:

Welcome to cerb

Click on carry on Button. You should see the following page:

Delete installation folderadvertising

Next, delete the installation directory using the following command:

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

Click on Sign in and start Button. You should see the following page:

Cerb login

Provide your email address and click carry on Button. You should see the following page:

password

Provide your password and click Sign in Button. You should see Cerb default dashboard in the following page:

Welcome to Cyber

in conclusion

Congratulations! You have successfully installed and configured Cerb using Apache on CentOS 8. You can now use the Cerb dashboard to send mass emails. If you have any questions, please feel free to ask me.

Sidebar