./letsencrypt-auto --apache -d domain1.com -d www.domain1.com error

Hi all

I am stuck at initiating the LetsEncrypt client to start generating certs, I am running a working LAMP with Ubuntu 14.04 and current comodo certs

When I type:

./letsencrypt-auto --apache -d domain1.com -d www.domain1.com -d domain2.com -d www.domain2.com

I get this error:

The directory '/root/.cache/pip' or its parent directory is not owned by the current user and caching
 wheels has been disabled. 
check the permissions and owner of that directory. 
If executing pip with sudo, you may want sudo's -H flag.
Requesting root privileges to run with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt --apache -d domain1.com -d www.domain1.com -d domain2.com -d www.domain2.com
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', u'/etc/apache2/sites-enabled/domain1.com.conf', u'Syntax error'),)

Any assistance would be greatly appreciated

Apparently, the /etc/apache2/sites-enabled/domain1.com.conf file contains contents the Augeas lens file doesn’t recognise. But without the file contents itself, there’s nothing we can say about that.

Thanks for replying Osiris, my apologies about not posting the .conf file

I currently have paid DV certs that I would to replace with LetsEncrypt

Here it is:

<VirtualHost *:443>
        DocumentRoot /var/www/html
        ServerName albertainspector.com
        ServerAlias www.albertainspector.com
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/albertainspector_com.crt
        SSLCertificateKeyFile /etc/ssl/private/myserver2.key
        SSLCertificateChainFile /etc/ssl/certs/albertainspector_com.ca-bundle
        ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                BrowserMatch "MSIE [2-6]" \
                                nokeepalive ssl-unclean-shutdown \
                                downgrade-1.0 force-response-1.0
                #MSIE 7 and newer should be able to use keepalive
                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
                Header add Strict-Transport-Security: "max-age=15768000"
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Require all granted
                Satisfy Any
        </Directory>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|ico|png)$ \ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ \no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</VirtualHost>

If you see anything else that you might recommend that needs addressing, please let me know. I am pretty weak when it comes to the .conf files in my webserver.

Thanks for any assistance

Well, that’s quite the config you’ve got there… :stuck_out_tongue: Nothing really fancy if you’d ask me, but hey, I’m human, and Let’s Encrypt uses Augeas to parse the configuration files.

Now, I really have no clue at all how Augeas really works, but I’m quite positive it’s the reason your configuration isn’t properly parsed and it works somehow with files called “lenses”, which somehow tells Augeas how to parse a certain configuration file.

Here is the “lens” file distributed with Let’s Encrypt for the Apache configuration files. Perhaps you can figure out how exactly Augeas uses these “lens” files to parse the configuration file and why it doesn’t parse yours:

https://github.com/letsencrypt/letsencrypt/blob/master/letsencrypt-apache/letsencrypt_apache/augeas_lens/httpd.aug