48)Address already in use: AH00072: make_sock: could not bind to address [::]:80

后端 未结 5 1315
时光取名叫无心
时光取名叫无心 2021-02-04 06:43

I get a apache error when I try access to anything folder or file, it returns Http Not found or Forbidden I am trying restart and start apache

相关标签:
5条回答
  • 2021-02-04 07:09

    In my Mac with Mojave (10.14.1) suddenly Apache couldn't give to serve ipv4 anymore, then gave me ERROR 403. I tried to kill all apache (sudo killall httpd)... checking de PID's on (sudo lsof | grep AMP | grep apache)... even didn't work... just ipv6 was available... still ERROR 403.

    What works for me: Disable OSX's built-in Apache server.

    sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
    

    After that:

    sudo apachectl -k restart
    

    Be happy :)

    0 讨论(0)
  • 2021-02-04 07:27

    Try

    sudo netstat -ltnp | grep ':80'
    

    Output: tcp6 0 0 :::80 :::* LISTEN 1500/apache2

    sudo kill 1500
    sudo service apache2 restart
    
    0 讨论(0)
  • 2021-02-04 07:29

    this error ocurs because apache server listen by deafult in port 80 so another service or program is using that port and apache canot start.

    The solution is identify what program or service is using that port an then close, disable or unistall it.

    to identify you can run netstat

    sudo netstat -ltnp | grep ':80'
    

    or

    sudo lsof -i:80
    

    in my case i have installed nginx and apache at the same time and both uses the port 80.

    Temporary Solution: Stop or kill the service, program, etc.

    Permanent Solution:

    1. Change the port of apache server in config file /etc/apache2/apache2.conf
    2. Uninstall the service or program that uses port 80.

    in my case I needed both so I decided to temporarily fix it by disabling the service with:

    systemctl stop MyServiceName.service
    

    If it is a service otherwise use kill command.

    0 讨论(0)
  • 2021-02-04 07:31

    This one helped me:

    Please edit httpd.conf file.

    /usr/local/etc/httpd/httpd.conf
    

    And replace

    Listen 80
    

    with

    Listen 127.0.0.1:80
    

    Restart apache

    sudo apachectl -k restart
    
    0 讨论(0)
  • 2021-02-04 07:32

    One of a couple of things could be happening:

    1. You have a different version of apache running. You can make sure that you're using the correct one by running which apachectl. As an example, I also have two versions of apache /usr/sbin/apachectl and /usr/local/bin/apachectl
    2. You're not running apachectl start as root, although it appears that you are.
    3. You can run sudo lsof -i:80 to see what's binding that port currently
    0 讨论(0)
提交回复
热议问题