HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Error starting Apache (httpd start fails) (http://www.howtoforge.com/forums/showthread.php?t=19820)

cfspence 25th January 2008 22: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:
Quote:

# /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 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
It appears that port 80 is busy and not available for listening. How do I correct this?

Thanks in advance for your help.
--Clay

topdog 25th January 2008 22:55

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

unclecameron 26th January 2008 01: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 19: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 05: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:
Code:

[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_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -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 07:23

You can call netstat like this
Code:

netstat -ntlp
You can check your apache config like this
Code:

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 18:12.

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