-1

I am working on AWS EC2 Ubuntu machine. I am not able to restart my apache server. following is the error is showing when i use Listen 80 in ports.conf

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

$ service apache2 restart * Restarting web server apache2
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information.

and when I go with Listen 8080

Listen 8080

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

$ service apache2 restart * Restarting web server apache2
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:443 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:443 no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information.

This all happen when I go for SSL. logs are empty. no error found in logs (/var/log/apache2)

8
  • Are you running the restart as superuser (i.e. sudo service apache2 restart)? If not, you need to - you can't bind to ports under 1024 without superuser. Also, edit your question and include the output of sudo netstat -tulpn | grep 443 – Thomas Ward Sep 30 '15 at 16:06
  • I tried with sudo su too. but face same – urfusion Sep 30 '15 at 16:07
  • Edit your question and include the output of sudo netstat -tulpn | grep 443 – Thomas Ward Sep 30 '15 at 16:07
  • sudo netstat -tulpn | grep 443 run fine. – urfusion Sep 30 '15 at 16:11
  • same error when run restart command after netstat -tulpn | grep 443 run – urfusion Sep 30 '15 at 16:13
1

"Permission Denied" indicates that you don't have permissions to bind to a port.

This can happen for several reasons, including:

  1. Not using sudo or superuser powers when restarting Apache
  2. Something else is already listening on port 80 or 443.

Firstly, for Port 80, check this: sudo netstat -tulpn | grep :80. This will list all processes binding to port 80 and their names on the rightmost column.

For port 443, use this, and the same general thing should be kept in mind: sudo netstat -tulpn | grep :443.


Note, though, that the port 443 problem may be related to issues I've observed.

There is also an issue on 14.04 that I've personally observed, which is that listening with the ssl_module and mod_gnutls will cause this problem too (discovered when configuring a service). You will need to comment out one or the other in ports.conf and use one or the other rather than both. (Or, have mod_gnutls listen on a different port, or mod_ssl listen on a different port)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.