Letsencrypt-auto won't see the Apache vhosts anymore


I am running Apache/2.4.16 on a 12.04.5 Ubuntu. When the beta was first opened a while back I have successfully ran the letsencrypt client and install a few certificates.

Recently I wanted to install a certificate for a new domain and I was running the usual command

./letsencrypt-auto --apache --server https://acme-v01.api.letsencrypt.org/directory --agree-dev-preview 

and received

No names were found in your configuration files. You should specify ServerNames in your config files in order to allow for accurate installation of your certificate
If you do use the default vhost, you may specify the name manually.
Would you like to continue?

which was weird. apache2ctl configtest gives Syntax OK, and apache2ctl -S correctly displays all the vhost I have.

Anyway, I went further with the letsencrypt-auto's dialog

Please enter in your domain name(s) (comma and/or space separated)

but no joy:

No vhost exists with servername or alias of: my.domain.com. No
vhost was selected. Please specify servernames in the Apache config

my.domain.com is available on http and its .conf file looks like

<VirtualHost *:80>
    DocumentRoot "/home/..."
    ServerName my.domain.com
    ServerAdmin ..@...

    <Directory "/...">
        AllowOverride All
        Require all granted
        Options -Indexes

    ErrorLog /var/log/apache2/...
    LogLevel warn
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    CustomLog /var/log/apache2/... "vhost_combined"

I searched for similar problems but I couldn’t find any. I also tried to renew some of the existing domains, but the same thing happened.

For what it’s worth, I was using the commit 3256916 of the letsencrypt client.

Do you have any ideas?


Same thing for me, was rather painful. Solved it by doing it manually…

I don’t think it is the recommended way to do it, but what the hell, it works.

stop apache

In order to avoid conflict with the standalone servern You have to stop apache. I told you this is not the recommended way.

Oh, yeah, and you might double check that ssl is on with a2enmod ssl

generate certificates

/letsencrypt-auto certonly --standalone -d ryogasp.com -d www.ryogasp.com

duplicate your website conf.

cd /etc/apache2/sites-available/
cp ryogasp.com.conf ryogasp.com-ssl.conf 

The important part of the message is the path of the cert chain:

 - Congratulations! Your certificate and chain have been saved at

edit the -ssl.conf file

before it should look like this

        ServerName ryogasp.com
        ServerAlias www.ryogasp.com
        DocumentRoot /home/hostinguser/ryogasp.com/www
        <Directory /home/hostinguser/ryogasp.com/www>
                Require all granted
                AllowOverride All
        CustomLog /var/log/apache2/ryogasp.com.log combined

make it look like that

        ServerName ryogasp.com
        ServerAlias www.ryogasp.com
        DocumentRoot /home/hostinguser/ryogasp.com/www
        <Directory /home/hostinguser/ryogasp.com/www>
                Require all granted
                AllowOverride All
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/ryogasp.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/ryogasp.com/privkey.pem
        SSLCertificateChainFile /etc/letsencrypt/live/ryogasp.com/fullchain.pem
        CustomLog /var/log/apache2/ryogasp.com.log combined

Enable the vhost file

a2ensite ryogasp.com-ssl

Start apache

/etc/init.d/apache2 start