HomeInstallation and Upgrade ManualHelpSpot 5 InstallationInstalling HelpSpot 5 On Redhat 8

1.4. Installing HelpSpot 5 On Redhat 8

This install guide assumes you are using the latest version of RedHat Server 8 (8.10).

HelpSpot 5 Server Setup

On our RedHat 8 server, we'll install and setup the following:

Install

On RedHat 8:

sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

sudo dnf module list php

sudo dnf module enable -y php:remi-8.3

sudo dnf install unzip vim mysql-server nginx supervisor \
    php-cli php-common php-fpm php-mysqlnd php-imap php-ldap \
    php-pdo php-mcrypt php-gd php-xml php-curl

On Amazon Linux 2:

sudo amazon-linux-extras enable php8.3 nginx1 epel

sudo yum install -y epel-release

sudo yum install -y unzip vim mariadb-server nginx supervisor \
    php-cli php-common php-fpm php-mysqlnd php-imap php-ldap \
    php-pdo php-mcrypt php-gd php-xml php-curl

Configure MySQL

On Redhat:

sudo systemctl enable mysqld
sudo systemctl start mysqld

 

sudo mysql_secure_installation

 

mysql -u root -p

 

create database helpspot charset utf8mb4;

 

create user helpspot@'localhost' identified by 'secret';

 

grant all privileges on helpspot.* to helpspot@'localhost'; 

On Amazon Linux 2:

sudo systemctl enable mariadb
sudo systemctl start mariadb

sudo mysql_secure_installation

mysql -u root -p

create database helpspot charset utf8mb4;
create user helpspot@'localhost' identified by 'secret';
grant all privileges on helpspot.* to helpspot@'localhost';

Configure PHP

File /etc/php.ini:

max_execution_time = 120
max_input_time = 120
memory_limit = 256M
post_max_size = 256M
upload_max_filesize = 100M
date.timezone = UTC

File /etc/php-fpm.d/www.conf:

; Note: Change user and group from apache to nginx
; RPM: apache user chosen to provide access to the same directories as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
; Note: Socket file is /run/php-fpm/www.sock pm.max_requests = 500
sudo systemctl enable php-fpm
sudo systemctl start php-fpm

Configure Nginx

sudo systemctl enable nginx
sudo systemctl start nginx

Test it out in the browser! We can create a PHP file to see that it is setup to run PHP applications already:

Create file /usr/share/nginx/html/index.php with:

<?php
phpinfo();

And we'll see that page load without further configuration.

The only change we'll make then is to set a new root to point to where HelpSpot will be installed to.

Edit file /etc/nginx/nginx.conf and change the root:

root         /var/www/helpspot/public;

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

Then reload Nginx:

# Test nginx configuration
sudo nginx -t

# Reload Nginx
sudo systemctl reload nginx

Install HelpSpot

cd ~/
curl -o helpspot.zip https://s3.amazonaws.com/helpspot-downloads/5.4.6/helpspot.zip

sudo mv helpspot.zip /var/www
cd /var/www

sudo unzip -q helpspot.zip
sudo mv helpspot_5.4.6 helpspot

cd helpspot
sudo cp .env.example .env

# Update .env file.
# Enter you database username and password setup previously and the APP URL. The app key will be created automatically during installation.
sudo vim .env # Change owner of files sudo chown -R nginx:nginx /var/www/helpspot sudo chcon -Rv --user=system_u --role=object_r --type=httpd_sys_content_t /var/www/helpspot sudo chcon -Rv --type=httpd_sys_content_rw_t /var/www/helpspot/bootstrap sudo chcon -Rv --type=httpd_sys_content_rw_t /var/www/helpspot/storage
# Download your helpspot license file and place it in /var/www/helpspot/ so that it can be easily referenced during the install process.
sudo -u nginx php hs install

Configure Cron

Create file /etc/cron.d/helpspot and add the following:

* * * * * nginx php /var/www/helpspot/hs schedule:run

Check that it's being run:

sudo tail -f /var/log/cron

Configure Queue

We'll enable/start the service supervisord:

sudo systemctl enable supervisord
sudo systemctl start supervisord

Create file /etc/supervisord.d/helpspot.ini with contents:

[program:helpspot]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/helpspot/hs queue:listen database --queue=high,default --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=apache
numprocs=2
redirect_stderr=true
stdout_logfile=/var/log/helpspot-worker.log

Then run the following to start the workers:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start helpspot:*

Keep an eye on your error log to spot any issues at storage/logs/helpspot.log, e.g. /var/www/helpspot/storage/logs/helpspot.log.

Knowledge Tags
Red Hat  /  Linux  / 

This page was: Helpful | Not Helpful