Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache http server problems

Tags:

apache

apache2

I am using Apache version 2.2.20 (ubuntu) and attempting to use a custom httpd.conf setup however I am getting the following error message and would appreciate any guidance that can be given to me. I'm part of a dev team and was given this custom httpd.conf file so I don't really assume it to be the cause of the problem (but I'm not totally ruling out that possibility).

I run the command "sudo apache2ctl -k restart" and get the following result

[Fri Jul 06 11:33:34 2012] [warn] module ssl_module is already loaded, skipping
[Fri Jul 06 11:33:34 2012] [warn] module rewrite_module is already loaded, skipping
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action '-k restart' failed.
The Apache error log may have more information.

The two warnings I can get rid of if I comment out the lines (below) in my httpd.conf file. Do I really want to do this? Where can I go in order to verify that these modules are loaded somewhere else and that commenting them out in my conf file won't hurt anything?

LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so

As for the error related to not being able to bind to port 80, I cannot get it to go away. When I do a "sudo netstat -lnp | grep :80" I get the following

tcp        0      0 0.0.0.0:80       0.0.0.0:*      LISTEN      6233/apache2

I know that the above output means that apache thinks its running and for a time I was even able to see the "It Worked!" page when I navigated to localhost, but NOW I only get "Not Found Apache/2.2.20 (ubuntu) server at localhost port 443" when I go to that page. Also I cannot seem to kill the apache process running the "kill -9 6233" command only causes apache's PID to change (for example from 6233 to 6234). I have also tried to use the command "sudo etc/init.d/apache2 stop", it produces an "* Stopping web server apache2 [ OK ]" message but again I see the apache2 process taking up port 80.

Ideas on any of these issues would be appreciated.

like image 783
OrwellHindenberg Avatar asked Jul 06 '12 15:07

OrwellHindenberg


People also ask

Why is my Apache Web server not working?

There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.

Is Apache HTTP Server affected by log4j vulnerability?

Applications using only the log4j-api JAR file without the log4j-core JAR file are not impacted by this vulnerability. Also note that Apache Log4j is the only Logging Services subproject affected by this vulnerability. Other projects like Log4net and Log4cxx are not impacted by this.

What is Apache server error?

Apache gives 500 Internal Server Error when there is a server-side error that prevents Apache from processing a request and returning a proper response. This can be due to various reasons such as faulty code, inadequate file permissions, missing files referenced in code, etc.

What is Apache HTTP Server used for?

Apache HTTP Server is a free and open-source web server that delivers web content through the internet. It is commonly referred to as Apache and after development, it quickly became the most popular HTTP client on the web.


1 Answers

Look: "module xxx_module is already loaded"

Answer: You are loading those modules more than once. Try a search and comment/delete problematic lines:

In Centos/RHEL:

grep ssl_module -rI /etc/httpd/*   
/etc/httpd/conf/httpd.conf:LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so
/etc/httpd/conf.d/ssl.conf:LoadModule ssl_module modules/mod_ssl.so

In this case ^ I commented out line in /etc/httpd/conf/httpd.conf so all SSL stuff live in /etc/httpd/conf.d/ssl.conf

Same for rewrite_module

grep rewrite_module -rI /etc/httpd/*

In Debian/Ubuntu:

grep ssl_module -rI /etc/apache2/*
like image 102
Igor Parra Avatar answered Sep 21 '22 12:09

Igor Parra