# Can't renew certificate: We were unable to find a vhost with a ServerName or Address

**URL:** <https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675>\
**Category:** Server\
**Created:** [February 28, 2016, 5:05pm UTC](https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675 "2016-02-28T17:05:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anton.kumaigorodskiy](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@anton.kumaigorodskiy](https://community.letsencrypt.org/u/anton.kumaigorodskiy)\
**Post date:** [February 28, 2016, 5:05pm UTC](https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675/1 "2016-02-28T17:05:16Z")

</div>

Hi, I'm trying to test the renewal of my certificate using  
`letsencrypt renew --agree-tos --dry-run`

but getting the following error:

> 2016-02-28 11:50:35,980:WARNING:letsencrypt.cli:Attempting to renew cert from /etc/letsencrypt/renewal/btcontract.com.conf produced an unexpected error: Failed to run Apache plugin non-interactively  
> Missing command line flag or config entry for this setting:  
> We were unable to find a vhost with a ServerName or Address of [btcontract.com](http://btcontract.com).  
> Which virtual host would you like to choose?  
> Choices: ['000-default-le-ssl.conf | | HTTPS | Enabled', '000-default.conf | | | Enabled', 'le-redirect.conf | | | ', 'default-ssl.conf | | HTTPS | Enabled']  
> (The best solution is to add ServerName or ServerAlias entries to the VirtualHost directives of your apache configuration files.). Skipping.

`ls /etc/apache2/sites-available/` gives

> 000-default-le-ssl.conf 000-default.conf default-ssl.conf le-redirect.conf

As far as I understand letsencrypt wants me to put some parameters (namely, ServerName or ServerAlias) in one (or more?) of these files but I'm not that good at managing Apache so I'd like to ask what exactly do I have to do here? Thanks!

---

<div class="post-metadata">

**Author:** ![wmpedersen](https://avatars.discourse-cdn.com/v4/letter/w/f9ae1b/32.png) [@wmpedersen](https://community.letsencrypt.org/u/wmpedersen)\
**Post date:** [March 2, 2016, 5:23pm UTC](https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675/2 "2016-03-02T17:23:15Z")

</div>

> [@anton.kumaigorodskiy](#):
>
> 000-default-le-ssl.conf 000-default.conf le-redirect.conf

In these config files you need to make sure there is a line that says "ServerName [btcontract.com](http://btcontract.com)" but only if all the defaults are for one website. usually it is default to [example.com](http://example.com) - It tells your apache server what the site identifies as and where the root of the website is (DocumentRoot /var/www etc...)

---

<div class="post-metadata">

**Author:** ![anton.kumaigorodskiy](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@anton.kumaigorodskiy](https://community.letsencrypt.org/u/anton.kumaigorodskiy)\
**Post date:** [March 3, 2016, 8:36pm UTC](https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675/3 "2016-03-03T20:36:01Z")

</div>

Thanks, adding

> ```
> ServerName btcontract.com
> ServerAlias www.btcontract.com
> 
> ```

to `000-default-le-ssl.conf` did the trick.

---

<div class="post-metadata">

**Author:** ![iljamm](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/iljamm/32/17835_2.png) [@iljamm](https://community.letsencrypt.org/u/iljamm)\
**Post date:** [November 6, 2017, 11:45am UTC](https://community.letsencrypt.org/t/cant-renew-certificate-we-were-unable-to-find-a-vhost-with-a-servername-or-address/11675/4 "2017-11-06T11:45:44Z")

</div>

This helped me with similar setup on DigitalOcean. Thanks
