Apache crashing every week

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
Every sunday I need to rewrite configs, then it can run again.
Error is this:
httpd: Syntax error on line 5 of /etc/httpd/conf/httpd.conf: module access_compat_module is built-in and can't be loaded
How I should resolve this issue?
OS is Centos8

Br. Niko H.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
httpd: Syntax error on line 5 of /etc/httpd/conf/httpd.conf: module access_compat_module is built-in and can't be loaded
What version of apache are you running? And did you replace your httpd.conf files?
Because it seems you have a totally different httpd.conf than the default one, which begins with a lot of marked text lines.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
Apache 2.4. I install it by custom build 2. I try many times rebuild it, but didn’t help.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
Have a look at your custom folder if a httpd.conf is present in there. Custom conf should be here:
/usr/local/directadmin/custombuild/custom/ap2/conf

If not, you can try to rename the current httpd.conf to httpd.conf.bak and then rebuild apache again.

A default httpd.conf provided by DA should start like this (and some more):
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
etc.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
Hi,

Sorry late response,just had time to check, and that path not exist. ... custom/ap2/conf
Only this is "valid" -> /usr/local/directadmin/custombuild part
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
Sorry late response,just had time to check
No problem, i'm in no hurry, you are the one having a problem, I don't, so no problem being a bit later. ;)

If that path does not exist then that's a good sign, because if there is no /custombuild/custom directory, then there are no customisations which prevent apache from being build correctly.

Have you tried my other tip?
you can try to rename the current httpd.conf to httpd.conf.bak and then rebuild apache again.
does that work?

Just to be sure... you didn't install apache via your distro before like yum install apache or apt install on Debian alike distro's right?
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
No problem, i'm in no hurry, you are the one having a problem, I don't, so no problem being a bit later. ;)

If that path does not exist then that's a good sign, because if there is no /custombuild/custom directory, then there are no customisations which prevent apache from being build correctly.

Have you tried my other tip?

does that work?

Just to be sure... you didn't install apache via your distro before like yum install apache or apt install on Debian alike distro's right?
Hi,

Actually I found that folder, it's juts under different name, /usr/local/directadmin/custombuild/configure/ap2/conf

My distro is Centos 8, and I install apache2 with directadmin scripts.

Will now rename that file and rebuild it.

Br. Niko H.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
LoadModule access_compat_module modules/mod_access_compat.so

Still this doing issue, rebuild after rename that file didn't work
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
Actually I found that folder, it's juts under different name
That is the default folder you found, don't make any changes in there, so never mind about that folder, but it's always good to let know just to be sure, I can also make mistakes an typo's.

rebuild after rename that file didn't work
But did it create a new httpd.conf file then? And does that start like in my example?

Also, what distro are you using?
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
That is the default folder you found, don't make any changes in there, so never mind about that folder, but it's always good to let know just to be sure, I can also make mistakes an typo's.


But did it create a new httpd.conf file then? And does that start like in my example?
Yes it did new config file, but issue didn't left. Same line about LoadModule access_compat_module modules/mod_access_compat.so
Also, what distro are you using?
Centos 8
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
There's something off with your installation but I can't get my finger around it.
Check this file:
/usr/local/directadmin/custombuild/configure/ap2/conf/httpd.conf
does that start like in my example or how does that start?

Check if this httpd.conf also contains that mod_access_compat.so and if not, check the /etc/httpd/conf/extra/httpd-includes.conf file if it's in there.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
There's something off with your installation but I can't get my finger around it.
Check this file:
/usr/local/directadmin/custombuild/configure/ap2/conf/httpd.conf
does that start like in my example or how does that start?

Check if this httpd.conf also contains that mod_access_compat.so and if not, check the /etc/httpd/conf/extra/httpd-includes.conf file if it's in there.
/etc/httpd/conf/extra/httpd-includes.conf is empty.

And this how looks like autogenerated httpd.conf what was autogenerated via directadmin scripts again. And it works and apache starts normaly

ServerRoot "/etc/httpd"
Listen 80

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
LoadModule log_config_module modules/mod_log_config.so
And continues...

User apache
Group apache
like normal httpd.conf file.

Br. Niko H.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
There's something off with your installation but I can't get my finger around it.
Check this file:
/usr/local/directadmin/custombuild/configure/ap2/conf/httpd.conf
does that start like in my example or how does that start?
Yes it starts that way
Check if this httpd.conf also contains that mod_access_compat.so and if not, check the /etc/httpd/conf/extra/httpd-includes.conf file if it's in there.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
One more thing what I just got.
I update php 7.4 (there was update). So after that I succesfully repeat this issue.
So it try to rewrite configs, but apache after that didn't start. Same error about mod_combat_access.so
So I check httpd.conf how it looks like, and it was same what I posted before. And I comment that line by hand. And try to restart, again error but in next line, and again comment and new error in next line so on... (mod_action.so, mod_alias.so...)
Then I run command /usr/local/directadmin/plugins/custombuild/admin/build rewrite_confs
And apache start fine.
Config and config looks different, how I think it should look like:
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "/etc/httpd"
So maybe now you have little glue what's wrong in this installation?

Br, Niko H.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
8,567
Location
Maastricht
No sorry, still have no clue.
I do know that if you comment out something in the httpd.conf without having that in the custom directory, the next time it will be overwritten, so that is normal.

Since you don't have anything in the /usr/local/directadmin/custombuild/custom/ap2/conf/ (or maybe /ap2 of /ap2/conf/extra) directory's since they are not existing, it seems there is no server wide customisation present which could cause this either.

mod_action.so, mod_alias.so.
That's an odd one. I have no idea why these errors would appear after you commented out the mod_access_compat.so.

So I hope somebody else has a clue or else you might need to send in a ticket for this and point to this thread.
 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
when you get this error, did you tried to run -

apachectl configtest

what was the output
httpd: Syntax error on line 5 of /etc/httpd/conf/httpd.conf: module access_compat_module is built-in and can't be loaded
 

ikkeben

Verified User
Joined
May 22, 2014
Messages
1,528
Location
Netherlands Germany
httpd: Syntax error on line 5 of /etc/httpd/conf/httpd.conf: module access_compat_module is built-in and can't be loaded
Info's


maybe go to
As workarround while

Note​


The directives provided by mod_access_compat have been deprecated by mod_authz_host. Mixing old directives like Order, Allow or Deny with new ones like Require is technically possible but discouraged. This module was created to support configurations containing only old directives to facilitate the 2.4 upgrade. Please check the upgrading guide for more information.

 

nikoh2021

Verified User
Joined
Nov 8, 2021
Messages
12
Main question is: "What run and what script, so my configs are not valid every sunday night?" Crontab is empty. Now it works and config is correct without that error line. How I write before, httpd.conf file looks really wrong. There shouldn't be this -> LoadModule access_compat_module modules/mod_access_compat.so. Or should? I don't think so. So why and how every sunday that line and other are added in start httpd.conf file? I don't do that change. So how to fix it? Is this just Centos 8 issue?
Anybody else had similar issues with centos 8 fresh installation and directadmin?

Br. Niko H.
 
Top