LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2018, 08:39 AM   #1
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

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


I have configured custom port and I have configured certificates properly.
But my http server is failing to start and getting error as below.
Code:
 /etc/init.d/httpd start
Starting httpd: [Tue May 15 15:25:53 2018] [warn] _default_ VirtualHost overlap on port 9216, the first has precedence
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:1212
no listening sockets available, shutting down
Unable to open logs
I tried for the pid of http and tool which was already listening on 1212 as below commands. But not find any pid.

Code:
ps -aux |grep httpd

lsof -i tcp:1212
Part of my http conf file looks as below:
Code:
Listen 1212
<VirtualHost *:1212>
Timeout 3000
SSLEngine ON
SSLCertificateFile /var/aaa/conf/aaa.cer
SSLCertificateKeyFile /var/aaa/conf/aaa.key

LoadModule perl_module "/var/aaa/conf/mod_perl.so"
DocumentRoot "/var/aaa"


Please help me to find possible reason and to fix the issue.
 
Old 05-15-2018, 10:25 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by nagendrar View Post
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:1212
The server cannot bind to address 0.0.0.0 because it is a special IP address meaning broadcast, or all stations. You cannot bind to a non-address on your system. Your system needs to have an actual real unicast IP address to bind services to.
 
Old 05-15-2018, 10:35 AM   #3
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
What's the output of

#httpd -D DUMP_VHOSTS
or
#httpd -S
(No idea if these are distro specific. Mine is CentOS, so ymmv)

Also, if you have SELinux enforced, have you set the correct context ?
#semanage port -l | grep 'your_port'

Also, check this to see if your port is already being used-
#fuser -n tcp 'your_port'

Edit - WRT what rtmistler said above, absolutely correct. Make http listen to a specific network/interface first.
in httpd.conf you should see something similar to -
#Listen 12.34.56.78:80

Last edited by Honest Abe; 05-15-2018 at 10:40 AM.
 
Old 05-15-2018, 10:54 AM   #4
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
Also,a simple web-search gave me this and multiple references to stackoverflow.
 
Old 05-16-2018, 03:31 AM   #5
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

Original Poster
Rep: Reputation: 15
Thanks for replies. But not solved my problem. My machine is centos6.9.

I can definitely say that 1212 port is not using by any application.
But I am getting below issue
Code:
[root@aaa~]# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:1212
no listening sockets available, shutting down
Unable to open logs
                                                     [FAILED]
As I mentioned in my first comment, I am getting empty output for below commands:

Code:
ps -aux |grep httpd

lsof -i tcp:1212

Is there any other possible reason/solutions? Please help me to fix the issue.

Last edited by nagendrar; 05-16-2018 at 03:55 AM.
 
Old 05-16-2018, 03:37 AM   #6
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
Unless you mention what you have tried so far, or provide the O/Ps, there's nothing a bunch of volunteers can do.
 
Old 05-16-2018, 04:13 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
Quote:
I can definitely say that 1212 port is not using by any application.
But I am getting below issue

[root@aaa~]# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:1212
no listening sockets available, shutting down
Unable to open logs
[FAILED]
You may have more than one "Listen 1212" directive in your apache config.
You may run the following command and find all the "Listen ..." directives:
Code:
grep -ri ^Listen /etc/httpd/
Also check the apache error_log to see if you find anything


Regards
 
Old 05-16-2018, 04:32 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
In this context 0.0.0.0 means all IPv4 addresses on the local machine. To see how the servers are configured to listen run the command as root
netstat -tulpn

Not an apache expert by any means and you did not post enough of your configuration file but I believe you need a NamedVirtualHost line.

https://wiki.apache.org/httpd/CommonMisconfigurations
 
Old 05-16-2018, 07:24 AM   #9
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

Original Poster
Rep: Reputation: 15
Got the reason. We have "Include conf.d/*.conf" condition in httpd.conf file and we have our custom http backup file with '.conf' extension is available in /etc/httpd/conf.d.

Issue was fixed after renaming it.
Thanks for responses.
 
Old 05-16-2018, 08:25 AM   #10
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
Glad it's sorted. Please mark the thread as solved.
 
  


Reply



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
(98)Address already in use: make_sock: could not bind to address [::]:443 eliassal Linux - Server 3 10-27-2010 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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