Skip to main content

Updating your Deskpro server software - Kiến thức cơ bản / Legacy: Managing Deskpro On-Premise / Server Software - Deskpro Support

Updating your Deskpro server software

Authors list

If you have been running your helpdesk for some time, and only been updating it through the Automatic Updater, you may find that the software which runs your helpdesk is out of date.

Deskpro runs on software which collectively are known as a Web Stack. If you've installed Deskpro through our automated installers, this would likely be either a LEMP Stack, or a WAMP / WIMP stack. As the Automatic Updater can only update the Deskpro software itself, and not this Web Stack, you may need to perform some maintenance on the server itself in order to keep this software up to date and secure.

Before you start

You will need to first identify the operating system of your server. There are different methods to update your software depending on what operating system you are using. 

We also recommend performing a full backup of your helpdesk, as you may encounter issues during this process which require you to roll back to an earlier state.

Finally, we recommend disabling your helpdesk during the update process, to prevent data loss while the work is being performed. You can do this by going to Admin > Setup > Settings, and checking the box 'Disable the helpdesk'

Windows-based operating systems.

For Windows-based servers, you would likely connect to them using a service called RDP, or Remote Desktop Protocol. The Windows server will look similar to a Windows desktop, with the same Desktop Environment (Start menu, explorer bar, windows etc)

To identify which version of Windows you are running, you can either use the keyboard shortcut Win + Pause/Break, or right click on the Start button and select 'System'. This should display your System Properties.

If you are currently running a version of Windows other than Windows Server 2016 or Windows Server 2019 (at the time of writing this article), we recommend rebuilding your Deskpro server on a newer operating system. To do this, you would create a new server with an updated Windows, install Deskpro again using the Windows installer, then migrate your data from your old server to the new server using dputils.

Am I using a WAMP stack or a WIMP Stack?

Deskpro on Windows supports both the WAMP and WIMP web stacks. These are acronyms, and stand for Windows, Apache, MySQL & PHP, or Windows, IIS, MySQL & PHP respectively. The difference between the two are the web handler. You will be running a WAMP stack if you are using Apache, and a WIMP stack if you are using IIS

If you're not sure which stack you are using, you can find out by checking the Deskpro Manager. This can be found by clicking on Start > Configure Deskpro. The Deskpro Manager will display the name and status of the services running on your server,  and the bottom value will show the web handler in use.

Example Deskpro Manager on a server running a WAMP Stack:

Example Deskpro Manager on a server running a WIMP Stack:

Updating a WAMP or WIMP stack

For both the WAMP and WIMP stacks, the easiest way to update them to the latest supported software version is to re-run the Windows Installer on the server. The latest version of the installer can be found here.

When you run the installer, it should recognise that Deskpro is already installed on your server, and run through the process of updating your stack:

For a WAMP stack, this should be all that is required. However, for a WIMP stack, as IIS is provided by Windows itself, updates for that service are handled through Windows Updates. If you have not scheduled regular Windows Updates on your server, then we recommend setting up an update schedule and running any outstanding updates to ensure you have the latest security patches installed. A guide on how to set them up is available here.

Linux-based operating systems.

If you’re using a Linux-based OS, this task is more complicated as there are multiple different distributions (distros) of Linux, and the method to update software differs for each one.

Because of this, our guide will only focus on the distros which our OVA is based on (Ubuntu), and the distros which our automated script supports (Debian/Ubuntu and RHEL/CentOS). We will also assume that you are using the default installation option of a LEMP stack (Linux, nginx, MySQL, PHP), and will provide instructions on how to configure that.

Additionally, as this task requires the modification of configuration files, we highly recommend performing a full system backup, and to make a copy of any configuration files before editing.

Identifying your OS and Version

The easiest way to identify which distro and version you are currently running is by using the following command:

cat /etc/*-release

This will output multiple files, but should include which distribution you are using and the version of that distribution.

Debian / Ubuntu updates (Deskpro OVA)

As Ubuntu is a derivative of the Debian OS, their methods of updating are similar, so the same methods should work for both OSs.

Note: If your version is Ubuntu 14.04 or below, or Debian 8 or below, these are considered End of Life. We recommend either performing a dist-upgrade or building a new server and migrating to avoid any future issues.

Updating the server software

You can update the server software on Debian / Ubuntu with the following command:

sudo apt-get update && sudo apt-get -y upgrade

This will first force the aptitude package manager to check for any outstanding updates to the packages, then will download and install them on your server.

Please make a note of the packages being installed. If you spot a package called linux-firmware within the list, then your server has a kernel update which requires a restart in order to apply.

Installing PHP

At the time of writing, the latest version of PHP which Deskpro supports is PHP 7.4. The latest version of PHP which is provided by the base Ubuntu/Debian repos at present is 7.2, which means if we want to install a newer version of PHP, we will need to use a different repository.

If you installed Deskpro through our automated script or via the OVA, then you should either have the repos the ppa:ondrej/php for Ubuntu or packages.sury.org/php for Debian installed, and should allow us to install the newer versions of PHP.

To install PHP 7.4 and all the required modules, run the following command:

sudo apt-get -y install php7.4 php7.4-bcmath php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-soap php7.4-sqlite3 php7.4-xml php7.4-xsl php7.4-zip

This should install the new PHP packages, but will require configuration before is it being used by Deskpro.

Configuring PHP

As you now have a new version of PHP, you will need to make some configuration changes in order for Deskpro to work. These are either required (setting a date.timezone) or optional (increasing the size of uploads which Deskpro can support), but we recommend making the changes at this point to make the upgrade process smoother.

Before you start making any changes, make copies of the files we will modify with the following commands:

sudo cp /etc/php/7.4/cli/php.ini{,.bak}
sudo cp /etc/php/7.4/fpm/php.ini{,.bak}

Now, to set the required date.timezone value, run the following commands:

sudo sed -i 's/;date.timezone =/date.timezone = UTC/g' /etc/php/7.4/cli/php.ini
sudo sed -i 's/;date.timezone =/date.timezone = UTC/g' /etc/php/7.4/fpm/php.ini

Next, if you require larger file uploads, you can increase the maximum file size with the following commands:

sudo sed -i 's/post_max_size = 8M/post_max_size = 200M/g' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 200M/g' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/memory_limit = 128M/memory_limit = 1024M/g' /etc/php/7.4/fpm/php.ini

This should allow you to upload files up to 200MB in size. You can adjust this as necessary for your needs.

Now the php.ini file has been configured, the service can be started and set to run on boot:

sudo systemctl enable php7.4-fpm && sudo systemctl restart php7.4-fpm

You can confirm that is running correctly by running the following command:

sudo systemctl status -l php7.4-fpm

Configuring nginx

If you are running nginx as your web handler, in order to use the new PHP version, you need to tell it where to find the new php handler (php-fpm). To do this, you need to first find where php-fpm is listening for new instructions. This can be found with the following command:

sudo cat /etc/php/7.4/fpm/pool.d/www.conf | grep "listen ="

This should output a line showing where php-fpm is listening, and should look similar to this:

listen = /run/php/php7.4-fpm.sock

You now need to modify your nginx configuration in order to tell it where to find this. By default, Deskpro will install a file in /etc/nginx/conf.d called deskpro.conf, so back that file up before making modifications:

sudo cp /etc/nginx/conf.d/deskpro.conf{,.bak}

Now, as this file can be different depending on when you installed Deskpro, we recommend manually modifying this file so you can correct any issues.

sudo nano /etc/nginx/conf.d/deskpro.conf

Within this file, look for the line beginning with set $fastcgi_pass, and replace the end of that line with unix:/path/to/fpm/socket. Using the example above, the full line should look as follows:

set $fastcgi_pass unix:/run/php/php7.4.-fpm.sock;

In addition to this, if you have increased the maximum file size which Deskpro can support in your php.ini file earlier, make sure to reflect that size with the client_max_body_size parameter in this file:

client_max_body_size 200M;

Press Ctrl + O then Enter to save, and then Ctrl + X to exit nano.

Before you restart nginx, confirm that there are no syntax issues in the configuration by running the following command:

sudo nginx -t

If you receive confirmation that the syntax is ok and the test is successful, reload nginx to update the config:

sudo systemctl reload nginx

To confirm it has applied, run the following command:

sudo systemctl status -l nginx

You should see a line with a timestamp at the time you ran the previous command saying Reloaded A high performance web server and a reverse proxy server. If you see this, the update was successful and you should be running PHP 7.4 for the web applications.

Configuring Deskpro

Deskpro also makes use of some php commands in the background using the CLI version. The path to this version needs to be configured in the config file config/config.paths.php. If you’re using the default installation path, the following command should open that file:

sudo nano /usr/share/nginx/html/deskpro/config/config.paths.php

Within this file, you need to find the line beginning with $PATHS_CONFIG[‘php_path’] = and replace the path to the new version of PHP:

$PATHS_CONFIG[‘php_path’] = ‘/usr/bin/php7.4’;

Save the file with Ctrl + O then Enter, and close with Ctrl + X

Your helpdesk should now be running PHP 7.4. You can confirm this by logging into your helpdesk and checking the page Admin > Server > PHP Info. If you modified the PHP files to allow for larger uploads, you can also test this at Admin > Server > File Uploads, and click ‘Test a file upload


Hữu ích Unhelpful

Thêm nhận xét

Please log in or register to submit a comment.

Need a password reminder?