This is the third part of our DirectAdmin Tutorial Series. If you are planning a new VPS, then we recommend starting with part 1 and to not skip any parts.
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. For example, the latest version of DirectAdmin (1.52.1) at the time of writing is supplied with PHP 5.6.32 and MariaDB (MySQL) 5.5.41. 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.
- Perform the steps in this article as root / sudo user.
- This is relatively complex material. If you use the steps below to update an existing (instead of new) VPS, create a snapshot of your VPS first before you follow the steps below. That way you always have a snapshot to fall back on if it turns out that a change creates a problem.
- 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:
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.
cd /usr/local/directadmin/custombuild ./build update ./build set php1_release 5.6
Please note: ./build set php1_release defaults to 5.5, hence this extra addition (./build set php1_release 5.6) to indicate that you want to use PHP 5.6. You are free to adjust this to 5.3/5.4/5.5/5.6/7.0/7.1.
First check if new updates are available:
This command displays an overview of currently installed and possible updates.
This will install any updates of software within DirectAdmin. The custombuild-command is a process that compiles the software. This update process may take some time.
- 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.1 and 5.6 on your VPS.
cd /usr/local/directadmin/custombuild ./build update ./build set php1_release 5.6 ./build set php2_release 7.1 ./build set php1_mode php-fpm ./build set php2_mode php-fpm ./build set mod_ruid2 no
/build set php1_release is set to 5.5 by default. We adjust the version to 5.6. However, you are free to adjust this to 5.3/5.4/5.5/5.6/7.0/7.1 and to also adjust php2_release to one of these random versions.
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
/sbin/service httpd restart
Finally, close the custombuild with the command:
Further on in this manual, we show you how to change the PHP version in DirectAdmin.
- Updating SQL
DirectAdmin uses MariaDB (5.5.59) as MySQL server by default. In this manual, we will update MariaDB to 10.1. MariaDB 10.1 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.1 ./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.1.31.
Next to being safe, your VPS is now completely up to date and ready to link a domain. Click here to continue to Part 4: Linking domains and subdomains to learn how to link your (sub)domain to DirectAdmin.
Should you have any questions left regarding this article, do not hesitate to contact our support department. You can reach them via the ‘Contact Us’ button at the bottom of this page.
If you want to discuss this article with other users, please leave a message under 'Comments'.