HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   Error starting Apache (httpd start fails) (

cfspence 25th January 2008 23:05

Error starting Apache (httpd start fails)
Advance apologies for the utter novice question.:o

In attempting to fix a slow server problem, I have somehow managed to "break" Apache. It will not now start (even when the system reboots).

Here is the error message:

# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address
no listening sockets available, shutting down
Unable to open logs
It appears that port 80 is busy and not available for listening. How do I correct this?

Thanks in advance for your help.

topdog 25th January 2008 23:55

Have you checked with netstat to see what is holding the port open ?

unclecameron 26th January 2008 02:59

you could also run Top or better yet install Htop and it will show you what process is hanging, then run

kill PID#

then start apache

falko 26th January 2008 20:33

Which distribution are you using, and how did you install Apache? Did you do any changes to the Apache configuration?

cfspence 28th January 2008 06:38

Thanks. Here is (some) of the information you requested.

I tried reading the man pages for netstat and I'm still not sure I have issued the command with the correct options - I tried several. It's still not obvious to me what is holding port 80 open. I would be happy to post some of the output if requested. There is no output (other than the column heading) if I simply issue netstat without options.

I have not installed HTop but did try running top. It is not obvious to me that there is a process that is hanging - how could I tell?

I installed Apache during the fc6 install (essentially following the "Installing a LAMP System with Fedora Core 6" how-to on how-to-forge). I may have may configuration changes but I don't think so (sorry to be so vague). I could post the httpd.conf file if that would be helpful. Here is the result of httpd -V:

[root@gnlewis log]# /usr/sbin/httpd -V
Server version: Apache/2.2.6 (Unix)
Server built:  Sep 18 2007 11:26:13
Server's Module Magic Number: 20051115:5
Server loaded:  APR 1.2.7, APR-Util 1.2.8
Compiled using: APR 1.2.7, APR-Util 1.2.8
Architecture:  32-bit
Server MPM:    Prefork
  threaded:    no
    forked:    yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Thanks again for your help.

topdog 28th January 2008 08:23

You can call netstat like this

netstat -ntlp
You can check your apache config like this

httpd -t
If you dont find the problem then maybe try strace to find out why apache is hanging.

All times are GMT +2. The time now is 06:18.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.