본문 바로가기

PrivateCloud/소스형상관리, 이슈 트레킹

Gitlab CE 설치

# Private Cloud를 위한 Gitlab CE를 설치한다.

1. Cloud9을 활용한 서버 구축 및 접속

2021.10.03 - [⭐ AWS/Cloud9] - Cloud9 생성 및 터미널 접속

 

Cloud9 생성 및 터미널 접속

- cloud9을 검색하여 새로운 환경을 만든다. - 이름과 간단한 설명을 입력 후 다음으로 넘어간다. - 아래 구성과 유사하게 세팅한다. - 생성되고 있는 모습. - 생성이 완료되고 터미널이 활성화된 모

may9noy.tistory.com

2. Gitlab 사이트 참고하여 설치 진행 (우분투 기준)

https://about.gitlab.com/install/#ubuntu

 

Download and install GitLab

Download, install and maintain your own GitLab instance with various installation packages and downloads for Linux, Kubernetes, Docker, Google Cloud and more.

about.gitlab.com

- Install and configure the necessary dependencies

sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl

- install Postfix (or Sendmail) to send notification emails. (필요없는경우 생략)

sudo apt-get install -y postfix

- Add the GitLab package repository and install the package (아래의 gitlab-ee → ce 로 변경)

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

- external_url 설정

# Default
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ce
# public_ip 세팅
sudo EXTERNAL_URL="http://{public_ip}:{port_number}" apt-get install gitlab-ce
# ex)
sudo EXTERNAL_URL="http://192.168.100.20:8888" apt-get install gitlab-ce

3. /etc/gitlab/gitlab.rb 파일 수정

- gitlab 14버전 이전에는 unicorn이라는 항목으로 서비스를 세팅 하였는데, 14버전 이후부터는 puma['port']를 통해 port 세팅을 진행 해야한다. 아래의 port 번호는 위에서 세팅한 EXTERNAL_URL의 port번호와 다르게 세팅해주면 된다.

- 실행 명령 (설정 변경 후 아래의 명령어 입력)

# 설정내역 변경 후 적용
sudo gitlab-ctl reconfigure

# 재 시작
sudo gitlab-ctl start

4. Gitlab 사이트 접속하기

external_url 'http://{ip_address}:8000'

- gitlab.rb에서 설정한 ip:port_number로 web에서 접속

5. 사이트 접속하기

- 비밀번호 확인하기 (gitlab 초기 비밀번호 확인)

/etc/gitlab $ sudo cat /etc/gitlab/initial_root_password  | grep Pass
#          2. Password hasn't been changed manually, either via UI or via command line.
Password: sadsadwasdwasdasdwasdwasdasdawasdwasdwasdwad

- web 서비스 접속하기

http://{ip_address}:8000

- 최초 id는 root 이고 비밀번호는 위에서 gitlab 초기 비밀번호 확인 에서 확인한 비밀번호를 입력한다.

- 정상적으로 로그인 됨

 

- 끝 -