차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
| homeserverwithdebian:certbotandapache2 [2024/04/03 13:19] – [2. Apache2 설정] baecy | homeserverwithdebian:certbotandapache2 [2024/08/05 09:32] (현재) – [3. Certbot 설정] baecy | ||
|---|---|---|---|
| 줄 10: | 줄 10: | ||
| sudo cp / | sudo cp / | ||
| - | <fileprism src=:sites-available:gamu.kr.conf/> | + | <codeprism title=gamu.kr.conf lang=apacheconf show-invis=false> |
| - | <codedoc code:bash> | + | < |
| + | ServerName | ||
| + | ServerAlias www.gamu.kr ## ServerAlias는 더 추가 가능 | ||
| + | |||
| + | ServerAdmin webmaster@localhost | ||
| + | DocumentRoot | ||
| + | |||
| + | ErrorLog ${APACHE_LOG_DIR}/ | ||
| + | CustomLog ${APACHE_LOG_DIR}/ | ||
| + | |||
| + | SSLEngine on | ||
| + | |||
| + | SSLCertificateFile | ||
| + | SSLCertificateKeyFile | ||
| + | <FilesMatch "\.(?:cgi|shtml|phtml|php)$"> | ||
| + | SSLOptions +StdEnvVars | ||
| + | </ | ||
| + | < | ||
| + | SSLOptions +StdEnvVars | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| sudo a2ensite gamu.kr.conf | sudo a2ensite gamu.kr.conf | ||
| - | sudo systemctl restart apache2 | + | sudo systemctl restart apache2</ |
| - | </codedoc> | + | |
| \\ | \\ | ||
| ==== 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 | ||
| 줄 31: | 줄 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:// | ||
| 줄 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> | + | \\ |