# Sync challenges validation to another server

**URL:** <https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876>\
**Category:** Help\
**Created:** [February 1, 2018, 4:49am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876 "2018-02-01T04:49:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangsan](https://avatars.discourse-cdn.com/v4/letter/z/e47774/32.png) [@zhangsan](https://community.letsencrypt.org/u/zhangsan)\
**Post date:** [February 1, 2018, 4:49am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876/1 "2018-02-01T04:49:25Z")

</div>

Can I sync challenges validation to another server(using scp or rsync) instead of that validation is only in that server the domain pointing to?  
The server B generating cert is different from the server A that domain pointing to.  
server A: [xxx.example.com](http://xxx.example.com)  
server B: [yyy.example.com](http://yyy.example.com)

For eg: I want sync cert from B to A the after creating and before testing.

Maybe that logic is in this file, letsencrypt/certbot/plugins/webroot.py, line 203.

I add this code ([logger.info](http://logger.info)(“webroot: %s”, validation\_path)), and I run "./letsencrypt-auto certonly --webroot -w /tmp/a/ -m [xxx@xxx.com](mailto:xxx@xxx.com) -d [xxx.example.com](http://xxx.example.com) --agree-tos -vvvv"  
It does not work.

What should I do? Thanks!

Please help!!

I ran this command:./letsencrypt-auto certonly --webroot -w /tmp/a/ -m [xxx@xxx.com](mailto:xxx@xxx.com) -d [xxx.example.com](http://xxx.example.com) --agree-tos

It produced this output:  
"

 404 Not Found 
# 404 Not Found

* * *
"

My web server is (include version):nginx version: openresty/1.9.7.3

The operating system my web server runs on is (include version):CentOS release 6.5 (Final)

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

---

<div class="post-metadata">

**Author:** ![\_az](https://avatars.discourse-cdn.com/v4/letter/_/22d042/32.png) [@\_az](https://community.letsencrypt.org/u/_az)\
**Post date:** [February 1, 2018, 4:55am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876/2 "2018-02-01T04:55:27Z")

</div>

I can think of a couple of options.

You can use a `--manual-auth-hook` ([documented here](https://certbot.eff.org/docs/using.html#pre-and-post-validation-hooks)) to perform the rsync/scp.

You can also redirect requests for challenge resources to an entirely different server and Let’s Encrypt will follow it:

For example,

```auto
GET http://xxx.example.com/.well-known/acme-challenge/xx
 
HTTP/1.1 302 Found
Location: http://yyy.example.com/.well-known/acme-challenge/xx

```

Whichever is easier/more suitable for you.

---

<div class="post-metadata">

**Author:** ![zhangsan](https://avatars.discourse-cdn.com/v4/letter/z/e47774/32.png) [@zhangsan](https://community.letsencrypt.org/u/zhangsan)\
**Post date:** [February 1, 2018, 5:37am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876/3 "2018-02-01T05:37:01Z")

</div>

Tkx.  
Actually, [xxx.example.com](http://xxx.example.com) is binding to a CDN, and CDN get source files from OSS in [aliyun.com](http://aliyun.com). I can only put the file from that server to OSS. So the second way setting 302 is unworkable.

But I try

```auto
./letsencrypt-auto certonly --manual --manual-auth-hook ./authenticator.sh --manual-cleanup-hook ./cleanup.sh -m xxx@xxx.com -d xxx.example.com --agree-tos
[root@haha005 letsencrypt]# cat authenticator.sh cleanup.sh
#!/bin/bash
echo $CERTBOT_VALIDATION > /tmp/a/.well-known/acme-challenge/$CERTBOT_TOKEN
scp -P10022 /tmp/a/.well-known/acme-challenge/$CERTBOT_TOKEN root@xxx.example.com:/opt/nginx/html/acme-challenge/.well-known/acme-challenge/
#!/bin/bash
rm -f /tmp/a/.well-known/acme-challenge/$CERTBOT_TOKEN

```

It works.

---

<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:** [February 1, 2018, 5:39am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876/4 "2018-02-01T05:39:42Z")

</div>

Another good tool for this might be the `getssl` client, which I believe has a remote webroot feature (which does something basically like this). I’m glad you’ve also found a way to get it to work with Certbot.

---

<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:** [March 3, 2018, 5:39am UTC](https://community.letsencrypt.org/t/sync-challenges-validation-to-another-server/51876/5 "2018-03-03T05:39:43Z")

</div>

Closed on March 3, 2018, 5:39am UTC

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