Unable to start Apache on Ubuntu 14.04 - apache

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...

Related

Apache httpd server on windows won't start

I installed Apache on Windows7 through a bitnami install package for trac. As a final installation step the installer tried to start the Apache httpd service and threw up an error that starting the https service failed.
I found out why when I tried to start httpd from command prompt and got this error:
AH00526: Syntax error on line 564 of F:/Bitnami/trac-1.0.9-0/apache2/conf/httpd.conf:
SetEnv takes 1-2 arguments, an environment variable name and optional value to pass to CGI.
Here is the offending line:
SetEnv PATH "${PATH};F:/Bitnami/trac-1.0.9-0/apache2/bin;"
I changed it to this:
SetEnv PATH "F:/Bitnami/trac-1.0.9-0/apache2/bin;"
and the service started.
My questions are:
1) What is the syntax/language used in the httpd.conf file?
2) How would one have to change that line to make it compile and preserve the original intent of appending F:/Bitnami/trac-1.0.9-0/apache2/bin to the environment variable PATH?
3) Assuming this works on some platforms why would it not work on Windows?
Thanks.
Update
Like the responses say the issue was with PATH. However the fact that there are spaces in the paths doesn't appear to be the issue. Not only that I isolated the path in PATH that was causing the problem. It was this "C:\tools\mkstools", exactly like that. I got rid of the quotes and that enabled httpd to start. So I'm still scratching my head. Why would the quotes cause the problem?
For me, it worked by replacing ${PATH} with %PATH%.

installing mod_security2.so on apache2.2.21

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.

httpd.config error when insntalling mod_wsgi+django

its been more than 2 weeks. i try to instal but still getting error.
firstly, indeed I have searched similar error but i didn't find solution at all. if you find it. please let me know.
second, this is my state :
1. i have installed python 2.7 and django 1.5.1 (it works).
2. i also install MAMP.
3. i try to configure mod_wsgi and want it integrated with my MAMP apache server.
4. using mac mountain lion 10.8.4
my configuration file :
/etc/apache2/original/extra/httpd-userdir.conf inside my apache2/original/extra/
/etc/apache2/users/akhyar.conf pastebin.com/zcY58WTV (sorry about this Iam new on stack overflow)
/etc/apache2/httpd.conf pastebin.com/je2D8zMz
third, this is my error :
when i run apachectl configtest this error appears my error
so, what is going on actually? can someone tell me why and show me the mistakes?
if its been solved, what is the next step for configuring mod_wsgi on my MAMP?
thanks before, any help are highly appreciated.
In this file, line 15, you're including the per-user conf files:
http://pastebin.com/7y7ibuqP
On line 473 of this one, one of those per-user conf files, you're including the above file again:
http://pastebin.com/zcY58WTV
This causes infinite recursion while trying to parse the conf files.
I think there are some other errors too, and to be honest the files are pretty messy, but the best way forward is to remove all Include directives from akhyar.conf. For the most part they're already duplicates, where they're not, inline the contents of those files instead of using Include. If there are other errors, you'll at least see useful line numbers to start tracking them down.
Also note that the [warn] lines are just warnings - which you should probably fix, but the server will still run without them, that's not what's causing the error.

Server compilation error on some pages apache mono

We have a .net web application running in fedora 6 under Apache & mono 1.1.18 version. So long it was working good. Suddenly I'm getting the following Server Error in some of the pages,
Server Error in '/' Application
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Error message:
(0,0) : error CS0006: Cannot find assembly `/tmp/apache-temp-aspnet-0/383ed40f/shadow-J7sRQf'
But please note, rest of the pages are loading properly. I know it has something to do with JIT compilation, but why it is happening on some specific pages. Also the error 'Cannot find assembly -----/shadow-J7sRQf' is something suspicious. The same error is displayed across all the browsers all the time.
I have not restarted apache or rebooted the system, as I'm not sure whether this error will occur again and i want to root cause it instead of just ignoring it. i didn't find anything on the httpd log also. I tried to Google it, but was unlucky to find anything specific. Can anyone help me on this? thanks in advance.
Wow, mono 1.1.18 is really old!
If I were you, I would try to stop apache and clean everything in the temporary compilation directory /tmp/apache-temp-aspnet-0/
This should force mono to re-generate everything in this directory.
Then, restart apache and see if it helps.

Subversion failed on Centos

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.