At work I mainly see servers running DirectAdmin which is a very good and easy-to-use controlpanel for people that want to offer hosting to their customers. DirectAdmin’s approach of software differs from others because DirectAdmin delivers all used software by themselves. This means that, besides from keeping your OS up-to-date, you have to update all DirectAdmin related software as well and this is a issue that’s pretty easy to forget and forgotten. DirectAdmin has a very simple update manager named “custombuild” which can apply all of it’s own updates for you.
This post will explain how to let DirectAdmin check for updates, show the updates that are available and apply them.
In this post I assume you have SSH root access or at least a sudo account.
Apply the operating system updates:
Although I won’t go in-depth about OS-updates here, it’s still wise to apply them before updating DirectAdmin.
For Debian/Ubuntu based systems:
apt-get update && apt-get dist-upgrade
For RedHat/CentOS based systems:
Updating the custombuild software list:
DirectAdmin comes with custombuild which is the update manager in this case. First we want to navigate to the custombuild directory:
We want to clean all downloaded software sources first to save space and build issues:
Now we want to update the software list:
Show the available updates:
Now that the software list is updated we can see which updates can be applied, custombuild has a function for this:
Latest version of DirectAdmin: 1.49.1
Installed version of DirectAdmin: 1.44.3
DirectAdmin 1.44.3 to 1.49.1 update is available.
Latest version of Apache: 2.4.18
Installed version of Apache: 2.4.7
Apache 2.4.7 to 2.4.18 update is available.
Latest version of PCRE: 8.20
Installed version of PCRE: 8.20
Latest version of curl: 7.47.0
Installed version of curl: 7.34.0
cURL 7.34.0 to 7.47.0 update is available.
Latest version of FreeType: 2.6.2
Installed version of FreeType: 2.5.2
FreeType 2.5.2 to 2.6.2 update is available.
Latest version of dovecot: 2.2.21
Installed version of dovecot: 2.2.10
Dovecot 2.2.10 to 2.2.21 update is available.
Latest version of Exim: 4.86
Installed version of Exim: 4.82
Exim 4.82 to 4.86 update is available.
Latest version of MySQL: 5.5.48
Installed version of MySQL: 5.5.35
MySQL 5.5.35 to 5.5.48 update is available.
Latest version of PHP (CLI): 5.3.29
Installed version of PHP (CLI): 5.3.28
PHP5 (CLI) 5.3.28 to 5.3.29 update is available.
Latest version of RoundCube webmail: 1.1.4
Installed version of RoundCube webmail: 0.9.5
RoundCube webmail 0.9.5 to 1.1.4 update is available.
Latest version of phpMyAdmin: 184.108.40.206-all-languages
Installed version of phpMyAdmin: 220.127.116.11-all-languages
Latest version of SquirrelMail: 1.4.22
Installed version of SquirrelMail: 1.4.22
If you want to update all the available versions run: /usr/local/directadmin/custombuild/build update_versions
As you can see there are alot of updates pending on this random server I’ve picked, now we want to apply all the updates that are shown above.
Updating the software using custombuild:
Now we want to apply all mentioned updates on the server. This can be performed with:
This update process may take some time as all software is compiled on the server and usually takes from 5 until 60 minutes to complete and depends on the amount of updates that needs to be applied and the speed/resources of the server.
A note on the updates:
For Apache, PHP and MySQL only the subreleases are applied. As seen in this case PHP will be updated from 5.3.28 to 5.3.29 and MySQL from 5.5.35 to 5.5.48. Custombuild will never upgrade this to a newer major release unless you explicitly specify it. All other software will be updated to the latest version DirectAdmin delivers at that time.
Also note that any 3rd party compiled modules for PHP and Apache may need to recompiled manually if PHP and/or Apache was updated. Refer to the installation manual of the module to see how this can be achieved.
In this particular case PHP is pretty outdated and is EOL as we speak. Here PHP should be updated to at least 5.6 but since this is not my machine I cannot force this.
If you want to update PHP, MySQL or Apache to a newer major release you can specify this in the “options.conf” inside the custombuild directory. Make sure that your websites are capable of running on the newer version(s) that you want to apply or that you need to update the websites afterwards or before starting the update.
Troubleshooting update issues:
Most of the time the updates will apply without errors, but are always possible to receive, below are a couple of cases that may show up:
One of the most common errors is when compiling PHP and/or FreeType which will halt the update process about
libpng. This can be easily be solved by running the update for these parts of software first:
./build libxml2 d
./build libpng d
./build freetype d
Once finished you can resume the update process:
The update of MySQL may be interrupted about libaio missing on your system which mainly occurs on RedHat/CentOS based systems, it is easy to solve it by installing libaio:
yum install libaio libaio-devel
Once finished you can resume the update process: