Our pre-installed version of DirectAdmin comes with CentOS as the underlying operating system. By default, CentOS 7 makes use of older versions of software (though with recent security updates) because it prefers stability over new features.
For that reason, not all software on your VPS is up-to-date. You can check the current versions on your VPS by clicking ‘Admin Level’> ‘Admin Tools’> ‘System Information’ in DirectAdmin. You will then see an overview as in the screenshot below.
Especially CMS systems like WordPress often require newer versions of PHP and MySQL to function. It is therefore advisable to update your VPS.
Updating centos
You can update CentOS separately from your DirectAdmin installation. Connect to your VPS via the VPS console in your control panel or via SSH.
Then check if new updates for CentOS are available, and install them directly with the command:
yum update
When asked for permission, click ‘y‘ followed by ‘Enter‘ (alternatively use the command yum -y update). CentOS will now download and install all updates.
Updating DirectAdmin
DirectAdmin needs to be updated separately from CentOS from the ‘custombuild’ process. Connect to your VPS via the VPS console in your control panel or via SSH.
Run the commands below using SSH
cd /usr/local/directadmin/custombuild ./build update
Check what new updates are available:
./build versions
This command displays an overview of currently installed and possible updates.
This will install any updates of software listed in the previous command. The custombuild-command is a process that compiles the software. This update process may take some time.
./build update_versions
Updating PHP
In this section, we show you how to update your PHP. For this manual, we assume that you want to be able to use PHP 7.2 and 7.1 on your VPS. Older PHP versions no longer receive security updates.
Log in as root via the console in your control panel or using SSH. Execute the following commands:
cd /usr/local/directadmin/custombuild ./build update ./build set php1_release 7.2 ./build set php2_release 7.1 ./build set php1_mode php-fpm ./build set php2_mode php-fpm ./build set mod_ruid2 no
We adjust the primary version to 7.2. However, you are free to adjust this or the php2_release to another version.
Next, process the changes as follows:
./build php n ./build rewrite_confs
Apache should automatically restart after updating, but should this not happen, restart Apache manually:
systemctl restart httpd
Further on in these tutorials, we show you how to switch between these PHP versions in DirectAdmin.
Updating MySQL
DirectAdmin uses MariaDB as MySQL server by default. In this manual, we will update MariaDB to 10.3. MariaDB 10.3 largely corresponds to MySQL 5.7 (see this page for similarities and differences). There are newer versions, but they are not officially supported by DirectAdmin at the time of writing.
Log in via the console in the control panel or using SSH as root and execute the following commands:
cd /usr/local/directadmin/custombuild
./build set mariadb 10.3
./build set mysql_inst mariadb
./build set mysql_backup yes
./build update
./build mariadb
The ./build set mysql_backup yes option is optional: with a new VPS there is no database yet to be backed up, so you do not have to do this.
After a mysql update you always have to compile PHP again with:
./build php n
Your MariaDB installation has now been updated to version 10.3.