Home WebServer PanelDirectAdmin How to switch webserver to Apache on DirectAdmin

How to switch webserver to Apache on DirectAdmin

by Thạch Phạm
Published: Last Updated on

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:

AZDIGI Tutorial
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 custombuild folder.
  • Command 2: Update custombuild script.
  • Command 3: Switch webserver to Apache.
  • Command 4: Change the php1_mode to php-fpm.
  • Command 5: Change the php2_mode to php-fpm.
  • Command 6: Change the php3_mode to php-fpm.
  • Command 7: Change the php4_mode to php-fpm.
  • Command 8: Install Apache.
  • Command 9: Reinstall PHP versions 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:

Switched webserver to Apache, was using Openlitespeed previously.
Change the phpX_mode to php-fpm to suit Apache.
Switch webserver to Apache on DirectAdmin successfully.

You can see other valid options for the above configurations with the following command:

AZDIGI Tutorial
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 auto mode.

If you want to know what MPM is using, you can run the following command to check:

AZDIGI Tutorial
httpd -V | grep 'MPM'

If you want to see the detailed parameters of each of these modes, use the following command:

AZDIGI Tutorial
cat /etc/httpd/conf/extra/httpd-mpm.conf

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:

AZDIGI Tutorial
httpd -l | grep mod_rewrite

If your result shows like below

AZDIGI Tutorial

mod_rewrite is enable.

mod_rewrite is enable.

V. Summary

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:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign