How to update Apache in DirectAdmin

DirectAdmin is a shared web hosting panel used on Linux systems for graphical website administration. You can use it in conjunction with other server software such as Apache.

However, when using DirectAdmin with Apache, it is very important that you update Apache regularly. This will improve the security of your site and prevent it from crashing and fall prey to any security holes that were fixed in the latest version. We’ve put together this guide to help you quickly update your Apache installation when using DirectAdmin. You can also use it to help update any additional software that you use with DirectAdmin.


Make sure you have everything before following this tutorial:

  • 1 server with DirectAdmin and CustomBuild installed.
  • root access to node or one sudo not superuser


First, go to the CustomBuild directory of your DirectAdmin installation.

                      cd /usr/local/directadmin/custombuild

Now, update all packages on your system. At a minimum, you should get the latest version of Apache.

                      ./build update

You can upgrade Apache by entering the following command. Always make sure you have the latest version of Apache to reduce the risk of a security breach.

                      ./build apache

Now you need to build your PHP installation to make sure your files are updated as well.

                      ./build php n

After this is done, the next step is to restore all configuration files.

                      ./build rewrite_confs

The final task is to restart the Apache web server to apply the latest changes.

                      service httpd restart

Check the version. Apache should tell you that this is the newest version you downloaded. You can check your current Apache version by entering the following command:

                      httpd -v


Building Apache for DirectAdmin is not as easy as running apt-get or yum command, but it is absolutely essential to keep your server and any hosted material secure. If you want a faster way to automatically update Apache, you can create a script that runs these commands.

Related Posts