My apache server failed once I rebooted my centos server. When I try to start the service I get this error:
httpd: Syntax error on line 35 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/mod_dav_svn.so into server: /usr/local/apache/modules/mod_dav_svn.so: undefined symbol: dav_register_provider
Reading some articles I found that I need to load mod_dav.so before mod_dav_svn.so but I don't have this file in my server.
Reinstalling subversion don't worked too.
Any idea ??? thank you !
Are you saying that you don't have mod_dav.so? Do you have the line
LoadModule dav_module modules/mod_dav.so
in your httpd.conf? Perhaps you can post the relevant parts of your conf file.
In regards to why you're seeing it once you rebooted, perhaps you made some changes and hadn't yet restarted the apache service, meaning that it's just not showing you the problems.
Related
I have a docker container based in the httpd official image.
From nowhere (after a new build), it started failing with the error:
AH00534: httpd: Configuration error: No MPM loaded.
Nothing else.
I'm using the official httpd image (FROM httpd:2.4) and everything was working fine until now.
The error appeared only after pruning all images in my system with a docker system prune -af
(edit, thanks delboy1978uk)
The error could be avoided if applied a simple best practice: pin your docker images to a specific version instead of latest.
After digging the commits of the official httpd image, I found the solution. (maybe this question/answer may help others)
For those who stumble onto this note while looking for a solution,
just add LoadModule mpm_event_module modules/mod_mpm_event.so into
httpd.conf above the other LoadModule directives.
(from the comments on the commit #17166574)
So, because I was overriding the file /usr/local/apache2/conf/httpd.conf without explicitly declare an MPM module, after this commit, my image started to fail.
With this quick fix, everything is fine now.
For the complete correction, add this to your httpd.conf file (thanks svinther):
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
or, for a more future-proof solution, you could modify the original http.conf file using sed.
After comparing my configuration with latest httpd:2.4 configuration, I found that these new lines needed to be merged into conf/httpd.conf
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
Note to self: When building the derivative httpd docker image, it would probably be better to mod the conf files with sed, than to just COPY in a static file
If you are using Docker for Windows, you might be running into a File conversion issue. Be sure to check the encoding of your httpd.conf, it should be Unix LF - UTF8.
Much as the accepted solution works, it is less than ideal. The real reason you are getting this error is most likely the fact that your Dockerfile begins with the following line:
FROM httpd:latest
That latest part, is you asking for the latest and greatest version of Apache.
Don't do that. This is your infrastructure. Lock it down to a version number.
Something like
FROM apache:2.4.0
This is the real answer. Not doing that risks your own codebase failing when third party software vendors update their code.
Get the latest version of httpd.conf, and take a note of the version number, then tweak it with your changes, and get that :latest the hell out of your Dockerfile.
I´m using this in my docker file
FROM php:7.2-apache
And i fixed this problem adding this line to /etc/docker/daemon.json
{
"storage-driver": "devicemapper"
}
I have a docker container based in the httpd official image.
From nowhere (after a new build), it started failing with the error:
AH00534: httpd: Configuration error: No MPM loaded.
Nothing else.
I'm using the official httpd image (FROM httpd:2.4) and everything was working fine until now.
The error appeared only after pruning all images in my system with a docker system prune -af
(edit, thanks delboy1978uk)
The error could be avoided if applied a simple best practice: pin your docker images to a specific version instead of latest.
After digging the commits of the official httpd image, I found the solution. (maybe this question/answer may help others)
For those who stumble onto this note while looking for a solution,
just add LoadModule mpm_event_module modules/mod_mpm_event.so into
httpd.conf above the other LoadModule directives.
(from the comments on the commit #17166574)
So, because I was overriding the file /usr/local/apache2/conf/httpd.conf without explicitly declare an MPM module, after this commit, my image started to fail.
With this quick fix, everything is fine now.
For the complete correction, add this to your httpd.conf file (thanks svinther):
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
or, for a more future-proof solution, you could modify the original http.conf file using sed.
After comparing my configuration with latest httpd:2.4 configuration, I found that these new lines needed to be merged into conf/httpd.conf
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
Note to self: When building the derivative httpd docker image, it would probably be better to mod the conf files with sed, than to just COPY in a static file
If you are using Docker for Windows, you might be running into a File conversion issue. Be sure to check the encoding of your httpd.conf, it should be Unix LF - UTF8.
Much as the accepted solution works, it is less than ideal. The real reason you are getting this error is most likely the fact that your Dockerfile begins with the following line:
FROM httpd:latest
That latest part, is you asking for the latest and greatest version of Apache.
Don't do that. This is your infrastructure. Lock it down to a version number.
Something like
FROM apache:2.4.0
This is the real answer. Not doing that risks your own codebase failing when third party software vendors update their code.
Get the latest version of httpd.conf, and take a note of the version number, then tweak it with your changes, and get that :latest the hell out of your Dockerfile.
I´m using this in my docker file
FROM php:7.2-apache
And i fixed this problem adding this line to /etc/docker/daemon.json
{
"storage-driver": "devicemapper"
}
After years of giving no trouble, my connection to localhost has stopped working. When I enter:-
http://localhost/phpinfo.php
the error message
This webpage is not available ERR_CONNECTION_REFUSED
is returned. I then attempt to restart apache, thus:-
sudo service apache2 restart
This produces the following error message:-
apache2: Syntax error on line 210 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/log_sql.load:
Cannot load /usr/lib/apache2/modules/mod_log_sql.so into server: /usr/lib/apache2/modules/mod_log_sql.so:
undefined symbol: ap_log_error_
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
The line of apache2.conf causing the issue is here:-
Include mods-enabled/*.load
and in log_sql.load:-
LoadModule log_sql_module /usr/lib/apache2/modules/mod_log_sql.so
The file mod_log_sql.so exists.
I have check the error log and it doesn't contain anything (i.e. has no bytes in it). Does anyone know what the matter is, and how I can fix it?
The apache configuration is a LAMP stack straight out of the tin. I haven't (to the best of my knowledge) done anything to even tweak it, and it has been going nicely for some years.
This question is related but has a different error message. This fellow here appears to have a related problem.
My guess: the module mod_log_sql.so has been compiled for a different version of Apache, so it can't be loaded.
Are any of mod_log_sql.so or Apache installed manually (i.e., not from the Ubuntu repository)? You can search if mod_log_sql.so has been installed from a package using:
dpkg -S /usr/lib/apache2/modules/mod_log_sql.so
It is not clear why this has to be a "syntax error" though...
while configuring apache httpd with subversion on windows 7, getting below error..
i had already installed with different types of versions of SVN and apache also still im facing this issue.. could please some one help me out of this issue..
svn, version 1.9.1 (r1698128) `compiled Sep 1 2015, 19:50:43 on x86-microsoft-windows`
httpd-2.2.22-win32-x86-openssl-0.9.8t,
Server version: Apache/2.2.22 (Win32)
Server built: Jan 28 2012 11:16:39
and previously i had installed svn for 1.8.18 and httpd-2.2.25-win32-x86-openssl-0.9.8y
i copied these below files to apache/conf/httpd
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Getting below Error:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
<C:error/> <m:human-readable errcode="160043">Could not open the requested SVN filesystem</m:human-readable>
</D:error>
At first, show your full httpd.conf file and see what's logged to Apache log. I guess that you'll understand the root cause by looking through the log.
Next, if you have troubles setting up SVN+Apache server on Windows yourself, search the web for prepackaged all-in-one solutions. E.g. google "svn server windows". Otherwise, check the official binary packages page.
Update:
The most interesting part of the logged error is:
E160043: Expected FS format between '1' and '6'; found format '7'
The error means that you have Subversion 1.8 installed as your server. However, the repository was created using Subversion 1.9 tools and has newer format. You should make sure that your server is on the most current version 1.9 or create the repository using 1.8 tools. There is another option that may help you: create the repository using svnadmin create REPOSITORY --compatible-version 1.8 command.
The fact that when you run svn --version you see version 1.9.1 (r1698128) just means that your command-line client has version 1.9.1. This is irrelevant to the server side.
I installed apache2.2.21 and I need this specific version, I'm trying to load mod_security2.
The apache server is 32bits and is running on windows 8 64bits.
I did everything possible to get the job done, but I couldn't, can anyone help me?
I put mod_security.so in modules directory, and edited httpd.conf file to load the module but when trying to start the server, it gives me this message:
httpd.exe: Syntax error on line 126 of C:/Apache2.2.21/conf/httpd.conf: Cannot load C:/Apache2.2.21/modules/mod_security2.so into server: The specified module could not be found.