July 7, 2015

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

Summary: In this post i tried to explain how to resolve the issue of apache bind address. The issue is Apache: could not bind to address to port (make_sock).
If you are going to upgrade server software, or sometime you try to make changes in the configurations files and you are restarting the apache. This time you Funk your Wang-alls.
Step-1: Check apache processes
ps -e | grep httpd
24215 ? 00:00:00 httpd
24217 ? 00:00:00 httpd
24218 ? 00:00:00 httpd
24219 ? 00:00:00 httpd
24220 ? 00:00:00 httpd
24221 ? 00:00:00 httpd
24222 ? 00:00:00 httpd
24223 ? 00:00:00 httpd
24224 ? 00:00:00 httpd
24225 ? 00:00:00 httpd
[root@imran~]# kill 24215
[root@imran ~]# kill 24215
-bash: kill: (21415) – No such process
[root@imran ~]# ps -e | grep httpd
[root@imran~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
Step-2: Start apache service 
sudo /etc/init.d/apache2 start
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
Unable to open logs
…fail!
Apache is attempting to listen on port 8080, but can’t because it’s already in use. There are a few reasons why this might be happening.
Port configuration problem:
If you configure duplicate Listen Entries in ports.conf and apache.conf it will bother you.  So make sure you have single time entry in both files. either in apache.conf or in ports.conf. Other then that you have to check and confirm the apache.conf have single entry for ports.conf.
Listen 8080
#
# Listen 443
#Another service could be using the port
Step-3:I was ran to the same error because of apache another instance was already running. I used netstat, grep and kill the process and fix the problem.
# try to start apache, receive error
root@imran~: sudo /etc/init.d/apache2 start
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
Unable to open logs
…fail!
Step-4: See what applications using the port (note that I’m searching for :80, I could also use :8080)
root@imran~: sudo netstat -tulpn| grep :80
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 29004/apache2
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 28964/nginx
# I see that apache2 is using 8080! Kill it!
root@imran~: killall -9 apache2
# Let’s try again, with success
~: sudo /etc/init.d/apache2 start
* Starting web server apache2
…done.
All we have to check and follow where we have catch the problem rather than restarting services again and again. The better is to dig the issue evaluate and resolve it properly.
Hope this will help someone and will save time.

Related Posts:

  • [ERROR] No package .... available. addo | 951 B 00:00base | 1.1 kB 00:00extras | 2.1 kB 00:00updates | 1.9 kB 00:00Excluding Packages in global exclude listFinishedSetting up Install ProcessNo package soap available.Nothing to do when you install another pa… Read More
  • Lệnh cài đặt phần mềm rpm Trong Linux, để cài đặt phần mềm ta cài từ các gói có phần mở rộng là .rpm. Tương tự như trong Windows là các tập tin msi hay exe. Để cài đặt các gói phần mềm này từ dòng lệnh, chúng ta sử dụng lênh rpm với cú pháp… Read More
  • View DELL Service Tag and Express Service Code From Linux and Windows When you call DELL customer support for any help, they will ask for either Service Tag or Express Service Code. You also need service tag to download drivers and documentations from DELL support website.&… Read More
  • Linux: Monitor Hard Disks Temperature With hddtemp There is a nice utility to monitor hard drive temperature. Most modern x86 computer harddisk comes with S.M.A.R.T (Self-Monitoring, Analysis, and Reporting Technology). It is a monitoring system for computer h… Read More
  • Kỹ thuật check shell, mã độc trên server linux1: Login quyền root ssh! bằng putty: Bước 1: Chạy lệnh # touch checkshell.txt ( touch là lện tạo file )Bước 2: Chạy lệnh egrep "cgitelnet|webadmin|base64_decode|PHPShell|tryag|r 57shell|c99shell|sniper|noexecshell|/et… Read More

0 comments:

Post a Comment