I have a OwnCloud install on Debian, using apache. I've successfully configured a lets encrypt certificate and that's working great on files.example.com.

I'd like another domain pointing to the same as well but using the domain files.example.net. I've created a new conf file for apache, used a2ensite to create a link, restarted apache. I changed the server name in the conf to match the extra domain but when I go to run the cert bot command with -d files.example.net I get the following error;

Cannot find a cert or key directive in /files/etc/apache2/sites-available/001-default.conf/VirtualHost. VirtualHost was not modified
 Unable to find cert and/or key directives

Below is the 2nd conf file for apache, the 1st one is identical other than the domain names.

<VirtualHost *:443>
        ServerName files.extradomain.com
    ServerAlias files.extradomain.com
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/owncloud

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

#RewriteEngine on
#RewriteCond %{SERVER_NAME} =files.extradomain.com
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
  • Did you reload apache config afer editing the file? – Jenny D Jun 16 '17 at 8:46
  • Please include the actual config in your question. – Jenny D Jun 16 '17 at 8:47
  • I've included the apache config, but i'm not sure if this is the issue as I can browse with the second domain name fine; I just get a ssl warning – Nathan Jun 16 '17 at 8:55
  • Could I get away with using 1 (the default) apache conf file and using serveralias for the extra domain? Would the certbot pick that up? – Nathan Jun 16 '17 at 8:57
  • I think it should work; letsencrypt do issue certs with SAN which is what you'd be using in that case. I think you should try it, and if it works you can write it up and post as your own answer to this question; it can help someone else down the road. – Jenny D Jun 16 '17 at 9:03

I added a Server Alias to the apache conf with the new domain. I then reran with certbot --apache and it automatically found both domains. I made sure I requested a new SSL certificate when asked.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.