사쿠라 VPS에 Gitlab Omnibus를 설치해 보았습니다.

사쿠라 VPS에 Gitlab Omnibus를 설치해 보았습니다.

2022-10-05 last update

6 minutes reading 사쿠라 VPS GitLab
소스 제어, 백업용으로 자신 전용의 git 서버 구축을 해 보았습니다.
기술 메모로서 기재하겠습니다 때문에, 참고가 되면 라고 생각합니다.

패키지 설치

Gitlab의 공식 사이트를 참조하여 패키지 설치
htps // 아보 t. 기 t b. 코 m / 도 w 응 아 ds /

Gitlab Omnibus는 gitlab 서버 구축에 필요한 미들웨어를 제공합니다.
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

이어서 설치합니다.
sudo yum install gitlab-ce

git 서버 URL 설정
gitlab 설정은/etc/gitlab/gitlab.rb에 설명되어 있습니다.
GitLab WebGUI 또는 Git 저장소에 액세스할 때 사용할 URL을 지정합니다.
$ sudo vim /etc/gitlab/gitlab.rb
external_url "http://gitlab.example.com"

설정
gitlab-ctl reconfigure

설정하면 GitLab용 디렉토리(/opt/gitlab/sv/)에 아래의 미들웨어가 설치됩니다.

logrotate
nginx
postgresql
redis
sidekiq
유니콘

패키지의 Gitlab Omnibus는 기본적으로 nginx에서 실행됩니다.
웹 서버는 일반적으로 80번 포트가 사용되므로 이미 웹 서버가 실행되고 있는 시스템(apache 등)에 GitLab을 설치하고 싶을 때는 충돌하지 않도록 조정해야 합니다.

자신은 이미 apache를 설치하고 홈페이지를 공개하고 있었기 때문에 충돌했습니다. . .

충돌했을 경우는 포트를 지정해 합니다.
$ sudo vim /etc/gitlab/gitlab.rb
external_url "http://gitlab.example.com:88"

다시 설정해 주면 변경 내용이 반영됩니다.
웹 서버의 VirtualHost 설정

gitlab이 로컬에서 시작되기 때문에
apache에서 리버스 프로 시키를 설정합니다.
$ sudo vim /etc/httpd/conf.d/gitlab.example.com.conf

<VirtualHost *:80>
   ServerName gitlab.example.com
   DocumentRoot "/opt/gitlab/embedded/service/gitlab-rails/public"
   ProxyPass / http://localhost:88/
   ProxyPassReverse / http://localhost:88/
   ErrorLog /var/log/httpd/gitlab.example.com_error_log
   CustomLog /var/log/httpd/gitlab.example.com_access_log combined
   AddDefaultCharset UTF-8
   <Directory "/opt/gitlab/embedded/service/gitlab-rails/public">
       Allow from all
   </Directory>
</VirtualHost>

아파치 재부팅

이런 화면이 나오면 우선 설치가 완료됩니다.



■참고 사이트
htp // 비오키 ds. rg/? % 오 4 % C9 % 오 4 % D6 % 오 4 % 아 % 2F % B3 % 오 B % C8 % 오 F % 오 4 % B7 % 오 4 % 오 8 % 오 4 % 아 6 % 아 1 % 아 % 2F기 tぁb%207.3.2%아4%세%아5%아4%아5%
ht tp // // 에~네 t. jp/아리치ぇ/6F/우ㄴm_R1H/-ZBF5B㎝C2/
h tp : // 우울했다. 코 m / 아 r ゔ ぇ s / 3074