-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)

urfusion
  • 281

1 Answers1

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)

Thomas Ward
  • 80,112