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. 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.
- 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
Check what new updates are available:
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.
- 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.0 on your VPS. Older PHP versions no longer receive security updates.
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
/sbin/service httpd restart
- Further on in these tutorials, we show you how to switch between these PHP versions in DirectAdmin.
- Updating SQL
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.
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'.