Solved

getting apache error when restarting the service (98)Address already in use:

Posted on 2008-10-03
15
507 Views
Last Modified: 2010-04-21
The only way I seem to be able to correct this is by restarting the server.
I can restart Apache only right after the restart of the server. But it seems to happen after a little bit of time..
I am so confused as to who it is doing this...

Thank you for your help.
-J
0
Comment
Question by:jbrashear72
  • 8
  • 7
15 Comments
 
LVL 9

Expert Comment

by:khaledf
ID: 22637361
can you please paste the complete error message?
0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22637397
That was the complete error I got when I did httpd restart
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22637540
can you restart apache again and make sure if there is any missing part of the error message
what changes have you made recently to apache httpd.conf?
can you provide the follwoing info.?
operating system, version.
number of domains hosted. ie: 1 or more
is your website popular? heavy traffic?
hope this will be sufficient to anser
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22637559
and version of your apache server.
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22637617
if you can't see the complete error message then check it in the error log. it should be there.
0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22637698
I can't see the error in the logs...
Apache/2.2.3 (CentOS)
User/Group       apache(48)/48
Max Requests       Per Child: 4000 - Keep Alive: off - Max Per Connection: 100
Timeouts       Connection: 120 - Keep-Alive: 15
Virtual Server       Yes

Multiple vhosts.

System       Linux server.XXXXXXXX.com 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:35:07 EDT 2008 x86_64
Build Date       Sep 20 2007 10:05:56

'./configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter'


0
 
LVL 9

Expert Comment

by:khaledf
ID: 22637730
execute this command to see the error log
cat /var/log/httpd/error_log
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Author Comment

by:jbrashear72
ID: 22637761
Its full of crap like this:
[Wed Oct 01 21:15:20 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:20 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:20 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:21 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:21 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:21 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:22 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sqlweb
[Wed Oct 01 21:15:22 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:22 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/tools
[Wed Oct 01 21:15:23 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/admin
[Wed Oct 01 21:15:23 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/phpmyadmin2
[Wed Oct 01 21:15:23 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/phpMyAdmin2
[Wed Oct 01 21:15:24 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/PHPmyadmin
[Wed Oct 01 21:15:24 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/pma
[Wed Oct 01 21:15:24 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/PMA
[Wed Oct 01 21:15:24 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:25 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:25 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:25 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Wed Oct 01 21:15:26 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sqlmanager
[Wed Oct 01 21:15:26 2008] [error] [client 87.9.222.112] File does not exist: /var/www/html/sql
[Thu Oct 02 23:01:37 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:01:52 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:01:55 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:02:27 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:02:58 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:03:00 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:03:21 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:03:37 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Thu Oct 02 23:03:37 2008] [error] [client 221.192.199.36] script '/var/www/html/azenv.php' not found or unable to stat
[Fri Oct 03 10:03:12 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 11:18:46 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 11:18:46 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 11:18:46 2008] [notice] Digest: done
[Fri Oct 03 11:18:47 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 11:18:47 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 03 14:52:07 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 14:52:08 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 14:52:08 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 14:52:08 2008] [notice] Digest: done
[Fri Oct 03 14:52:08 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 14:52:09 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 03 14:52:11 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 14:52:11 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 14:52:11 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 14:52:11 2008] [notice] Digest: done
[Fri Oct 03 14:52:11 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 14:52:11 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 03 14:54:06 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 14:54:06 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 14:54:07 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 14:54:07 2008] [notice] Digest: done
[Fri Oct 03 14:54:07 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 14:54:07 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 03 15:19:54 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 15:19:54 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 15:19:54 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 15:19:54 2008] [notice] Digest: done
[Fri Oct 03 15:19:54 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 15:19:54 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Fri Oct 03 15:26:42 2008] [notice] caught SIGTERM, shutting down
[Fri Oct 03 15:26:42 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Oct 03 15:26:42 2008] [notice] Digest: generating secret for digest authentication ...
[Fri Oct 03 15:26:42 2008] [notice] Digest: done
[Fri Oct 03 15:26:42 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Fri Oct 03 15:26:43 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[root@server log]#      


But as you can see from the 1st to now it doesnt show that error.. But I got it today.

0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22637771
right now since the reboot I can restart the service...
But later tonight or tomorrow I will not be able to. I will get that message.
0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22637780
But this is the exact error that prints to screen:

 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22637848
apt-cache policy httpd
httpd:
  Installed: 2.2.3-11.el5_1.centos.3
  Candidate: 2.2.3-11.el5_1.centos.3
  Version Table:
 *** 2.2.3-11.el5_1.centos.3 0
        100 RPM Database


netstat -lnp | grep :::80
tcp        0      0 :::80                       :::*                        LISTEN      22411/httpd  
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22637880
I see, this indicates that apache is not shutting down completely before starting again

0
 
LVL 9

Accepted Solution

by:
khaledf earned 500 total points
ID: 22638072
when you try to restart apache next time and get the same error
try to execute the command

netstat -lnp | grep '0.0.0.0:80'

and then kill that process id
example:
kill -9 22411
try to restart apache and see if it restarts successfully

0
 
LVL 3

Author Comment

by:jbrashear72
ID: 22638291
OK I will try that later tonight or in the morning to give it time to fail..
0
 
LVL 3

Author Closing Comment

by:jbrashear72
ID: 31502824
That helped to locate the issue.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now