서버관리/Linux / / 2022. 11. 24. 16:31

CentOS 7/8을 VPN서버로 세팅하기

반응형

시중에 판매되는 VPN서버들이 많지만, 직접 세팅하여 사용할 필요가 있는 경우가 있습니다.

 

그럴 경우를 대비하여 리눅스서버(Centos 7 혹은 8)에 Outline VPN서버를 세팅하여 사용하는 방법에 대해 설명해 보려고합니다.

 

여러가지 VPN서버를 세팅해 봤지만 Outline이 세팅이나 사용이 제일 간편한것 같아서 저도 평소에 애용하고 있습니다.

 

CentOS7과 8버전은 Outline 서버 자체를 설치함에 있어서는 같지만 초기 세팅과정이 조금 다르기에 두 가지 버전을 나눠서 설명 드리도록 하겠습니다.

 

먼저 CentOS 7버전에 대한 초기 세팅방법을 알아보겠습니다.

 

Outline 서버를 설치하기 위한 CentOS 7 환경구축

먼저 시스템을 최신상태로 업그레이드 합니다.

yum update -y

업그레이드가 끝났다면 다음 프로그램들을 설치해 줍니다.

yum install -y yum-utils device-mapper-persistent-data lvm2 wget dnf

containerd.id 를 설치합니다.

sudo dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.6.9-3.1.el7.x86_64.rpm

 

 

Outline 서버를 설치하기 위한 CentOS 8 환경구축

역시 시스템을 최신상태로 업그레이드 합니다.

sudo dnf update

epel-release 저장소를 추가합니다.

sudo dnf install epel-release

remi 저장소를 추가합니다.

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

필요한 프로그램들을 설치해줍니다.

sudo dnf install yum-utils device-mapper-persistent-data lvm2 wget

containerd.id 를 설치합니다.

sudo dnf install
https://download.docker.com/linux/centos/8/x86_64/stable/Packages/containerd.io-1.6.9-3.1.el8.x86_64.rpm

 

아래부분부터 CentOS 7과 8에서의 작업이 동일합니다.

 

docker의 repository를 추가해줍니다.

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

docker 엔진 설치 (위에서 containerd.io를 설치하셨다면 다시 설치하실 필요는 없습니다.)

sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin

마지막으로 도커를 시작하고 자동실행 항목에 추가합니다.

sudo systemctl start docker
sudo systemctl enable docker

그다음 Outline 서버 설치 명령어를 실행하면 됩니다.

sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"

 

설치과정 중 아래와 같은 Shadowbox 실행에러가 발생 할 수 있습니다.

> Starting Shadowbox .......................... FAILED

Sorry! Something went wrong. If you can't figure this out, please copy and paste  all this output into the Outline Manager screen, and send it to us, to see if we can help you.
Full log: /tmp/outline_logQ5G
docker: Error response from daemon: Conflict. The container name "/shadowbox" is already in use by container "3bd63003a1ac1150542a000d82f07e01924bf23c144faa5c4eec02d34fe62ce7". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

컨테이너가 점유중에 발생하는 에러이니 이때에는 아래와 같은 명령어를 컨테이너를 비워 줄 수 있습니다.

docker rm -f $(docker ps -a -q)

위 명령어를 실행한 다음 다시 Outline 서버 설치명령어를 실행하시면 문제없이 완료 되는것을 확인하실 수 있습니다.

 

그럼 이만.

반응형
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유