(98)Address already in use: make_sock: could not bind to address 0.0.0.0:1212
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(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.
(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.
#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.
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.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.