LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-14-2014, 04:08 AM   #1
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

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


Hi All,

I am very new to apache. I just installed httpd 2.2 package and I am tried to setup a website.

First time my service was started successful but whne when I have done change in my index.html file and tried to restart the httpd service I got the below error.

Code:
[root@test init.d]# service 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]
After doing some Googling I found below solution.

Code:
[root@test init.d]# lsof -i tcp:80
COMMAND  PID   USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
httpd   3960 apache    4u  IPv6 16318753      0t0  TCP *:http (LISTEN)
Killing the above process works for me but whenever I restart httpd service I have to search and kill the process.

There are no other services running on port 80. I tried the below thread also but it didn't helped me.

http://www.linuxquestions.org/questi...-443-a-110753/

Could you please suggest me the solution what causing the issue.


Regards,
Yogesh

Last edited by yogesh_attarde; 04-14-2014 at 04:11 AM.
 
Old 04-14-2014, 05:59 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
Just 'restart' instead of 'start', or even 'stop' then 'start'
Don't go around killing processes at random like that.
 
Old 08-20-2014, 06:47 AM   #3
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

Original Poster
Rep: Reputation: 1
Hi Chris,

Thanks for you reply but the solution you suggested didn't worked for me.

What could be the issue?

Regards,
Yogesh
 
Old 08-20-2014, 11:30 AM   #4
sreewave
LQ Newbie
 
Registered: Aug 2014
Location: India.
Posts: 2

Rep: Reputation: Disabled
The issue here could be that 'stop' is not working. I assume that you are issuing 'service httpd stop' before starting it.

Does it say 'OK' after you issue the '/etc/init.d/httpd stop' command?
 
Old 08-20-2014, 04:25 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
If you have virtualhost entries such as
Code:
Listen xxx.yyy.zzz.aaa:80
<VirtualHost xxx.yyy.zzz.aaa:80>
edit httpd.conf and add a remark in front of "Listen 80"

Restart using
Code:
service httpd graceful
See what happens.
 
Old 08-20-2014, 11:43 PM   #6
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

Original Poster
Rep: Reputation: 1
@sreewave, Yes, it says 'OK' after I issue the '/etc/init.d/httpd stop' command

@Habitual, My current configuration contains
Code:
Listen 80
<VirtualHost url:80>
I tried to change it to
Code:
Listen xx.yy.zz.aa:80
but I am getting same error. I edit VirtualHost entry to xxx.yyy.zzz.aaa:80 and xxx.yyy.zzz.aaa but no luck.

Last edited by yogesh_attarde; 08-20-2014 at 11:45 PM.
 
Old 08-21-2014, 12:13 AM   #7
yogesh_attarde
Member
 
Registered: Jan 2010
Posts: 82

Original Poster
Rep: Reputation: 1
Hi All,

I found the reason behind this. When I run lsof -i -n|grep http is still running, If I kill this process then I will be able to start the httpd service without any error.

Code:
 lsof -i -n|grep http
httpd     12899  apache    4u  IPv4 1911876905      0t0  TCP *:http (LISTEN)
It seems that /etc/init.d/httpd stop is not working though it gives OK.

How can I kill or stop this process so that I can restart httpd service.


Regards,
Yogesh

Last edited by yogesh_attarde; 08-21-2014 at 12:24 AM.
 
  


Reply


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
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 bruvajon Linux - Software 34 11-30-2011 03:08 PM
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listen jsaravana87 Linux - Server 1 11-25-2011 10:45 AM
apache2 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 spedax Linux - Server 1 09-22-2011 11:47 AM
[SOLVED] (98)Address already in use: make_sock: could not bind to address [::]:443 eliassal Linux - Networking 9 10-29-2010 10:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration