Failed install of letsencrypt on ubuntu 16.04

Hello
I installed letsencrypt via sudo apt-get install python-certbot-apache on ubuntu 16.04.
after install my /etc/letsencrypt directory is empty. I installed the options-ssl-apache.conf file from one I got at https://raw.githubusercontent.com/certbot/certbot/master/certbot-apache/certbot_apache/options-ssl-apache.conf
but now I’m getting errors because there is no /etc/letsencrypt/live directory.

The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error while running apache2ctl configtest.\nAction ‘configtest’ failed.\nThe Apache error log may have more information.\n\nAH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/mysite.com-le-ssl.conf:\nSSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist

Any help appreciated.
Thanks

Hi @gildedpage,

I’m a bit confused about the sequence of events here. Why did you decide that you needed to get your own copy of the options-ssl-apache.conf file? And what Certbot commands did you run? Did you change anything in /etc before or after running these commands?

Normally Certbot creates everything that it needs in /etc/letsencrypt — when it’s actually run.

I get the errors after I install certbot and run:

sudo certbot --apache -d mysite.com -d www.mysite.com

I am following the tutorial at

Could you post your logs from /var/log/letsencrypt?

2017-07-10 04:13:17,671:DEBUG:certbot.main:certbot version: 0.14.2
2017-07-10 04:13:17,672:DEBUG:certbot.main:Arguments: [’–apache’, ‘-d’, ‘thecodepress.com’, ‘-d’, ‘www.thecodepress.com’]
2017-07-10 04:13:17,672:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoin$
2017-07-10 04:13:17,692:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2017-07-10 04:13:17,692:DEBUG:certbot.cli:Default Detector is Namespace(account=<certbot.cli._Default object at 0x7f3c619e70d0>, agree_dev_pre$
2017-07-10 04:13:17,702:DEBUG:certbot.log:Root logging level set at 20
2017-07-10 04:13:17,703:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2017-07-10 04:13:17,704:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2017-07-10 04:13:17,791:ERROR:certbot.util:Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/thecodepress.com-le-ssl.conf:
SSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist or is empty

2017-07-10 04:13:17,794:DEBUG:certbot.plugins.disco:Misconfigured PluginEntryPoint#apache: Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/thecodepress.com-le-ssl.conf:
SSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist or is empty
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/certbot/plugins/disco.py”, line 120, in prepare
self._initialized.prepare()
File “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, line 172, in prepare
self.config_test()
File “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, line 1819, in config_test
raise errors.MisconfigurationError(str(err))
MisconfigurationError: Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/thecodepress.com-le-ssl.conf:

SSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist or is empty
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/certbot/plugins/disco.py”, line 120, in prepare
self._initialized.prepare()
File “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, line 172, in prepare
self.config_test()
File “/usr/lib/python2.7/dist-packages/certbot_apache/configurator.py”, line 1819, in config_test
raise errors.MisconfigurationError(str(err))
MisconfigurationError: Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/thecodepress.com-le-ssl.conf:
SSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist or is empty

2017-07-10 04:13:17,796:DEBUG:certbot.plugins.selection:Single candidate plugin: * apache
Description: Apache Web Server plugin - Beta
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.configurator:ApacheConfigurator
Initialized: <certbot_apache.configurator.ApacheConfigurator object at 0x7f3c68bbb7d0>
Prep: Error while running apache2ctl configtest.
Action ‘configtest’ failed.
The Apache error log may have more information.

AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/thecodepress.com-le-ssl.conf:
SSLCertificateFile: file ‘/etc/letsencrypt/live/thecodepress.com/fullchain.pem’ does not exist or is empty

2017-07-10 04:13:17,799:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None

Thanks, that’s very helpful!

Did you have some Let’s Encrypt certificates before that you deleted for some reason?

yes I had the old version (letsencrypt) which i purged because the certs would not update.

I’m not sure I completely understand the sequence of events, but my thought would be that if you didn’t customize mysite.com-le-ssl.conf, you should probably delete it (including both the file in /etc/apache2/sites-available and the symbolic link in /etc/apache2/sites-enabled) and then restart Apache. You should then be able to start over without encountering this particular error.

The reason for this is that the file mysite.com-le-ssl.conf is an Apache configuration file that was created by Certbot (the new name of the letsencrypt client for over a year now) and that referenced your old certificates. When you deleted the old certificates, this configuration file became invalid, but it still exists and refers to these nonexistent files.

That worked. I’m back up and running.
Thanks!

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