homeserverwithdebian:certbotandapache2

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
homeserverwithdebian:certbotandapache2 [2024/04/03 13:27] – [2. Apache2 설정] baecyhomeserverwithdebian:certbotandapache2 [2024/08/05 09:32] (현재) – [3. Certbot 설정] baecy
줄 10: 줄 10:
 sudo cp /etc/apache2/sites-available/{default-ssl,gamu.kr}.conf</codeprism> sudo cp /etc/apache2/sites-available/{default-ssl,gamu.kr}.conf</codeprism>
  
-<fileprism src=:homeserverwithdebian:gamu.kr.conf.doc/> +<codeprism title=gamu.kr.conf lang=apacheconf show-invis=false> 
-<codedoc code:bash>+<VirtualHost *:443> 
 + ServerName  gamu.kr     ## 추가 
 +    ServerAlias www.gamu.kr ## ServerAlias는 더 추가 가능  
 +  
 + ServerAdmin webmaster@localhost 
 + DocumentRoot /var/www/html 
 + 
 + ErrorLog ${APACHE_LOG_DIR}/error.log 
 + CustomLog ${APACHE_LOG_DIR}/access.log combined 
 + 
 + SSLEngine on 
 + 
 + SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem 
 + SSLCertificateKeyFile   /etc/ssl/private/ssl-cert-snakeoil.key 
 + <FilesMatch "\.(?:cgi|shtml|phtml|php)$"> 
 + SSLOptions +StdEnvVars 
 + </FilesMatch> 
 + <Directory /usr/lib/cgi-bin> 
 + SSLOptions +StdEnvVars 
 + </Directory> 
 +</VirtualHost></codeprism> 
 +<codeprism lang=bash host=debian>
 sudo a2ensite gamu.kr.conf sudo a2ensite gamu.kr.conf
-sudo systemctl restart apache2 +sudo systemctl restart apache2</codeprism>
-</codedoc>+
 \\ \\
 ==== 3. Certbot 설정 ==== ==== 3. Certbot 설정 ====
-<codedoc code:bash>+<codeprism lang=bash cmd=true>
 sudo certbot --apache   ## 실행후 질문에 선택사항 입력. !!Double Dash!! sudo certbot --apache   ## 실행후 질문에 선택사항 입력. !!Double Dash!!
 sudo systemctl restart apache2 sudo systemctl restart apache2
-sudo systemctl status certbot.timer  ## 갱신 작동 확인 +sudo systemctl status certbot.timer  ## 갱신 작동 확인</codeprism> 
-</codedoc+ 
-\\+다음과 같은 메세지 출력시에는 
 +<code bash cmdout> 
 +Unable to find corresponding HTTP vhost;  
 +Unable to create one as intended addresses conflict;  
 +Current configuration does not support automated redirection 
 +</code
 + 
 +이 방법으로 적용 
 +<code bash> 
 +certbot certonly --standalone -d gamu.kr,www.gamu.kr 
 +</code>
 ==== 4. DDNS 자동 갱신 ==== ==== 4. DDNS 자동 갱신 ====
-/usr/lib/systemd/system/gamu.service +**/usr/lib/systemd/system/gamu.service** 작성 
-<codedoc code:systemd>+<codeprism lang=systemd>
 [Unit] [Unit]
 Description=gamu.kr & www.gamu.kr DDNS(DnsZi) Renewal Service Description=gamu.kr & www.gamu.kr DDNS(DnsZi) Renewal Service
줄 31: 줄 61:
 [Service] [Service]
 Type=oneshot Type=oneshot
-ExecStart=/usr/local/bin/wget -q -O - 'http://ddns.dnszi.com/set.html?user=<ddnzi-id>&auth=<dnszi-auth-key>&domain=gamu.kr&record=' +## DNSZi 사이트에서 코드 발행후 입력 
-</codedoc>+ExecStart=$(type -p wget-q -O - 'http://ddns.dnszi.com/set.html?user=<ddnzi-id>&auth=<dnszi-auth-key>&domain=gamu.kr&record='</codeprism>
  
-/usr/lib/systemd/system/gamu.timer +**/usr/lib/systemd/system/gamu.timer** 작성 
-<codedoc code:systemd>+<codeprism lang=systemd>
 [Unit] [Unit]
 Description=Run DDNS(https://dnszi.com) Service Renewal twice daily Description=Run DDNS(https://dnszi.com) Service Renewal twice daily
줄 46: 줄 76:
 [Install] [Install]
 WantedBy=timers.target WantedBy=timers.target
-</codedoc>+</codeprism>
  
 systemd 등록, 실행 systemd 등록, 실행
-<codedoc code:bash>+<codeprism cmd=true lang=bash>
 sudo systemctl enable gamu.timer  # 부팅시 타이머 실행 설정 sudo systemctl enable gamu.timer  # 부팅시 타이머 실행 설정
 sudo systemctl start gamu.timer   # 타이머 실행 sudo systemctl start gamu.timer   # 타이머 실행
-sudo systemctl status gamu.kr     # 등록한 타이머 상태 확인 +sudo systemctl status gamu     # 등록한 타이머 상태 확인</codeprism> 
-</codedoc>+\\
  • homeserverwithdebian/certbotandapache2.1712150873.txt.gz
  • 마지막으로 수정됨: 2024/04/03 13:27
  • 저자 baecy