Step 1: Updating CustomBuild
Please confirm you are using CustomBuild 2.0. If you're not sure about this, please follow our guide on how to upgrade CustomBuild and/or check its current version.
Step 2: Modifying CustomBuild
Before we can recompile our DirectAdmin installation for it to work with Nginx and Apache, navigate to the CustomBuild directory:
cd /usr/local/directadmin/custombuild
Open the configuration file:
vi options.conf
Step 3: Modifying the PHP versions
DirectAdmin supports using multiple PHP versions alongside each other.
Currently, using an Nginx and Apache reverse proxy with DirectAdmin requires php-fpm to be used. If this is currently not the case, alter php1_mode and php2_mode in the CustomBuild options.conf file to the value php_fpm.
Step 4: Installing Nginx
After saving this file, install Nginx:
cd /usr/local/directadmin/custombuild
./build set webserver nginx_apache
This will not remove Apache.
Step 5: Deploying the reverse proxy
After compiling and building the web server, we will need CustomBuild to rewrite all configurations on the server:
./build update
./build nginx_apache
./build rewrite_confs
Nginx will now be installed. Depending on the size of your server, this will take about 30 minutes. Please be patient and don't interrupt the installation or it will most likely fail and break the server.
Thats it.