Installation Issues with LE ...only works pulling from git repo

I am having a little issue with my installation.

Sorry this is long, but want to be thorough. I am not a linux expert either, so my apologies in advance if this is a dumb question.

Logged in my user account (not root at the time)
Ubuntu 16.04
Apache 2.4.18 (as per dpkg -s Apache2 it is 2.4.18-2ubuntu3.1)
Python: 2.7.11-1 (as per dpkg -s Python)

I first installed LE as per the instructions here:

The difference was, that, I already had apache installed, and python installed, and I didn’t want to overwrite or mess up anything with those installations. So I ran the command like this:

$ sudo apt-get install letsencrypt

So that only LE was installed

I then run the letsencrypt command (with sudo. Without sudo, it gave me an error saying file permissions were denied)

letsencrypt --apache -d sub.mydomain.tld certonly
Traceback (most recent call last):
  File "/usr/bin/letsencrypt", line 9, in <module>
    load_entry_point('letsencrypt==0.4.1', 'console_scripts', 'letsencrypt')()
  File "/usr/lib/python2.7/dist-packages/letsencrypt/cli.py", line 1960, in main
    setup_logging(config, _cli_log_handler, logfile='letsencrypt.log')
  File "/usr/lib/python2.7/dist-packages/letsencrypt/cli.py", line 1873, in setup_logging
    config, logfile=logfile, fmt=fmt)
  File "/usr/lib/python2.7/dist-packages/letsencrypt/cli.py", line 1844, in setup_log_file_handler
    log_file_path, maxBytes=2 ** 20, backupCount=10)
  File "/usr/lib/python2.7/logging/handlers.py", line 117, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 64, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/letsencrypt/letsencrypt.log'

So ran with sudo

$ sudo letsencrypt --apache -d sub.mydomain.tld certonly

But it gave me an error:

The requested apache plugin does not appear to be installed

Not sure what the issue was. I then did the following:

git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
sudo /opt/letsencrypt/letsencrypt-auto --apache -d sub.mydomain.tld certonly

And I was then able to get my LE cert up and running just fine.

I did notice that when this ran, it had this output at first. Not sure if big deal at the time, so just ignored it.

Bootstrapping dependencies for Debian-based OSes...
(seemed to update packages from the Ubuntu repos)
Building dependency tree
Reading state information... Done
augeas-lenses is already the newest version (1.4.0-0ubuntu1).
ca-certificates is already the newest version (20160104ubuntu1).
gcc is already the newest version (4:5.3.1-1ubuntu1).
libaugeas0 is already the newest version (1.4.0-0ubuntu1).
libffi-dev is already the newest version (3.2.1-4).
python is already the newest version (2.7.11-1).
python-dev is already the newest version (2.7.11-1).
dialog is already the newest version (1.3-20160209-1).
python-virtualenv is already the newest version (15.0.1+ds-3).
virtualenv is already the newest version (15.0.1+ds-3).
libssl-dev is already the newest version (1.0.2j-1+deb.sury.org~xenial+1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log

So, everything up and running. I wanted to test the auto-renewal, so I did a dry-run

Again, I did it based on the instructions:

sudo letsencrypt renew --dry-run --agree-tos

But again, got an error about the apache plugin:

 sudo letsencrypt renew --dry-run --agree-tos
Processing /etc/letsencrypt/renewal/sub.mydomain.tld.conf
2016-10-20 18:07:34,709:WARNING:letsencrypt.cli:Attempting to renew cert from /etc/letsencrypt/renewal/sub.mydomain.tld.conf produced an unexpected error: The requested apache plugin does not appear to be installed. Skipping.
[...]
1 renew failure(s), 0 parse failure(s)

I ran it like I did above to get it to work:

$ sudo /opt/letsencrypt/letsencrypt-auto renew --dry-run --agree-tos

Again, like the time I ran it in this manner, got a bunch of output, bootstrapping, getting packages, creating virtual environment, installing Python. But after that, it processed the Certificate, and ran successfully.

So it seems the problem is that the Apache Plugin is not installed.

So I am wondering why I have to run it in such a manner (/opt/letsencrypt/letsencrypt-auto rather than just letsencrypt ? Also, I have python installed (even says in output, python is already the newest version (2.7.11-1). python-dev is already the newest version (2.7.11-1).), yet later in the output, it is saying it is installing Python packages.

Is it because I installed it incorrectly? (ran it as sudo apt-get install letsencrypt instead of sudo apt-get install python-letsencrypt-apache ) that is the only thing I can think of that might be the issue? But I am afraid of overwriting my apache vhosts/configuration if I do so?

Yes, it's because you didn't follow the documentation.

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