Lets start by creating MySQL user and a database for WordPress:
mysql -u root -p
mysql> CREATE DATABASE helpdesk DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Note: Every MySQL statement must end in a semi-colon (;). Check to make sure this is present if you are running into any issues.
mysql> GRANT ALL ON helpdesk.* TO 'helpdeskuser'@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
Install additional PHP Plugins and restart Apache service:
sudo apt update
sudo apt install php-imap
sudo systemctl restart apache2
Now let’s enable .htaccess overrides:
sudo nano /etc/apache2/sites-available/helpdesk.harryvasanth.com.conf
<VirtualHost *:80>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/helpdesk/htdocs"
ServerName helpdesk.harryvasanth.com
ServerAlias desk.harryvasanth.com support.harryvasanth.com
ServerAdmin someone@somewhere.com
ErrorLog /var/log/apache2/helpdesk.harryvasanth.com-error.log
CustomLog /var/log/apache2/helpdesk.harryvasanth.com-access.log combined
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/helpdesk/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Download OpenSupports and extract it to /var/www/helpdesk
:
mkdir /var/www/helpdesk/htdocs
cd /var/www/helpdesk/htdocs
# Download and extract the latest WordPress version
curl -O https://github.com/opensupports/opensupports/releases/download/v4.6.1/opensupports_v4.6.1.zip
unzip opensupports_v4.6.1.zip
# Create .htaccess
touch /var/www/helpdesk/htdocs/.htaccess
Finally visit your using your web browser to finish setting up OpenSupports:
https://helpdesk.harryvasanth.com
IMAP settings should be something similar
{mail.harryvasanth.com:143/novalidate-cert}INBOX
Add the following entry in crontab -e
in order to do the IMAP post request every minute
*/1 * * * * /usr/bin/curl -X POST -k -i --data "token=gxqWBr75f00xXtvreG13" https://helpdesk.harryvasanth.com/api/system/email-polling &>/dev/null