티스토리 뷰

사이트란 사이트 다뒤지고 했는데도 계속 /usr/share/tomcat8/.keystore를 찾을수 없다는 에러가 떠서


하루 삽질끝에 찾음;


참고 사이트

https://community.letsencrypt.org/t/using-lets-encrypt-with-tomcat/41082


1.certbot 설치


  1. sudo apt-get update
  2. sudo apt-get install software-properties-common
  3. sudo add-apt-repository universe
  4. sudo add-apt-repository ppa:certbot/certbot
  5. sudo apt-get update

sudo apt-get install certbot python-certbot-apache

2. 인증서 생성(80포트로 외부에서 접속되야함) (80/443포트로 실행시 권한 오류 날경우 /etc/default/tomcat8 을 열어서 맨아래 bindauth였나 yes로 수정)


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"/>

댓글