In this tutorial, AZDIGI will help you switch your webserver to Apache on DirectAdmin if you have switched to another webserver before.
I. What is Apache?
Apache is the most widely used web server software in the world today. Developed and maintained by the Apache Software Foundation and Apache is free and open-source software.
It is an industry-standard web hosting compatible with all website engines and CMS. With MPM events and workers, it is quite similar in performance to Nginx.
You can see the changes in each Apache version at the following link:
II. Switch webserver to Apache on DirectAdmin
When installing the DirectAdmin web server, the default will be Apache, but in the process, you may have switched to installing Nginx, webserver Openlitespeed or reverse-proxy NGINX_Apache webserver. But now you want to switch back to Apache, follow these steps.
Step 1: SSH into your DirectAdmin system
To switch webserver to Apache on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to perform commands to switch webserver to Apache on DirectAdmin.
Step 2: Switch webserver to Apache on DirectAdmin
You just need to execute the following commands in order: Explanation of the above commands:
cd /usr/local/directadmin/custombuild ./build update ./build set webserver apache ./build set php1_mode php-fpm ./build set php2_mode php-fpm ./build set php3_mode php-fpm ./build set php4_mode php-fpm ./build apache ./build php n ./build rewrite_confs
Explanation of the above commands:
- Command 1: Move to the
- Command 2: Update
- Command 3: Switch
- Command 4: Change the
- Command 5: Change the
- Command 6: Change the
- Command 7: Change the
- Command 8: Install
- Command 9: Reinstall
PHPversions under the new configuration.
- Command 10: Rebuild the entire configuration on the server. Changes in
/custombuild/custom/ will be preserved.
Below are images in the process of switch the webserver to Apache on DirectAdmin:
You can see other valid options for the above configurations with the following command:
cd /usr/local/directadmin/custombuild/ ./build opt_help | grep "webserver\|mpm\|php._[mode|release]"
At this point, the transfer of the webserver to Apache on DirectAdmin has been completed, but you can read more to know more about Apache.
III. Some other options when using Apache
1. MultiProcessing Modules Apache
With the use of Apache, you will have 3 different modes of using MultiProcessing Modules (MPMs), helping to better match each specific infrastructure’s needs. Therefore, MPM selection and configuration are essential.
By default, DirectAdmin will leave
If you want to know what MPM is using, you can run the following command to check:
httpd -V | grep 'MPM'
If you want to see the detailed parameters of each of these modes, use the following command:
2. Check if
mod_rewrite is enabled
. mod_rewrite is always enabled in Apache by default. To confirm this information, let’s use the following command:
httpd -l | grep mod_rewrite
If your result shows like below
mod_rewrite is enable.
With just 2 simple steps, you can successfully switch your webserver to Apache on DirectAdmin. Using Apache will help your VPS/server use relatively few resources because Apache is not as resource-demanding as Openlitespeed.
Hope this article will be of help to you. Wishing you success!
See more useful articles about DirectAdmin at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 730 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: email@example.com .