Home WebServer PanelDirectAdmin [Fix] [Fix] Invalid command UNIT_PROXY Apache 2.4.48 DirectAdmin

[Fix] [Fix] Invalid command UNIT_PROXY Apache 2.4.48 DirectAdmin

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

In this article, AZDIGI will guide you to fix the Invalid command UNIT_PROXY error for Apache 2.4.48 on the DirectAdmin server.

I. Introduction

Suddenly one day, you upgrade the Apache version to the latest version, currently Apache 2.4.48. But then your Apache can’t boot and receive the error message as below:

AZDIGI Tutorial
server.berrishosting.nl systemd[1]: Starting The Apache HTTP Server...
server.com httpd[12165]: AH00526: Syntax error on line 34 of /usr/local/directadmin/data/users/admin/httpd.conf:
server.berrishosting.nl httpd[12165]: Invalid command '|UNIT_PROXY|', perhaps misspelled or defined by a module not included in the server configuration
server.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
server.com systemd[1]: Failed to start The Apache HTTP Server.
server.com systemd[1]: Unit httpd.service entered failed state.
server.com systemd[1]: httpd.service failed.

And all websites on your server will be inaccessible. So in this article, I will help you to fix this error.

II. Fix Invalid command UNIT_PROXY error on DirectAdmin

To fix the Invalid command UNIT_PROXY error on DirectAdmin, we need to do the following two steps.

Step 1: SSH into your server

To fix the Invalid command UNIT_PROXY error on DirectAdmin, we first need to SSH or access your VPS/server with root privileges . Or at least log in to the server with a user with sudo privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we will continue with step 2 to execute the error processing commands.

Step 2: Commands to fix Invalid command UNIT_PROXY

This is a syntax error in Apache’s configuration, so we must remove this configuration line on all of the httpd.conf files belonging to our user.

First, we run the command below to back up our Apache configurations before we modify them, in case we need these configurations:

AZDIGI Tutorial
cp -r /usr/local/directadmin/data/users /usr/local/directadmin/data/users_bk

After that, we continue to run the following 2 commands to remove this wrong syntax configuration line:

AZDIGI Tutorial
sed -i '/|UNIT_PROXY|/d' /usr/local/directadmin/data/users/*/httpd.conf
systemctl restart httpd

By this step, your Apache 2.4.48 can work normally.

You can use the following command to check:

AZDIGI Tutorial
systemctl status httpd

If the Apache service shows active (running) as shown below, everything is working again.

Apache (httpd) sevice is worked again.

So we have fixed the Invalid command UNIT_PROXY error on Apache version 2.4.48 used by the server running DirectAdmin.

There is also another simpler solution that we need to upgrade DirectAdmin to version 1.62.2 and run the following 3 commands:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs

III. Summary

According to my research, I found that some servers will have this error when upgrading, but others will not. I will learn more and if there is any information I will update this article.

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