HomeInstallation and Upgrade ManualHelpSpot 5 InstallationInstalling HelpSpot 5 on RedHat 9

1.5. Installing HelpSpot 5 on RedHat 9

Install PHP and NGINX

First we need to add the repositories needed to install the latest version of php.

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
sudo dnf -y install http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y
sudo dnf module reset php -y

Next install PHP 8.3.

sudo dnf module install php:remi-8.3
sudo dnf install php-fpm php-mysqlnd php-imap php-ldap php-pdo php-mcrypt php-gd php-xml php-curl

Now we'll install NGINX for our web server.

sudo dnf install nginx -y
sudo systemctl enable --now nginx php-fpm

Edit the www.conf config for php-fpm.

sudo vi /etc/php-fpm.d/www.conf

Make these changes:

; 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

listen.owner = nginx
listen.group = nginx
listen.mode = 0660

Next we'll edit the default nginx.conf file.

sudo vi /etc/nginx/nginx.conf

Edit the root directory that NGINX serves.

root           /usr/share/nginx/html/helpspot/public;

Add the location directive to serve pretty URLs immediately after the root configuration.

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

Comment out these lines.

#           error_page 404 /404.html;
#           location = /404.html {
#           }

#           error_page 500 502 503 504 /50x.html;
#           location = /50x.html {
#           }

Save your nginx.conf changes and then reload nginx and php-fpm.

sudo nginx -t
sudo systemctl reload nginx
sudo systemctl reload php-fpm

Configure MySQL

sudo dnf install mysql-server
sudo systemctl enable mysqld
sudo systemctl start mysqld

Configure Mysql.

sudo mysql_secure_installation

Now we'll create our database.

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

Download and Install HelpSpot

cd /usr/share/nginx/html
sudo curl -o helpspot.zip https://s3.amazonaws.com/helpspot-downloads/5.4.10/helpspot.zip
sudo unzip -q helpspot.zip
sudo mv helpspot_5.4.10/ helpspot
cd helpspot
sudo cp .env.example .env

Next we'll edit the .env and add the settings that reflect the environment that we've setup. Enter the appropriate app url for you server and the database credentials set up previously. All other settings can stay the same

sudo vi .env

To install helpspot we need to have the license file for HelpSpot in the helpspot directory. In this example we can just make a new file and paste it in. You can also transfer it to your server if you wish.

sudo vi licensefile.txt
#paste your license code into this file

Now we need to set the permissions on our HelpSpot directories.

sudo chown -R nginx:nginx /usr/share/nginx/html/helpspot
sudo chcon -Rv --user=system_u --role=object_r --type=httpd_sys_content_t /usr/share/nginx/html/helpspot
sudo chcon -Rv --type=httpd_sys_content_rw_t /usr/share/nginx/html/helpspot/bootstrap
sudo chcon -Rv --type=httpd_sys_content_rw_t /usr/share/nginx/html/helpspot/storage

Finally, we'll run the HelpSpot installer.

sudo -u nginx php hs install

Configure Cron

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

* * * * * nginx php /usr/share/nginx/html/helpspot/hs schedule:run 

Check that it's being run:

sudo tail -f /var/log/cron

Configure Queue

First we need to install Supervisor that manages our queue worker processes.

sudo dnf install supervisor
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 /usr/share/nginx/html/helpspot/hs queue:listen database --queue=high,default --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=nginx
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
Linux  /  Red Hat  / 

This page was: Helpful | Not Helpful