라떼군 이야기
cafe24 가상서버 apache SSL 적용 문제
Problem
cafe24의 가상서버 서비스를 이용해 호스팅 하고 있는 서비스의 SSL 적용을 해야 하는 이슈가 생겼다.
centos와 apache를 이용하고 있었다.
SSL 적용 자체는 간단했지만 cafe24와 관련된 문제가 있어서 정리해 두려고 한다.
문제는 mod_ssl을 설치하는 과정에서 발생했다.
mod_ssl 설치 문제
yum install mod_ssl
apache에 mod_ssl이 설치되있지 않아서 위 명령을 통해 설치를 진행해야 했지만 yum repo에 접속할 수 없었다.
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp-srv2.kddilabs.jp
* epel: download.nus.edu.sg
* extras: ftp-srv2.kddilabs.jp
* updates: ftp-srv2.kddilabs.jp
* webtatic: uk.repo.webtatic.com
http://mirror.kakao.com/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
http://ftp.jaist.ac.jp/pub/Linux/CentOS/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://ftp.riken.jp/Linux/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://ftp.nara.wide.ad.jp/pub/Linux/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://mirrors.cat.net/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://mirror.opensourcelab.co.kr/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirror.opensourcelab.co.kr/centos/7.8.2003/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30000 milliseconds')
Trying other mirror.
http://mirror.navercorp.com/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://ftp.tsukuba.wide.ad.jp/Linux/centos/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://ftp.kaist.ac.kr/CentOS/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/7.8.2003/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
...
iptables 확인
iptables을 확인해봐도 outbound 방화벽에 문제는 없었다.
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
cafe24 페이지의 방화벽을 확인해봐도 80, 443이 열려 있었기 때문에 정책상 문제가 없어 보였다.
Solution
cafe24 페이지에서 방화벽 기능을 OFF 하고 진행하고 작업 후 다시 설정하면 가능하다.
항상 그런 것은 아니지만 가상서버의 경우 해당 방화벽 기능 적용에 문제가 있는 듯 하다.
추가로 yum repo 캐시도 정리하고 진행했다.
yum clean expire-cache