# SSL on multiple subdomains on the same server

**URL:** <https://community.letsencrypt.org/t/ssl-on-multiple-subdomains-on-the-same-server/46539>\
**Category:** Help\
**Created:** [November 17, 2017, 12:10pm UTC](https://community.letsencrypt.org/t/ssl-on-multiple-subdomains-on-the-same-server/46539 "2017-11-17T12:10:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saptha](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@saptha](https://community.letsencrypt.org/u/saptha)\
**Post date:** [November 17, 2017, 12:10pm UTC](https://community.letsencrypt.org/t/ssl-on-multiple-subdomains-on-the-same-server/46539/1 "2017-11-17T12:10:05Z")

</div>

My domain is: [files.magicauthor.com](http://files.magicauthor.com) and [api.magicauthor.com](http://api.magicauthor.com)

I ran this command: sudo certbot certonly -a webroot --webroot-path=/\<location\_to\_doc\_root1\>/lets-encrypt-validation -d [api.magicauthor.com](http://api.magicauthor.com) --webroot-path=/\<location\_to\_doc\_root2\>/lets-encrypt-validation -d [files.magicauthor.com](http://files.magicauthor.com)

It produced this output: 2 different cert directories. [https://api.magicauthor.com](https://api.magicauthor.com) is working fine. whereas [https://files.magicauthor.com](https://files.magicauthor.com) fails

I also see that [https://crt.sh/?q=files.magicauthor.com](https://crt.sh/?q=files.magicauthor.com) doesn’t retrieve any results although the command had worked fine in the server.

I also tried the below command to replace the existing cert for [files.magicauthor.com](http://files.magicauthor.com); the command completed fine but to no avail. Please help.  
sudo certbot certonly -a webroot --webroot-path=/\<location\_to\_doc\_root\_2\>/lets-encrypt-validation -d [files.magicauthor.com](http://files.magicauthor.com)

My web server is (include version): nginx

The operating system my web server runs on is (include version): Ubuntu 16.04

My hosting provider, if applicable, is: DigitalOcean

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [November 17, 2017, 1:08pm UTC](https://community.letsencrypt.org/t/ssl-on-multiple-subdomains-on-the-same-server/46539/2 "2017-11-17T13:08:35Z")

</div>

`--webroot` (without `--standalone`) may only work if the `--webroot-path` matches the `root` statement in your conf file.  
Otherwise, let’s say:

1. root /var/www/html/mysite
2. –webroot-path /tmp/lets-encrypt-validation

then  
`http://mysite/.well-knwon/acme-challenge/string`  
looks for string file at:  
`/var/www/html/mysite/.well-known/acme-challenge/string`  
but string file was placed at:  
`/tmp/lets-encrypt-validation/.well-known/acme-challenge/string`

---

<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:** [December 17, 2017, 1:09pm UTC](https://community.letsencrypt.org/t/ssl-on-multiple-subdomains-on-the-same-server/46539/3 "2017-12-17T13:09:03Z")

</div>

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