How to Install Live Helper Chat on CentOS 7

Table of Contents

Introduction

Live helper chat is a free, flexible, and open-source live support chat for your website. It is written in PHP and uses MySQL/MariaDB to store its data. It provides lots of features such as online user tracking, multiple chats, archive chat, user screenshots, file upload and much more.

In this tutorial, we will learn how to install Live Helper Chat on CentOS 7.

Requirements

  • A server running CentOS 7.
  • A non-root user with sudo privilege.

Getting Started

First you will need to update your OS with the latest release and update its installed packages and repositories using below command:

sudo yum update -y

Once your system is updated, you can proceed to the next step.

Install LAMP

We need to install a LAMP stack.

You can install it by running the following command:

sudo yum install php httpd mariadb mariadb-server php-cli php-mysqli php-mysqlnd php-gd php-bcmath php-pdo php-mbstring -y

Once all the packages are installed, start the Apache and MariaDB services then enable it to start on boot with the following command:

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

Configure MariaDB Database

By default MariaDB installation is not secured, so you will need to secure it first.

To do so, run the following script:

sudo mysql_secure_installation

Answer all the questions as shown below and provide a strong password:

Enter current password for root (enter for none): Enter
Set root password? [Y/n]: Y
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

Log in to MariaDB shell with the following command:

mysql -u root -p

Enter the root password when asked, then create a database for Live Helper Chat:

MariaDB [(none)]>CREATE DATABASE livechatdb;

Create a database user and password for Live Helper Chat:

MariaDB [(none)]>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]>GRANT ALL PRIVILEGES ON livechatdb.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>exit;

Install Live Helper Chat

You can download the latest version of Live Helper Chat from the GitHub repository with the following command:

wget https://github.com/remdex/livehelperchat/archive/master.zip

Once the download is complete, extract the downloaded archive with the following command:

unzip master.zip

Move the extracted directory to the Apache web root directory:

sudo mv livehelperchat-master /var/www/html/livechat

Give proper permissions to the livechat directory:

sudo chown -R apache:apache /var/www/html/livechat

Configure Apache for Live Helper Chat

Now we will need to configure an Apache virtual host for Live Helper Chat.

You can do this by creating /etc/httpd/conf.d/livechat.conf file:

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

Add the following line:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot "/var/www/html/livechat/lhc_web"
    ServerName example.com
    ErrorLog "/var/log/httpd/livechat-error_log"
    CustomLog "/var/log/httpd/livechat-access_log" combined
</VirtualHost>

Save and close the file when you are finished.

You will also need to enable mod_rewrite in Apache. You can do this by editing the /etc/httpd/conf/httpd.conf file:

sudo nano /etc/httpd/conf/httpd.conf

Change the following line:

<Directory "/var/www/html">
 AllowOverride All

Save the file and restart Apache service:

sudo systemctl restart httpd

Next we will need to allow HTTP on port 80 through the local firewall, firewalld. You can do this by running the following command:

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

Access Live Helper Chat

It is time to complete the Live Helper Chat installation using a web browser.

Open your favourite web browser and type the URL http://your-server-ip, you should see the Live Helper Chat installation wizard as below:

Live Helper Chat Installation Screen

Click on the Next button to start the installation, you should see the following page:

Live Helper Chat Database Info

Provide database information and click on the Next button. You should see the following page:

Live Helper Chat App Settings

Provide admin username, password, email address and other details, then click on the Finish installation button, you should see the following page:

Live Helper Chat Installation Complete

Click on Login here button to log in Live Helper Chat web interface as shown below:

Live Helper Chat Login Page

Provide your admin username and password, then click on Login button, you should see the Live Helper Chat default dashboard as below:

Live Helper Chat Dashboard

Summary

Congratulation! You have successfully installed Live Helper Chat on a CentOS 7 server.

You are welcome to add a comment below or start a new discussion in the community section of this site if you have any questions.