LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-31-2003, 06:23 AM   #1
bruvajon
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
Question (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443


Hey, just wondering if anyone can help me with this problem.

I have browsed numerous forums for answers to this, but nothing seems to help!

the httpd service for some reason generates this error message when i use the httpd -E error.log command.

When i use the netstat -A inet -lnp command, httpd is listening on ports 443 and 80, which i think is fine.

However, i presume there should only be one instance of the process running.. when i use the lsof -i tcp:443 command it returns the following:

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

httpd 2690 root 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2691 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2692 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2693 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2694 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2695 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2696 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2697 apache 4u IPv4 13608 TCP *:https (LISTEN)
httpd 2698 apache 4u IPv4 13608 TCP *:https (LISTEN)

also, the same is for lsof -i tcp:80.

I have tried killing all the processes and then restrting the service, but the service seems to start, but when it has finished there is no instance of it listening on ports 443 and 80.

I am getting fairly fed up of this now, can anyone help?!


Cheers,
Jon
 
Old 10-31-2003, 06:49 AM   #2
musrum
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 112

Rep: Reputation: 15
I'm not entirely sure when you see this problem.

The error message means that when httpd tried to start, some other process was already listening on 443. The multiple instances of httpd runniing is normal. Note that the first one is running as root, the others as apache.

When apache starts it spawns child processes that service the requests from clients. The number is controlled by settings in the httpd.conf file.The best way to start and stop apache is to use 'apachectl start' and 'apachectl stop'

If you have no httpd processes running, is port 443 in use? If not, do you still get the error when starting apache?
 
Old 11-03-2003, 04:44 AM   #3
bruvajon
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
hey, thanks for replying.

I started by starting the httpd service automatically at startup
(ntsysv menu command.) After statup, i use the http -E error.log command to output the error. The error is

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

I then stopped the httpd service starting at bootup to check if anything else was using the ports.

By using the netstat -A inet -lnp and lsof -i tcp:443 commands, i realised that there were no services listening on ports 80 and 443 when the httpd service was not running. Also, the lsof -i tcp:443 and lsof -i tcp:80 commands returned nothing.

I have tried starting the apache and httpd services, but both return the same error message.

It seems very strange as there are no other processes using posts 80 or 443 therefore, it is confilicting with itself?!

Jon
 
Old 11-03-2003, 06:12 AM   #4
qnumberq
LQ Newbie
 
Registered: Aug 2003
Location: Phoenix, AZ
Distribution: RH9.0, FBSD4.x
Posts: 4

Rep: Reputation: 0
Is it possible that this distro came with an apache already installed, that starts at boot? Perhaps that starts before your current install, and is taking port 80/443.
 
Old 11-03-2003, 06:54 AM   #5
bruvajon
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I am running redhat 9, which comes with httpd and therefore presumably(?) apache?

As i said though, without httpd being specified to start at bootup, it seems there is nothing listening.

The problems seem to some when you start the service itself!
 
Old 11-03-2003, 12:13 PM   #6
musrum
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 112

Rep: Reputation: 15
I don't know what the http -E command is. Assume your machine is called foo.bar.com.

1. When you reboot your machine, before you do any thing else, what happens if from a browser you navigate to http://foo.bar.com, and then to https://foo.bar.com? If you get a test page, or any page from both, life is good, you don't have a problem with apache.

2. If you fail to to get a response to the https navigation, then run 'apachectl stop'. Then 'ps -ax | grep http'. At this point you should get nothing.

3. Try 'netstat -an -t | grep 443'. If at this point you get nothing, and you got no page from the https request, your problem isn't what you think it is. If you do get something, then use lsof to find out what's using 443. If it is httpd, then your system is misconfigured, it is starting two separate instances of apache.

4. If you get here, delete _all_ the log files in the apache log directory. Then run 'apachectl start'. The 'netstat -an -t | grep 443'. If you get nothing, then run 'apachectl stop', and then look at the apache error log. If you got something, and still don't get anything from the https url, then 'apachectl stop', and look at the error log. If there are no errors, it may be a firewall issue.

5. Let us know where you got
 
Old 11-04-2003, 03:26 AM   #7
bruvajon
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,

I was actually using the httpd -E ERROR.log to output the error to a file.

I tried to contact the website via the browser (which by the way has a bizarre "connection refused" to internet sites even though squid works fine and clients can use it as a proxy!)
Anyway, i could contact both the http and https sites and the page i needed displaying which was definately encouraging!

My hostname is localhost.localdomain which will be the defualt i guess.

Where do i go from here? If apache is working properly, which it seems to be, clients still can't access this page.


Cheers,
Jon
 
Old 11-04-2003, 05:18 AM   #8
pazvant
Member
 
Registered: Jul 2003
Location: Istanbul
Distribution: slack
Posts: 43

Rep: Reputation: 15
Bind error

Hi , the error you got is an bind error.If you restart the bind service and then restart apache the 0.0.0.0....etc problem must have to stop..
Be sure your bind service works properly byee.
 
Old 11-04-2003, 12:22 PM   #9
bruvajon
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks!

I just wanted to say thanks to all those who helped me and posted messages about the problem i've been having.

For some reason, after i entered a DNS entry for the intranet site i was trying to host it worked fine (ie. rather than typing in the IP of the server.)

So, thanks to all!

Jon
 
Old 03-06-2004, 02:56 PM   #10
pcKILLER
LQ Newbie
 
Registered: Mar 2004
Location: florida
Posts: 1

Rep: Reputation: 0
i had the same problem and i found the solution

i am running rh9
i had exactly the same problem
....
the solution was that the tux service was running
tux is a web server

stop that service and it will work!!!!

it worked for me!
 
Old 09-03-2004, 01:35 PM   #11
pushkarbhatkoti
LQ Newbie
 
Registered: Sep 2004
Location: New Delhi India
Posts: 1

Rep: Reputation: 0
make_sock: could not bind to address 0.0.0.0:443 or 80 (Solved from Pushkar India)

if u see this type of problem in apache webserve build in linux rh 7,9, 2.1 as, and other newer version

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

or

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80


do the following :

vi /etc/httpd/conf/httpd.conf

and replace the port 80 and port 443 with
port 80--->88
port 443 --> 448 for the timebeing.

to do quick find vi the file and than presh escap key and than put the ? question mark and than type 80 or 443 . to fine other 88 entry press n on the same time. anyhow let me kick ur ass now bcoz not suppose to teach all these things now..

well when u replaced them than u simply run the command

service htttpd restart
again to confirm service httpd restart

than see if it has started

service httpd status...
than u will see that ur webserver is started on port 88 and 448 for ssl. hummmmm

now try to browse http://ipaddressof ur linuxbox:88
http://ipadr:443

u will see that ur page is cameup...hummmmmmm but problem is not solved yet.
this teaches us that the prblem is with the port conflict..how can u track it..

put the command

lsif :80

u will see the several process are already running on port 80 so apachea can't start on the same port. so u have to kill all these apachea process using kill -9 <processid>

my logs:
=======
[root@ns root]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
xfs 19085 apache 18u IPv4 127053 TCP *:http (LISTEN)
sh 19086 apache 18u IPv4 127053 TCP *:http (LISTEN)
sh 19087 root 18u IPv4 127053 TCP *:http (LISTEN)
su 19088 root 18u IPv4 127053 TCP *:http (LISTEN)
bash 19089 root 18u IPv4 127053 TCP *:http (LISTEN)
[root@ns root]# kil -9 19085 19086
bash: kil: command not found
[root@ns root]# kill -9 19085 19086
[root@ns root]# lsof -i :80
[root@ns root]# lsof -i :443
[root@ns root]# lsof -i :443
[root@ns root]#
[root@ns root]#
[root@ns root]#
[root@ns root]#
[root@ns root]#
[root@ns root]# apachectl sto
usage: /usr/sbin/apachectl (start|stop|restart|fullstatus|status|graceful|configtest|help)

start - start httpd
stop - stop httpd
restart - restart httpd if running by sending a SIGHUP or start if
not running
fullstatus - dump a full status screen; requires lynx and mod_status enabled
status - dump a short status screen; requires lynx and mod_status enabled
graceful - do a graceful restart by sending a SIGUSR1 or start if not running
configtest - do a configuration syntax test
help - this screen

[root@ns root]# apachectl stop
/usr/sbin/apachectl stop: httpd (no pid file) not running
[root@ns root]# apachectl start
/usr/sbin/apachectl start: httpd started
[root@ns root]# lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 24957 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24958 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24959 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24960 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24961 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24962 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24963 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24964 root 19u IPv4 479222 TCP *:https (LISTEN)
httpd 24965 root 19u IPv4 479222 TCP *:https (LISTEN)
[root@ns root]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 24957 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24958 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24959 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24960 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24961 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24962 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24963 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24964 root 18u IPv4 479221 TCP *:http (LISTEN)
httpd 24965 root 18u IPv4 479221 TCP *:http (LISTEN)
[root@ns root]# service httpd status
httpd (pid 24965 24964 24963 24962 24961 24960 24959 24958 24957) is running...
[root@ns root]# ls
anaconda-ks.cfg dead.letter Linux_Backup mail Mail nsmail
[root@ns root]# cd /etc/httpd/config
bash: cd: /etc/httpd/config: No such file or directory
[root@ns root]# ls
anaconda-ks.cfg dead.letter Linux_Backup mail Mail nsmail
[root@ns root]# cd /etc/httpd
[root@ns httpd]# cd conf
[root@ns conf]# ls


Why this problem comes:
-------------------------------
this problem is comes only if u started the weberver and than made some modification or tried to load the jsp or asp support than u will find http locked when u tried to restart it .

so don't be confussed. just kill th process and than put ur configuration (original file) which has port 80 or 443.

it will work fine......

else mail me on my personal mail ilel
pushkar_bhatkoti@rediffmail.com
yahooo: pushkarbhatkoti@yahoo.com

My mobile is : 9810774912
I lives in New Delhi India.
cheers!!
 
Old 10-15-2006, 01:44 AM   #12
andrabr
LQ Newbie
 
Registered: Oct 2006
Posts: 1

Rep: Reputation: 0
One more cause

In my case the problem went away when I commented out

Listen :443

in httpd.conf

My GUESS is Apache was already grabbing this port via a virtual host in another config file, and a second attempt to hold onto it confues good old Apache to such an extent that it would just totally give up. This could be happening to you ;-)

A>
 
Old 01-12-2007, 10:02 AM   #13
TheGlish
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
[QUOTE=andrabr]In my case the problem went away when I commented out

Listen :443

in httpd.conf

My GUESS is Apache was already grabbing this port via a virtual host in another config file, and a second attempt to hold onto it confues good old Apache to such an extent that it would just totally give up. This could be happening to you ;-)

Last edited by TheGlish; 01-12-2007 at 10:05 AM.
 
Old 01-12-2007, 10:06 AM   #14
TheGlish
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
This can happen if you have two ssl config files because the httpd.conf includes the ssl.conf like so:
Include "/etc/httpd/conf.d/*.conf"

There for if you have made any changes to an ssl config file and renamed the old one xxssl.conf for instance
both files will be included because of the "*" infront of conf

When appache is loaded it reads the first and allocates the ports then trys to read the second,
when reading the second ssl.conf it finds the ports have already been bound. Apache then bombs out and drops the bound ssl ports, and as a result you cant see any bindings on netstat

Simple
 
Old 04-20-2007, 06:13 AM   #15
watski
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
I had this problem too. It turned out that i had the "Listen 80" directive in two config files:

/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/system-config-httpd.conf

The latter comes from the Fedora Core system configurator for httpd. Removing "Listen 80" from httpd.conf solved the problem. I tried the above descriptions but I had noone listening on port 80 which got me confused.


Cheers,
Johan

Last edited by watski; 04-20-2007 at 06:18 AM.
 
  


Reply

Tags
apache, bind, http


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[crit] (98) Address already in use: make_sock could not bind to port 3339. ForumKid Linux - Networking 4 06-10-2008 02:38 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
how can i remove an address bind sibu_rajappan Linux - Networking 0 12-24-2004 01:50 AM
bind : Address already in use sheni Linux - Networking 1 11-11-2004 12:41 PM
cannot bind to socket: address already in use exfacior Linux - Wireless Networking 0 09-27-2004 12:34 PM


All times are GMT -5. The time now is 01:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration