0

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]
</VirtualHost>
Nathan
  • 165
  • 8
  • Did you reload apache config afer editing the file? – Jenny D Jun 16 '17 at 08:46
  • Please include the actual config in your question. – Jenny D Jun 16 '17 at 08: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 08: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 08: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 09:03
  • And there's https://serverfault.com/questions/768629/letsencrypt-on-centos-6-with-multiple-virtualhosts about multiple apache virtualhosts with letsencrypt SSL certs – quadruplebucky Jun 16 '17 at 09:11

1 Answers1

1

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.

Nathan
  • 165
  • 8