There’s no completely reliable way to automatically identify a “webroot” with Tomcat. Each application that uses Tomcat tends to come with a custom Tomcat configuration. Often times, there is no “webroot”.
You can create your own webroot configuration by modifying conf/server.xml
.
Find the <Host>
tag, and add inside it:
<Context path="/.well-known/acme-challenge" docBase="/var/www/letsencrypt/.well-known/acme-challenge" />
Then run:
mkdir -p /var/www/letsencrypt/.well-known/acme-challenge
and restart Tomcat.
Once you’ve done that, you can do e.g.:
certbot certonly --webroot -w /var/www/letsencrypt -d www.templeconnect.com -d templeconnect.com