사전작업

 

1. 방화벽 해제

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld

 

GItlab 설치

1. GitLab package repository 추가

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

 

2. package 설치

sudo EXTERNAL_URL="사용할 도메인 주소:port" yum install -y gitlab-ce

 

ex) test.gitlab.co.kr 의 도메인에 18081 포트를 사용

$ sudo EXTERNAL_URL="test.gitlab.co.kr:18080" yum install -y gitlab-ce

 

==> 설치 후 추후 gitlab.rb에서 external_url 으로 변경 가능

 

3. 실행 및 로그인

정상적으로 설치가 완료되었다면 설치 시 입력한 EXTERNAL_URL의 정보를 브라우저에 입력하면

아래와 같은 페이지가 로드 될 것이다.

혹시나 아래와 같이 502 Whoops, GitLab is taking too much time to respond. 에러가 뜬다면 여유를 가지고 1~2분 정도 기다리면 접속이 된다.

아직 서비스가 정상적으로 모두 올라가지 않아서 그런 것이다.

 

 

설치가 완료되고 나면 터미널에 아래와 같은 문구가 출력되어 있을 것이다.

 

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

 

초기 비밀번호는 /etc/gitlab/initial_root_password에 저장되어 있으며 이 파일은 처음 설정을 적용한 후 24시간 뒤에 사라진다는 내용이다. 해당 파일은 내용은 아래 처럼 적혀있다.

 

# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: uOZjs2M979UjfpZYyh1CRozf9AHZYbF4oVE0Tf4dU= (초기 root 패스워드)

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

 

근데 필자의 경우 이 초기 root 패스워드로 로그인을 시도해봐도 안되서 수동으로 root 패스워드를 재설정하였다.

 

https://hsunnystory.tistory.com/217

 

[Gitlab] 사용자 비밀번호 변경(root 계정 포함)

UI, Rake task, Rails console, Users API를 이용하여 사용자 패스워드를 변경할 수 있다. 이 글에서는 Rails console를 이용한 방법에 대해 포스팅 한다. 1. Rails console 열기 sudo gitlab-rails console 2. 변경할 사용자

hsunnystory.tistory.com

 

 

로그인 후 아래와 같이 나온다면 설치는 정상적으로 완료

 

https://hsunnystory.tistory.com/218

 

[Gitlab] SSL 인증서 적용(HTTPS 수동 설정)

Gitlab에 ssl을 적용하는 방법은 크게 2가지가 있다. 1. Let’s Encrypt 사용 2. SSL 인증서 수동 적용 이 글에서는 2. SSL 인증서 수동 적용에 관련하여 포스팅 한다. /etc/gitlab/gitlab.rb 파일에서 아래의 설정

hsunnystory.tistory.com

https://hsunnystory.tistory.com/216

 

[Gitlab] ERROR 422 The change you requested was rejected. 해결

Gitlab 구축 또는 설정 값을 변경 한 후 다음과 같은 에러 페이지가 나오는 경우가 있다. HTTP 상태 코드 422 는 422 Unprocessable Entity 이 응답은 서버가 요청을 이해하고 요청 문법도 올바르지만 요청된

hsunnystory.tistory.com

https://hsunnystory.tistory.com/219

 

[Gitlab] Repository 변경(운영 중 포함)

1. gitlab 서비스 중지 gitlab-ctl stop 2. gitlab.rb 수정 위와 같이 git_data_dirs 설정 부분에 path 설정 git_data_dirs({ "default" => { "path" => "데이터를 저장할 경로" } }) 3. 수정 사항 반영 gitlab-ctl reconfigure 4. gitlab

hsunnystory.tistory.com

https://hsunnystory.tistory.com/220

 

[Gitlab] gitlab-ctl reconfigure 시 selinux 에러

gitlab.rb 파일 등 gitlab 관련 설정을 변경하고 gitlab-ctl reconfigure을 시도 하는데 아래와 같은 에러 메세지가 출력 되는 경우가 있다. Running handlers: There was an error running gitlab-ctl reconfigure: execute[semodule

hsunnystory.tistory.com

 

 

참고 : Centos7 Gitlab Community Edition 설치 가이드 https://about.gitlab.com/install/#centos-7

+ Recent posts