Cloud House Technologies Logo
CloudHouse Technologies
HomeServicesProjectsBlogAbout UsCareersContact UsLogin
    Cloud House Technologies Logo
    CloudHouse Technologies
    HomeServicesProjectsBlogAbout UsCareersContact UsLogin

    How to Use DirectAdmin CustomBuild 2.0 to Update Apache, PHP & Services

    Priya

    Content Writer & Researcher

    Last Updated: 21 June 2026
    How to Use DirectAdmin CustomBuild 2.0 to Update Apache, PHP & Services
    🖥️

    Nervous About Running CustomBuild Updates on a Live Server?

    CustomBuild updates on production servers require careful sequencing and rollback planning. CloudHouse's DirectAdmin management team handles stack updates during scheduled maintenance windows so you never face unexpected downtime.

    🔧 Book Free DiagnosisCall NowWhatsApp
    🖥️12,400+PCs Fixed
    ⭐4.9★Google Rating
    ⚡<15 minAvg. Response
    🛡️ISO 27001Certified

    DirectAdmin's CustomBuild 2.0 is the tool that controls your entire server software stack — Apache, PHP, MySQL, Nginx, and more. Running updates through CustomBuild incorrectly can take an entire hosting server offline. Done correctly, it keeps your stack current, secure, and running the latest stable versions. This guide covers the full CustomBuild 2.0 workflow: verifying your current build state, running updates safely, switching PHP versions, and recovering from a failed build.

    What Is DirectAdmin CustomBuild 2.0?

    CustomBuild 2.0 is a command-line tool located at /usr/local/directadmin/custombuild/build. It compiles and installs web server components from source or from pre-compiled binaries. Unlike package managers like yum or apt, CustomBuild manages the entire LAMP stack in a way that integrates with DirectAdmin's configuration — so Apache virtual hosts, PHP handlers, and SSL settings all stay consistent after updates.

    CustomBuild 2.0 improvements over 1.x:

    • Per-user PHP version support via PHP-FPM
    • Faster builds using pre-compiled binaries where available
    • More granular control over what gets updated
    • Better dependency management between components

    Step 1: Check the Current Build State Before Any Updates

    Never run a CustomBuild update without first reviewing what is currently installed and what options are configured. A mismatch between the build options and the running configuration causes broken virtual hosts and PHP handlers after an update.

    cd /usr/local/directadmin/custombuild
    
    # Check current installed versions
    ./build versions
    
    # Check current build options (PHP version, web server type, etc.)
    cat options.conf
    
    # Check for available updates
    ./build update
    ./build versions_compare

    Key settings to review in options.conf before updating:

    • php1_ver — primary PHP version (e.g., 8.2)
    • php2_ver — secondary PHP version
    • webserver — apache, nginx, or litespeed
    • php1_mode — php-fpm, fastcgi, or suphp
    • apache_ver — Apache version (2.4)
    • mysql_inst — mysql or mariadb and version

    Step 2: Update CustomBuild Itself First

    Before updating any software components, update CustomBuild itself to get the latest build scripts and binary lists:

    cd /usr/local/directadmin/custombuild
    ./build update

    This downloads updated build scripts from DirectAdmin's servers. It does not install or update any server software — it only updates the build tool itself. This step is safe to run at any time.

    Step 3: Update Apache Safely

    Apache updates are low-risk in CustomBuild because the update process compiles the new version and switches to it atomically. However, a syntax error in a virtualhost configuration can prevent Apache from restarting after the update — always test configuration before updating.

    # Test Apache configuration BEFORE updating
    httpd -t
    # or
    apachectl configtest

    If the test shows any syntax errors, fix them before proceeding. Then run the Apache update:

    cd /usr/local/directadmin/custombuild
    
    # Update Apache only
    ./build apache
    
    # Monitor the build output for errors
    # Build takes 5-15 minutes depending on server speed

    After the build completes, verify Apache is running:

    systemctl status httpd
    # Check that the new version is active
    httpd -v

    If Apache fails to restart after the build, check the error log:

    tail -50 /usr/local/apache/logs/error_log

    💡 None of these worked? Skip the guesswork.

    Get Expert Help →

    Step 4: Update PHP

    PHP updates are the most impactful CustomBuild operation for shared hosting servers because they affect every website on the server simultaneously. A PHP major version jump (7.4 → 8.1) can break older applications that use deprecated functions.

    1Update the Existing PHP Version (Patch Update — Safest)

    To update PHP within the same major version (e.g., 8.1.x to 8.1.y), the existing php1_ver setting in options.conf stays the same:

    ./build php n

    The n flag means "no recompile from scratch" — it uses pre-compiled binaries where available, making this significantly faster.

    2Switch to a New PHP Major Version

    To switch from PHP 8.1 to PHP 8.2, edit options.conf first:

    # Edit the PHP version setting
    nano /usr/local/directadmin/custombuild/options.conf
    # Change: php1_ver=8.1 → php1_ver=8.2
    
    # Then rebuild PHP
    ./build php

    For multi-PHP setups (different PHP versions per domain), configure php1_ver and php2_ver and rebuild both:

    ./build php n
    ./build php2 n
    3Test PHP After Update
    # Check that PHP-FPM restarted correctly
    systemctl status php-fpm
    php -v
    
    # Check a website's PHP version in DirectAdmin
    # (Admin Level > User Management > Domain > PHP Version)

    Step 5: Update MySQL or MariaDB

    Database updates carry the highest risk in CustomBuild. A failed MySQL update can corrupt the data directory or prevent the database service from starting. Always take a full mysqldump backup before updating MySQL or MariaDB.

    # Full database backup before updating
    mysqldump --all-databases --single-transaction > /root/all_databases_$(date +%Y%m%d).sql
    gzip /root/all_databases_$(date +%Y%m%d).sql
    
    # Then run the MySQL update
    ./build mysql

    After the update:

    systemctl status mysql
    mysql -V
    # Run mysql_upgrade to update grant tables
    mysql_upgrade -u root -p

    Step 6: Update All Components at Once

    CustomBuild can update all installed components in sequence with a single command. Use this only during a maintenance window, not on a live production server mid-day:

    ./build all d

    The d flag skips recompilation for components that support pre-compiled binaries, significantly reducing build time. Monitor the output carefully for errors — the build will continue past individual component failures.

    A safer alternative is to update components individually in order of risk:

    1. Update CustomBuild scripts: ./build update
    2. Update Apache: ./build apache
    3. Update PHP: ./build php n
    4. Update other services: ./build phpmyadmin, ./build roundcube
    5. Update MySQL/MariaDB last (after backup): ./build mysql

    Recovering from a Failed CustomBuild Update

    If Apache or PHP fails to start after a CustomBuild update, check the build log for compilation errors:

    tail -200 /usr/local/directadmin/custombuild/build.log

    Common recovery steps:

    • Apache won't start: Run httpd -t to identify configuration syntax errors, then fix and restart with systemctl start httpd
    • PHP-FPM won't start: Check systemctl status php-fpm and journalctl -u php-fpm -n 50 for the startup error
    • Roll back to previous version: Edit options.conf to specify the older version number and re-run the build command for that component

    For complex build failures or large fleets of DirectAdmin servers, CloudHouse's server management service handles CustomBuild updates during scheduled maintenance windows with rollback procedures in place.

    FAQs

    Get the Free Linux Server Admin Cheatsheet (PDF)

    Essential commands for server management, networking, and troubleshooting — all on one printable page.

    Running Linux servers? Let us manage them for you.

    Our Managed Linux Server plans cover updates, security hardening, monitoring, and 24/7 incident response — so your servers stay up and your team stays focused.

    • Proactive OS patching and security updates
    • 24×7 monitoring with instant alerting
    • Backup configuration and disaster recovery
    • Dedicated Linux engineers on call
    See Pricing Plans →

    What our customers say

    “Our production server went down at 2 AM. CloudHouse had it back online in under 20 minutes. Incredible response time.”

    Arun S.

    CTO, SaaS Startup

    “They migrated our entire infrastructure from Ubuntu 18 to 22 with zero downtime. Couldn't have asked for better.”

    Deepak N.

    DevOps Lead

    Frequently Asked Questions

    CustomBuild 2.0 adds per-user PHP version support via PHP-FPM, uses pre-compiled binaries for faster updates, and provides better dependency management. CustomBuild 1.x required full recompilation of all components. Most modern DirectAdmin installations use 2.0.

    Book your free 15-minute diagnosis

    A certified technician will call you back within 15 minutes during business hours.

    Share this article

    Leave a Comment

    Comments (0)

    Loading comments...

    Need Help With DirectAdmin CustomBuild?

    A failed CustomBuild update can take your entire hosting server offline. CloudHouse Technologies manages DirectAdmin stack updates with pre-update backups, staged rollout, and immediate rollback procedures — keeping your server current without the risk.

    Call Now — FreeWhatsApp Us

    Why CloudHouse?

    • ISO 27001:2022 certified
    • 12,400+ devices supported
    • 4.9★ on Google
    • Sub-15-minute response

    CloudHouse Technologies

    Innovative cloud solutions for modern businesses. We deliver cutting-edge technology with exceptional service.

    Contact Us

    CloudHouse Technologies Pvt.Ltd
    Special Economic Zone(SEZ),
    Infopark Thirissur,4B-15,
    Indeevaram,Nalukettu Road,
    Koratty, Kerala, India-680308
    0480-27327360
    info@cloudhousetechnologies.com

    Quick Links

    • Our Services
    • Gold Loan Software
    • About Us
    • Contact
    • Terms and Conditions
    • Privacy Policy
    ISO27001:2022
    Certified

    © 2026 CloudHouse Technologies Pvt.Ltd. All rights reserved.

    Back to top