Hi
I’m trying to install ssl on my site hosted on Google cloud. deploy with Bitnami using Apache, and Debian 8.
When I try to run certbot – sudo certbot --apache
I get the next message:
The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError((‘There has been an error in parsing the file (%s): %s’, ‘/etc/apache2/sites-availabl
e/000-default.conf.save’, ‘Syntax error’),)
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly. #ServerNamewww.example.com
ServerAdmin
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
Actually, I don’t think Certbot should be parsing that file at all. It seems to be parsing all files in sites-available for Debian, but the default Apache configuration seems to have changed between Debian 7 and 8 - it apparently now only looks for *.conf. Ubuntu seems to have made the same change, somewhere between 12.04 and 14.04.
Is there any way to override that default in Certbot?
…that being said - doesn’t Bitnami include its own Apache that’s separate from the one installed by apt, and puts all the configuration somewhere else entirely?
I did a new installation of my site, and try to run Certbot again.
This time I got this error:
self.restart() │
│ File │
│ “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, │
│ line 1665, in restart │
│ self._reload() │
│ File │
│ “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, │
│ line 1676, in _reload │
│ raise errors.MisconfigurationError(str(err)) │
│ 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 domain name, using 127.0.0.1. Set the ‘ServerName’ │
│ directive globally to suppress this message │
│ (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.
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. Set the ‘ServerName’ directive globally to suppress this message
(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
How did you install certbot? Did you type a command like sudo apt-get install python-certbot-apache? If so, do you remember if it installed an apache2 package as a dependency?
My understanding is that Bitnami has its own installation of apache, and installing python-certbot-apache (rather than certbot) might cause apt to install Debian’s normal apache too. I think certbot may then be trying to configure the wrong one.
I’m not entirely familiar with Bitnami, just downloaded the VM to explore a bit as a few people have reported having trouble with it, but I haven’t used it on an actual website myself.
Using the webroot plugin would look something like this:
Replace example.com with your real domain name; remove -d www.example.com if you don’t use the www subdomain. You might have to change the paths if Bitnami is installed in a different location or you’re using a different web root.
If that works, edit the Apache configuration in /opt/bitnami/apache2/conf. Find these two lines:
Hmm, did you start over with a new VM or something? If so, you’ll need to install Certbot again. I’d suggest that you follow the installation instructions at https://certbot.eff.org/ but (since you’re using Bitnami) replace python-certbot-apache with just certbot.
In other words, assuming you’re still using Debian 8: enable backports as you did before, then type:
Ok, I did that and tried to install webroot this is what I got as response,
Traceback (most recent call last):
File “/usr/bin/certbot”, line 6, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3019, in @_call_aside
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3003, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 655, in _build_master
ws.require(requires)
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 963, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python2.7/dist-packages/pkg_resources/init.py”, line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘ndg-httpsclient’ distribution was not found and is required by requests
artofchangetherapy@artofcangetherapy-vm:~$
Only thing I can think of is, maybe your Apt is somehow configured not to install recommended packages, only dependencies? Then it could have missed python-ndg-httpsclient which would normally be installed automatically.
You could test this theory by manually installing that package with