Apache's failing because of FollowSymlinks in 2.4.48

Same issue here ... i have updated the server and have same versions as sirwiz ... it's on a CentOS 8 box ...

[root@khsm1 custombuild]# cat /etc/redhat-release
CentOS Linux release 8.3.2011

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

solved the problem but is not a permanent option... So is it possible to fix this?
 
Permanent fix is mentioned in my previous reply.
I'm using the latest version of DirectAdmin, and this is the result when I followed your instructions:
Code:
[root@hv10 ~]# /usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.62.2
[root@hv10 ~]# /usr/local/directadmin/custombuild/build rewrite_confs
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 42.117.xxx.xxx for your server IP
PHP has been secured.
Restarting php-fpm74.
Restarting php-fpm80.
Restarting php-fpm56.
Found /usr/local/directadmin/custombuild/mod_aclr2-1.0.0.tar.gz
Extracting /usr/local/directadmin/custombuild/mod_aclr2-1.0.0.tar.gz...
Installing mod_aclr2-1.0.0...
/var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -I/usr/local/include  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_aclr2.lo mod_aclr2.c && touch mod_aclr2.slo
/var/www/build/libtool --silent --mode=link gcc -std=gnu99 -L/usr/local/lib   -o mod_aclr2.la  -rpath /usr/lib/apache -module -avoid-version    mod_aclr2.lo
/var/www/build/instdso.sh SH_LIBTOOL='/var/www/build/libtool' mod_aclr2.la /usr/lib/apache
/var/www/build/libtool --mode=install install mod_aclr2.la /usr/lib/apache/
libtool: install: install .libs/mod_aclr2.so /usr/lib/apache/mod_aclr2.so
libtool: install: install .libs/mod_aclr2.lai /usr/lib/apache/mod_aclr2.la
libtool: install: install .libs/mod_aclr2.a /usr/lib/apache/mod_aclr2.a
libtool: install: chmod 644 /usr/lib/apache/mod_aclr2.a
libtool: install: ranlib /usr/lib/apache/mod_aclr2.a
libtool: finish: PATH="/root/bao/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib/apache
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/apache

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/lib/apache/mod_aclr2.so
[activating module `aclr' in /etc/httpd/conf/httpd.conf]
mod_aclr2 has been installed successfully.
Restarting apache.
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 42.117.xxx.xxx for your server IP
Using 42.117.xxx.xxx for your server IP
PHP has been secured.
Restarting php-fpm74.
Restarting php-fpm80.
Restarting php-fpm56.
Job for php-fpm56.service invalid.
Restarting nginx.
[root@hv10 ~]# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2021-06-21 13:42:07 +07; 5s ago
  Process: 20775 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 20775 (code=exited, status=1/FAILURE)
   Status: "Reading configuration..."

Jun 21 13:42:07 hv10 systemd[1]: Starting The Apache HTTP Server...
Jun 21 13:42:07 hv10 httpd[20775]: AH00526: Syntax error on line 26 of /usr/local/directadmin/data/users/admin/httpd.conf:
Jun 21 13:42:07 hv10 httpd[20775]: Invalid command '|UNIT_PROXY|', perhaps misspelled or defined by a module not included in the server configuration
Jun 21 13:42:07 hv10 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 21 13:42:07 hv10 systemd[1]: Failed to start The Apache HTTP Server.
Jun 21 13:42:07 hv10 systemd[1]: Unit httpd.service entered failed state.
Jun 21 13:42:07 hv10 systemd[1]: httpd.service failed.
[root@hv10 ~]# sed -i '/|UNIT_PROXY|/d' /usr/local/directadmin/data/users/*/httpd.conf
[root@hv10 ~]# systemctl restart httpd
[root@hv10 ~]#
 
I have found a comprehensive solution to this problem. You need to delete the line that says:
Code:
|UNIT_PROXY|
In the files:
Code:
virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf

At the directory:
Code:
/usr/local/directadmin/data/templates
Then run the following command again to complete:
Code:
/usr/local/directadmin/custombuild/build rewrite_confs
 
Thanks bibiugly, this solution seems to be working! I have tested on one of our servers and it seems fine.
 
I'm using the latest version of DirectAdmin, and this is the result when I followed your instructions:
Code:
[root@hv10 ~]# /usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.62.2
[root@hv10 ~]# /usr/local/directadmin/custombuild/build rewrite_confs
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 42.117.xxx.xxx for your server IP
PHP has been secured.
Restarting php-fpm74.
Restarting php-fpm80.
Restarting php-fpm56.
Found /usr/local/directadmin/custombuild/mod_aclr2-1.0.0.tar.gz
Extracting /usr/local/directadmin/custombuild/mod_aclr2-1.0.0.tar.gz...
Installing mod_aclr2-1.0.0...
/var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -I/usr/local/include  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_aclr2.lo mod_aclr2.c && touch mod_aclr2.slo
/var/www/build/libtool --silent --mode=link gcc -std=gnu99 -L/usr/local/lib   -o mod_aclr2.la  -rpath /usr/lib/apache -module -avoid-version    mod_aclr2.lo
/var/www/build/instdso.sh SH_LIBTOOL='/var/www/build/libtool' mod_aclr2.la /usr/lib/apache
/var/www/build/libtool --mode=install install mod_aclr2.la /usr/lib/apache/
libtool: install: install .libs/mod_aclr2.so /usr/lib/apache/mod_aclr2.so
libtool: install: install .libs/mod_aclr2.lai /usr/lib/apache/mod_aclr2.la
libtool: install: install .libs/mod_aclr2.a /usr/lib/apache/mod_aclr2.a
libtool: install: chmod 644 /usr/lib/apache/mod_aclr2.a
libtool: install: ranlib /usr/lib/apache/mod_aclr2.a
libtool: finish: PATH="/root/bao/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib/apache
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/apache

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/lib/apache/mod_aclr2.so
[activating module `aclr' in /etc/httpd/conf/httpd.conf]
mod_aclr2 has been installed successfully.
Restarting apache.
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 42.117.xxx.xxx for your server IP
Using 42.117.xxx.xxx for your server IP
PHP has been secured.
Restarting php-fpm74.
Restarting php-fpm80.
Restarting php-fpm56.
Job for php-fpm56.service invalid.
Restarting nginx.
[root@hv10 ~]# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2021-06-21 13:42:07 +07; 5s ago
  Process: 20775 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 20775 (code=exited, status=1/FAILURE)
   Status: "Reading configuration..."

Jun 21 13:42:07 hv10 systemd[1]: Starting The Apache HTTP Server...
Jun 21 13:42:07 hv10 httpd[20775]: AH00526: Syntax error on line 26 of /usr/local/directadmin/data/users/admin/httpd.conf:
Jun 21 13:42:07 hv10 httpd[20775]: Invalid command '|UNIT_PROXY|', perhaps misspelled or defined by a module not included in the server configuration
Jun 21 13:42:07 hv10 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 21 13:42:07 hv10 systemd[1]: Failed to start The Apache HTTP Server.
Jun 21 13:42:07 hv10 systemd[1]: Unit httpd.service entered failed state.
Jun 21 13:42:07 hv10 systemd[1]: httpd.service failed.
[root@hv10 ~]# sed -i '/|UNIT_PROXY|/d' /usr/local/directadmin/data/users/*/httpd.conf
[root@hv10 ~]# systemctl restart httpd
[root@hv10 ~]#
You are missing this step before rewrite_confs:
Code:
/usr/local/directadmin/directadmin p
 
same problem with custom build 2.0.0 (rev: 2725) , directadmin version 1.62.2

made
cd /usr/local/directadmin/custombuild
./build update
./build apache
and also
/usr/local/directadmin/custombuild/build rewrite_confs
and also
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
./build update apache
and even
/usr/local/directadmin/custombuild/build rewrite_confs

nothing works:(
 
same problem with custom build 2.0.0 (rev: 2725) , directadmin version 1.62.2

made
cd /usr/local/directadmin/custombuild
./build update
./build apache
and also
/usr/local/directadmin/custombuild/build rewrite_confs
and also
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
./build update apache
and even
/usr/local/directadmin/custombuild/build rewrite_confs

nothing works:(
You're also missing:
Code:
/usr/local/directadmin/directadmin p
 
I have found a comprehensive solution to this problem. You need to delete the line that says:
Code:
|UNIT_PROXY|
In the files:
Code:
virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf
At the directory:
Code:
/usr/local/directadmin/data/templates
Is it fully correct solution?
I mean, probably |unit_proxy| have to be there?
 
This worked for me, didn't have to edit any files

/usr/local/directadmin/directadmin p
cd /usr/local/directadmin/custombuild
./build rewrite_confs
./build update
./build apache
 
cat /etc/redhat-release
CentOS release 6.5 (Final)

./build version
2.0.0 (rev: 2727)

/usr/local/directadmin/directadmin p

this one takes forever and no output at all

already tried

cd /usr/local/directadmin/custombuild
./build clean
./build update
./build apache
./build rewrite_confs
 
This one works for me before doing the rewrite_confs:
/usr/local/directadmin/directadmin p

Thanks Martynas
For me it worked too.
But one question - why this error was on one of my server and on second not? on both servers there was the same CB Build, the same DA version... weird problem.

What "/usr/local/directadmin/directadmin p" exactly do? :D
 
Hi guys, still having troubles on my server.

My history:
When i updated Apache ofcourse the |UNIT_PROXY| appeared in all .conf files. I removed all of them using "sed -i" (see above) and all was fine.

Then i did all the steps @smtalk suggested; all went fine.

Then i created a new virtual host for a new client using DA CP. All went fine.
But then around 00:20 Apache crashed (again).
I checked the .conf files for |UNIT_PROXY| and it existed ONLY with the new client, all "old" vhosts where uneffected.
Last night same problem, so every night im removing |UNIT_PROXY| manually from the new clients vhost.

Then: if i go to "/usr/local/directadmin/data/templates" and i do "grep -iRl "UNIT_PROXY" ./" the result is:

./virtual_host2_secure_sub.conf
./virtual_host2.conf
./virtual_host2_secure.conf
./nginx_location.conf
./virtual_host2_sub.conf
./openlitespeed_vhost.conf

So it seems it is still there. Any help would be appreciated!

Also:

[root@myserver custombuild]# /usr/local/directadmin/custombuild/build rewrite_confs
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 11.247.8.11 for your server IP
Backslash found where operator expected at -e line 1, near "\"
Regexp modifiers "/d" and "/a" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/b" at -e line 1, at end of line
Regexp modifiers "/d" and "/l" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/_" at -e line 1, at end of line
Unknown regexp modifier "/f" at -e line 1, at end of line
Regexp modifiers "/d" and "/u" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/t" at -e line 1, at end of line
syntax error at -e line 1, near "\"
Execution of -e aborted due to compilation errors.
PHP has been secured.
Restarting php-fpm74.
Restarting php-fpm56.
Restarting apache.
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
 
Last edited:
Follow steps solved my problem with apache after the update:
Invalid command '|UNIT_PROXY|', perhaps misspelled or defined by a module not included in the server configuration
My DirectAdmin information:
Version: DirectAdmin v.1.62.4
./build version
2.0.0 (rev: 2729)

Steps how I understand the comments of @smtalk and resolve the error:
  1. cd /usr/local/directadmin/custombuild
  2. ./build update
  3. /usr/local/directadmin/directadmin p
  4. ./build rewrite_confs
After that, apache starts without problem ;)
 
Thanks; i did and all went fine except for the last step; see the error log (also see above):


Backslash found where operator expected at -e line 1, near "\"
Regexp modifiers "/d" and "/a" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/b" at -e line 1, at end of line
Regexp modifiers "/d" and "/l" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/_" at -e line 1, at end of line
Unknown regexp modifier "/f" at -e line 1, at end of line
Regexp modifiers "/d" and "/u" are mutually exclusive at -e line 1, at end of line
Unknown regexp modifier "/t" at -e line 1, at end of line
syntax error at -e line 1, near "\"
 
Is that latest version of DirectAdmin? Try:
Code:
/usr/local/directadmin/custombuild/build rewrite_confs
Hi SMtalk
i tired this but it still does not work
1626939719933.png
 
Back
Top