Story:
We run an app server that needs to connect to domain ghsemarang.com. The domain is using SSL and needs to access our app. But since the website is using SSL, our app has to be turned into SSL as well under domain hms.ghsemarang.com.
Installation was successful when I used standalone and turn tomcat off. But, when I turn the tomcat on again, the renewal failed. The renewal conf was using standalone. I changed it to webroot.
I created a folder under webapps/ROOT/.well-known/acme-challange made sure it is chmod to 777 and then I add in the web.xml the following:
<servlet>
<servlet-name>DefaultServletOverride</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Add a mapping for our new default servlet -->
<servlet-mapping>
<servlet-name>DefaultServletOverride</servlet-name>
<url-pattern>/.well-known/acme-challenge/</url-pattern>
</servlet-mapping>
</web-app>
I was able to test and see the content of acme-challenge, but upon running dry run renewal, I was met with error message like below (404) with a hint that I need to make sure the folder are allowed to be used to save file from internet.
How do I do that with tomcat. I added both init param listing=true and readonly=false and it is still producing error. How do I allow tomcat to make my subfolder receive any file?
All helps are greatly appreciated.
My domain is: app.mydomain.com
I ran this command: certbot renew --dry-run
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/hms.ghsemarang.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Simulating renewal of an existing certificate for hms.ghsemarang.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: app.mydomain.com
Type: unauthorized
Detail: x.x.x.x: Invalid response from http://app.mydomain.com/.well-known/acme-challenge/mtYvurZuCy6IIpCRvvId7r7Sc8tdmxbZ5KyvhzThYKc: 404
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Failed to renew certificate hms.ghsemarang.com with error: Some challenges have failed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All simulated renewals failed. The following certificates could not be renewed:
/etc/letsencrypt/live/hms.ghsemarang.com/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
My web server is (include version): Tomcat 9.0.1
The operating system my web server runs on is (include version): Ubuntu 16.04.7 LTS
My hosting provider, if applicable, is: Self hosted server behind public IP.
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. Pure conf file.
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 1.32.2