# Script letsencrypt multidomain

**URL:** <https://community.letsencrypt.org/t/script-letsencrypt-multidomain/65202>\
**Category:** Server\
**Created:** [June 25, 2018, 3:34pm UTC](https://community.letsencrypt.org/t/script-letsencrypt-multidomain/65202 "2018-06-25T15:34:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattmurdock78](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mattmurdock78](https://community.letsencrypt.org/u/mattmurdock78)\
**Post date:** [June 25, 2018, 3:34pm UTC](https://community.letsencrypt.org/t/script-letsencrypt-multidomain/65202/1 "2018-06-25T15:34:44Z")

</div>

hi,  
I am looking to make a script to renew automatic multi domain letsencrypt

Here is the script that I retrieved on the net and that I adapted

"#! / Bin / sh

DOMAIN = [prod-cald-sooner.universcine.com](http://prod-cald-sooner.universcine.com) [www.cinemasalademande.com](http://www.cinemasalademande.com)

# move to the correct let’s encrypt directory

cd / etc / letsencrypt / live / $ DOMAIN

# cat files to make combined .pem for haproxy

cat fullchain.pem privkey.pem\> /usr/local/etc/haproxy/certs/$DOMAIN.pem

# reload haproxy

/ usr / sbin / service haproxy reload "

I then did:

sudo certbot renew --dry-run

And he put me several error messages:

Attempting to parse the version 0.23.0 renewal configuration file found at /etc/letsencrypt/renewal/www.cinemasalademande.com.conf with version 0.14.2 of Certbot This might not work.  
Cert not due for renewal, but simulating renewal for dry run  
Could not choose appropriate plugin: The requested apache plugin does not appear to be installed  
Attempting to renew cert from /etc/letsencrypt/renewal/www.cinemasalademande.com.conf produced an unexpected error: The requested apache plugin does not appear to be installed. Skipping.  
\*\* DRY RUN: simulating ‘certbot renew’ close to cert expiry  
\*\* (The test certificates below have not been saved.)

The following certs were successfully renewed:  
/etc/letsencrypt/live/prod-cald-sooner.universcine.com/fullchain.pem (success)

The following certs could not be renewed:  
/etc/letsencrypt/live/prod-cald-sooner.universcine.com-0001/fullchain.pem (failure)  
/etc/letsencrypt/live/www.cinemasalademande.com/fullchain.pem (failure)  
\*\* DRY RUN: simulating ‘certbot renew’ close to cert expiry  
\*\* (The test certificates above have not been saved.)

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [June 25, 2018, 4:34pm UTC](https://community.letsencrypt.org/t/script-letsencrypt-multidomain/65202/2 "2018-06-25T16:34:05Z")

</div>

Hi @mattmurdock78,

There are lots of things to comment on here:

> [@mattmurdock78](#):
>
> "#! / Bin / sh

This needs to be `#!/bin/sh`, not `#! / Bin / sh`.

> [@mattmurdock78](#):
>
> cd / etc / letsencrypt / live / $ DOMAIN

And this needs to be `cd /etc/letsencrypt/live/$DOMAIN`. However, it doesn't make sense with multiple domains, only with a single domain.

This script appears to be something like what Certbot called a deploy script, which is meant to be run by Certbot after a successful renewal has happened in order to make use of the newly-renewed certificates in an appropriate way. However, it's not quite right for that purpose, because it's hard-coded the domain name. It would be helpful to know exactly what you're trying to do with this script.

> [@mattmurdock78](#):
>
> sudo certbot renew --dry-run
> 
> And he put me several error messages:
> 
> Attempting to parse the version 0.23.0 renewal configuration file found at /etc/letsencrypt/renewal/www.cinemasalademande.com.conf with version 0.14.2 of Certbot This might not work.

This shows that you have both `certbot` (from your operating system package manager) and `certbot-auto` (from having downloaded it from our site) installed on your system at the same time. They continue to be distinct and have separate versions. You should probably continue to use `certbot-auto` rather than `certbot`.

> [@mattmurdock78](#):
>
> Could not choose appropriate plugin: The requested apache plugin does not appear to be installed

This may be possibly also be due to the `certbot` vs. `certbot-auto` issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [July 25, 2018, 4:34pm UTC](https://community.letsencrypt.org/t/script-letsencrypt-multidomain/65202/3 "2018-07-25T16:34:08Z")

</div>

Closed on July 25, 2018, 4:34pm UTC

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