Error while running apache2ctl graceful

I tried the command “sudo certbot --apache” with “www.fotocomercial.com.br” that is hosted on a Bitnami image in AWS EC2.

I got this output:

Starting new HTTPS connection (1): supporters.eff.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated)  (Enter 'c' to cancel): www.fotocomercial                                                                             .com.br
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for www.fotocomercial.com.br
Enabled Apache rewrite module
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Unable to restart apache using ['apache2ctl', 'graceful']
Cleaning up challenges
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Unable to restart apache using ['apache2ctl', 'graceful']
Encountered exception during recovery:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 202                                                                             3, in _reload
util.run_script(self.constant("restart_cmd"))
  File "/usr/lib/python3/dist-packages/certbot/util.py", line 86, in run_script
raise errors.SubprocessError(msg)
certbot.errors.SubprocessError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 75, in han                                                                             dle_authorizations
resp = self._solve_challenges(aauthzrs)
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 126, in _s                                                                             olve_challenges
resp = self.auth.perform(all_achalls)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 212                                                                             5, in perform
self.restart()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 201                                                                             3, in restart
self._reload()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 204                                                                             1, in _reload
raise errors.MisconfigurationError(error)
certbot.errors.MisconfigurationError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 202                                                                             3, in _reload
util.run_script(self.constant("restart_cmd"))
  File "/usr/lib/python3/dist-packages/certbot/util.py", line 86, in run_script
raise errors.SubprocessError(msg)
certbot.errors.SubprocessError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/certbot/error_handler.py", line 108, in _                                                                             call_registered
self.funcs[-1]()
  File "/usr/lib/python3/dist-packages/certbot/auth_handler.py", line 310, in _c                                                                             leanup_challenges
self.auth.cleanup(achalls)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 215                                                                             0, in cleanup
self.restart()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 201                                                                             3, in restart
self._reload()
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 204                                                                             1, in _reload
raise errors.MisconfigurationError(error)
certbot.errors.MisconfigurationError: Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
The Apache error log may have more information.

AH00558: apache2: Could not reliably determine the server's fully qualified doma                                                                             in name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress th                                                                             is message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:8                                                                             0
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.                                                                             0:80
no listening sockets available, shutting down
AH00015: Unable to open logs


IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

How to proceed?

Did you install python-certbot-apache? If so, it will have installed a second copy of Apache as a dependency (the operating system’s default apache package), alongside the one provided as part of Bitnami. I’d advise uninstalling that, eg sudo apt remove --auto-remove python-certbot-apache (or the equivalent for your operating system).

If you want to continue using Certbot, I’d suggest then installing certbot-auto from https://dl.eff.org/certbot-auto rather than using your operating system’s package manager. Certbot’s apache plugin does have some options to specify where Apache and its files are installed (type ./certbot-auto --help apache for a list). I’ve never personally managed to make them work with Bitnami, but I vaguely recall reading that someone did.

Alternatively you could try following Bitnami’s own tutorial, which uses Lego instead of Certbot.

 sudo apt remove --auto-remove python-certbot-apache
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  apache2 apache2-bin apache2-data apache2-utils augeas-lenses certbot libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libaugeas0 liblua5.1-0
  linux-aws-headers-4.4.0-1065 linux-headers-4.4.0-1065-aws linux-image-4.4.0-1065-aws python-certbot-apache python3-acme python3-augeas python3-certbot
  python3-certbot-apache python3-configargparse python3-funcsigs python3-future python3-icu python3-josepy python3-mock python3-parsedatetime python3-pbr
  python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface ssl-cert
0 upgraded, 0 newly installed, 36 to remove and 19 not upgraded.
After this operation, 150 MB disk space will be freed.

If I remove " apache2 apache2-bin apache2-data apache2-utils" will it also remove my previous application?

If you’re using Bitnami, it installs its own copy of Apache, typically in /opt/ which is separate from the one installed by apt. I’m assuming your application is using Bitnami’s apache, so uninstalling apt’s apache shouldn’t negatively affect it (and has the positive effect that you won’t have two copies of Apache competing for the same ports when the server reboots).

I had success with Lego.

Thanks for help! :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.