차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
homeserverwithdebian:certbotandapache2 [2024/04/03 13:34] – [2. Apache2 설정] baecy | homeserverwithdebian:certbotandapache2 [2024/08/05 09:32] (현재) – [3. Certbot 설정] baecy | ||
---|---|---|---|
줄 13: | 줄 13: | ||
< | < | ||
ServerName | ServerName | ||
- | | + | |
ServerAdmin webmaster@localhost | ServerAdmin webmaster@localhost | ||
줄 34: | 줄 34: | ||
< | < | ||
sudo a2ensite gamu.kr.conf | sudo a2ensite gamu.kr.conf | ||
- | sudo systemctl restart apache2 | + | sudo systemctl restart apache2</ |
- | </ | + | |
\\ | \\ | ||
==== 3. Certbot 설정 ==== | ==== 3. Certbot 설정 ==== | ||
- | <codedoc code:bash> | + | <codeprism lang=bash cmd=true> |
sudo certbot --apache | sudo certbot --apache | ||
sudo systemctl restart apache2 | sudo systemctl restart apache2 | ||
- | sudo systemctl status certbot.timer | + | sudo systemctl status certbot.timer |
- | </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, | ||
+ | </ | ||
==== 4. DDNS 자동 갱신 ==== | ==== 4. DDNS 자동 갱신 ==== | ||
- | / | + | **/ |
- | <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 | ||
줄 52: | 줄 61: | ||
[Service] | [Service] | ||
Type=oneshot | Type=oneshot | ||
- | ExecStart=/ | + | ## DNSZi 사이트에서 코드 발행후 입력 |
- | </codedoc> | + | ExecStart=$(type -p wget) -q -O - ' |
- | / | + | **/ |
- | <codedoc code:systemd> | + | <codeprism lang=systemd> |
[Unit] | [Unit] | ||
Description=Run DDNS(https:// | Description=Run DDNS(https:// | ||
줄 67: | 줄 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> | + | \\ |