LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 (https://www.linuxquestions.org/questions/linux-software-2/98-address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-0-443-a-110753/)

bruvajon 10-31-2003 06:23 AM

(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

musrum 10-31-2003 06:49 AM

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?

bruvajon 11-03-2003 04:44 AM

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

qnumberq 11-03-2003 06:12 AM

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.

bruvajon 11-03-2003 06:54 AM

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!

musrum 11-03-2003 12:13 PM

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

bruvajon 11-04-2003 03:26 AM

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

pazvant 11-04-2003 05:18 AM

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.

bruvajon 11-04-2003 12:22 PM

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

pcKILLER 03-06-2004 02:56 PM

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!

pushkarbhatkoti 09-03-2004 01:35 PM

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!!

andrabr 10-15-2006 01:44 AM

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>

TheGlish 01-12-2007 10:02 AM

[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 ;-)

TheGlish 01-12-2007 10:06 AM

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:p

watski 04-20-2007 06:13 AM

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


All times are GMT -5. The time now is 03:08 AM.