Amazon EC2 - httpd error on start port 80 - (98)Address already in use: make_sock

6,402

Your netstat -tulpn | grep :80 command clearly shows that you have a service already listening on port 80 :

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      -
tcp        0      0 :::80                       :::*                        LISTEN      -

Identify this service by running :

sudo netstat -anp | grep :80

Then, Kill/Stop that service and restart httpd.

Share:
6,402

Related videos on Youtube

Justin Maat
Author by

Justin Maat

Updated on September 18, 2022

Comments

  • Justin Maat
    Justin Maat almost 2 years

    I'm unable to get httpd running on my AWS linux instance.

    I keep getting the following error whenever I try to start the service.

    $ 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
    

    I tried everything I can think of.

    -checked port 80, but don't show any running processes

    $ netstat -tulpn | grep :80
    
    (No info could be read for "-p": geteuid()=222 but you should be root.)
    tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      -
    tcp        0      0 :::8080                     :::*                        LISTEN      -
    tcp        0      0 :::80                       :::*                        LISTEN      -
    tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      -
    tcp        0      0 :::8009                     :::*                        LISTEN      -
    

    -checked to see if I had any other entries listening for port 80

    $ grep -r Listen /etc/httpd
    /etc/httpd/conf/httpd.conf:# Listen: Allows you to ...
    /etc/httpd/conf/httpd.conf:# Change this to Listen ...
    /etc/httpd/conf/httpd.conf:#Listen 12.34.56.78:80
    /etc/httpd/conf/httpd.conf:Listen 80
    

    -tried uninstalling , re-installing with yum installer

    I'm fairly new to Linux and setting up servers so I apologize if I'm missing something simple. Any ideas?

    Edit: Yikes, I was running ssh on port 80. Thanks you all

    • krisFR
      krisFR almost 10 years
      You have a running process on port 80. Please run and provide result for netstat -anp | grep :80
    • David Levesque
      David Levesque almost 10 years
      netstat does show a process running on port 80. Run with sudo to see which process.
    • Justin Maat
      Justin Maat almost 10 years
      Ok, I didn't know I had to run sudo to see the processes. Thanks for that.
    • Justin Maat
      Justin Maat almost 10 years
      Thank you both. I didn't realize I had a process running on the port.