Install Zammad Ticketing System on Debian 11

0
304

Welcome to our tutorial on how to install Zammad ticketing system on Debian 11. According to Zammad documentation page, “Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and emails”.

Read about Zammad Ticketing system features on its features page, link provided below.

Zammad Ticketing system features

Install Zammad Ticketing System on Debian 11

Prerequisites

There are a number of requirements that your system must meet (as of this writing) before you can install Zammad Ticketing system on Debian 11.

Refer to these links for Software and Hardware Requirements;

Software Requirements;

Hardware Requirements

Install Zammad Ticketing System on Debian 11

Configure Locales in Debian

In this tutorial, we will be installing Zammad with PostgreSQL which is the recommended database and is supported by default.

As such, if you are using PostgreSQL database backend, you need to enable UTF-8 locale.

To check if UTF-8 local is enabled, run the locale command from terminal as shown below.

locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

If you do not see such a line from the above output;

LANG=en_US.UTF-8

The you need to generate and update the locales.

locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8

This will update the /etc/default/locale file with the set LANG environment variable.

Install Elasticsearch on Debian

Zammad v5.0+ is compatible with Elasticsearch v7.8+. Hence, we install the current Elasticsearch, v7.17 on Debian.

Install the Elasticsearch repository signing key;

apt install gnupg2 -y
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch --no-check-certificate | gpg --dearmor > /etc/apt/trusted.gpg.d/elastic.gpg

Install Elasticsearch repo;

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list

Install Elasticsearch on Debian;

apt update
apt install elasticsearch -y

Install Zammad Ticketing System on Debian 11

Install Zammad repo lists on Debian

wget -qO- https://dl.packager.io/srv/zammad/zammad/key | gpg --dearmor > /etc/apt/trusted.gpg.d/zammad.gpg
echo "deb https://dl.packager.io/srv/deb/zammad/zammad/stable/debian 11 main" > /etc/apt/sources.list.d/zammad.list

Update package cache;

apt update

Next, install Zammad ticketing system on Debian 11 and all the other required packages.

The command below installs Zammad 5.0.3, which is the current stable release as of this writing?

apt install zammad -y

As the installation completes, you will see such an output;

...
# Starting Zammad
Enabling module proxy.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering dependency proxy for proxy_wstunnel:
Module proxy already enabled
Enabling module proxy_wstunnel.
To activate the new configuration, you need to run:
  systemctl restart apache2
# Creating webserver bootstart
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
# Restarting webserver apache2
####################################################################################

Add your fully qualified domain name or public IP to servername directive of
apache2, if this installation is done on a remote server. You have to change:
/etc/apache2/sites-available/zammad.conf and restart apache2 process.
Otherwise just open http://localhost/ in your browser to start using Zammad.

####################################################################################

Also ensure Headers module is enabled;

a2enmod headers

And restart Apache2;

systemctl restart apache2

Sample Zammad Apache site configuration file;

#
# this is the apache config for zammad
#

# security - prevent information disclosure about server version
ServerTokens Prod

<VirtualHost *:80>
    # replace 'localhost' with your fqdn if you want to use zammad from remote
    ServerName localhost

    ## don't loose time with IP address lookups
    HostnameLookups Off

    ## needed for named virtual hosts
    UseCanonicalName Off

    ## configures the footer on server-generated documents
    ServerSignature Off

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy 127.0.0.1:3000>
	Require local
    </Proxy>

    ProxyPass /assets !
    ProxyPass /favicon.ico !
    ProxyPass /apple-touch-icon.png !
    ProxyPass /robots.txt !
    ProxyPass /ws ws://127.0.0.1:6042/
    ProxyPass / http://127.0.0.1:3000/

    # change this line in an SSO setup
    RequestHeader unset X-Forwarded-User

    DocumentRoot "/opt/zammad/public"

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory "/opt/zammad/public">
        Options FollowSymLinks
	Require all granted
    </Directory>

</VirtualHost>
Managing Zammad Services
Zammad
systemctl status zammad
systemctl stop zammad
systemctl start zammad
systemctl restart zammad
systemctl enable zammad
Only web application server
systemctl status zammad-web
systemctl stop zammad-web
systemctl start zammad-web
systemctl restart zammad-web
Only worker process
systemctl status zammad-worker
systemctl stop zammad-worker
systemctl start zammad-worker
systemctl restart zammad-worker
Only websocket server
systemctl status zammad-websocket
systemctl stop zammad-websocket
systemctl start zammad-websocket
systemctl restart zammad-websocket

Configure Elasticsearch for Zammad

Next, configure Elasticsearch search engine for Zammad.

Running Elasticsearch

We have already installed Elasticsearch 7.17. Thus, you can start and enable it to run on system boot by running the command below;

systemctl enable --now elasticsearch

Elasticsearch is now running with the default settings.

You can verify by running the command below;

curl localhost:9200
{
  "name" : "debian11",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Om97h8PsTGOmd4IC0rVAFA",
  "version" : {
    "number" : "7.17.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "bee86328705acaa9a6daede7140defd4d9ec56bd",
    "build_date" : "2022-01-28T08:36:04.875279988Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
Install Elasticsearch Ingest Plugin

The ingest plugin extends Elasticsearch by providing additional ingest node capabilities.

To install the plugin, run the command below;

/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
-> Installing ingest-attachment
-> Downloading ingest-attachment from elastic
[=================================================] 100%   
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
See https://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed ingest-attachment
-> Please restart Elasticsearch to activate any plugins installed
Tune Elasticsearch

Increase the virtual memory map count;

echo vm.max_map_count=262144 >> /etc/sysctl.conf
sysctl -p

Increase the maximum size of an HTTP request body (default is 100MB).

echo "http.max_content_length: 400mb" >> /etc/elasticsearch/elasticsearch.yml

Restart Elasticsearch

systemctl restart elasticsearch
Configure Zammad to use Elasticsearch

Run the command below to define Zammad Elasticsearch URL, rebuild index, adjust the index namespacing as well as the file attachment indexing rules.

zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
zammad run rake searchindex:rebuild
zammad run rails r "Setting.set('es_attachment_ignore', [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe', '.box', '.mbox' ] )"
zammad run rails r "Setting.set('es_attachment_max_size_in_mb', 50)"

Install Postfix for Zammad Email Notifications

To have Zammad deliver email notifications, you can install postfix and choose Internet Site option if prompted.

apt install postfix -y

Accessing Zammad Web Interface

To access Zammad web interface, you need to update some few Apache web server configurations.

Actually, the only change we can make is to make the site available and accessible from outside by changing the value of the ServerName directive (ServerName localhost) to your resolvable fully qualified domain name as per this installation message;

####################################################################################

Add your fully qualified domain name or public IP to servername directive of
apache2, if this installation is done on a remote server. You have to change:
/etc/apache2/sites-available/zammad.conf and restart apache2 process.
Otherwise just open http://localhost/ in your browser to start using Zammad.

####################################################################################

Replace helpdesk.kifarunix-demo.com with your system FQDN.

sed -i '/^.*ServerName/ s/localhost/helpdesk.kifarunix-demo.com/' /etc/apache2/sites-available/zammad.conf

Check Apache syntax and restart it if all is well;

apachectl -t
systemctl restart apache2

You can now access Zammad Web interface by navigating to the URL, http://<server-fqdn>.

You will be welcomed by Zammad setup page;

Install Zammad Ticketing System on Debian 11

Click on Setup new system to proceed.

Setup Zammad Administrator account.

Install Zammad Ticketing System on Debian 11

Next, set you organization name, logo and the zammad url;

Install Zammad Ticketing System on Debian 11

Configure Email notification settings. We use Gmail relay in our case.

Install Zammad Ticketing System on Debian 11

Also, allow less secure app access prior to clicking Continue.

Install Zammad Ticketing System on Debian

You can setup the Zammad comms channels. Click Email to setup email communication channel.

zammad comms channel
Install Zammad Ticketing System on Debian 11

Once you have set your Zammad comms channel, you can choose to invite colleagues.

Once you are done with setup, you should land on the dashboard.

Install Zammad Ticketing System on Debian 11

Dashboard, First Steps

Install Zammad Ticketing System on Debian 11

OverView

Install Zammad Ticketing System on Debian 11

And that is all on how to install Zammad Ticketing System on Debian 11.

You can continue with the setup in order to fully use the Zammad ticketing system.

Reference

Zammad Documentation

Other Tutorials

Install Zammad Ticketing System on Ubuntu 20.04

Install Request Tracker (RT) with MariaDB on CentOS 8

Configure Request Tracker (RT) to send Mails using MSMTP via Office 365 Relay

LEAVE A REPLY

Please enter your comment!
Please enter your name here