사이트란 사이트 다뒤지고 했는데도 계속 /usr/share/tomcat8/.keystore를 찾을수 없다는 에러가 떠서
하루 삽질끝에 찾음;
참고 사이트
https://community.letsencrypt.org/t/using-lets-encrypt-with-tomcat/41082
1.certbot 설치
- sudo apt-get update
- sudo apt-get install software-properties-common
- sudo add-apt-repository universe
- sudo add-apt-repository ppa:certbot/certbot
- sudo apt-get update
sudo apt-get install certbot python-certbot-apache
sudo certbot certonly --webroot -w /path/to/tomcat/webapps -d yourdomain.com -d www.yourdomain.com
3. 인증서 생성 폴더 이동 후 openssl로 keystor 생성
cd /etc/letsencrypt/live/yourdomain.com openssl pkcs12 -export -out bundle.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -password pass:apassword
4. server.xml 에 아래 추가(/etc/tomcat8/server.xml)
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true" keystoreFile="/etc/letsencrypt/live/yourdomain.com/bundle.pfx" keystorePass="apassword" clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12"/>