기본 GitLab 을 설치 할때에는 NGINX로 기본설치하여 웹서버를 구동하게 되어 있다.

회사에서 기존 Apache 서버가 설치된 곳에 GItlab을 설치하여 도메인 연동을 해야하는

상황이 발생하였다.. 끝없는 삽질이였다..

 

그래도 먹고살겠다고.. 정말.. X삽질 끝에 해결했다..

Gitlab 설정 (centos 6.9 기준)

경로 :/etc/gitlab/gitlab.rb

# 도메인 입력
external_url 'http://git.yourdomain.co.kr'

################################################################################
## GitLab Web server
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server
################################################################################
##! When bundled nginx is disabled we need to add the external webserver user to
##! the GitLab webserver group.

web_server['external_users'] = ['apache']
web_server['username'] = 'apache'
web_server['group'] = 'apache'

################################################################################
## GitLab NGINX
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html
################################################################################
nginx['enable'] = false



################################################################################
## GitLab Workhorse
##! Docs: https://gitlab.com/gitlab-org/gitlab-workhorse/blob/master/README.md
################################################################################

# repository 설정 추가 (Gitlab 8.X 버전 이상부터 주석처리로 되어 있음)
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"
# 설정파일 적용하기 (아래명령어 시작시 자동재시작되김함)
[root@localhost ~]# gitlab-ctl reconfigure

# 수동 재시작처리
[root@localhost ~]# gitlab-ctl restart

참고한 정보 : https://gitlab.com/gitlab-org/gitlab-recipes/issues/37

Apache 설정

Apache 사용자를 수정하여 gitlab-www 그룹에 추가 처리

[root@localhost ~]# usermod apache --append --groups gitlab-www
<VirtualHost *:80>
  ServerName git.yourdomain.co.kr
  ServerAlias git.yourdomain.co.kr
  ServerSignature Off

  ProxyPreserveHost On
  # Directory 경로를 안정해주면 css, js를 못불러옴
  <Directory /opt/gitlab/embedded/service/gitlab-rails/public >
    Order deny,allow
    allow from all
    Options FollowSymLinks
    Require all granted
  </Directory>

  <location />
    Order deny,allow
    allow from all
    Options FollowSymLinks
    Require all granted    

    ProxyPassReverse http://git.yourdomain.co.kr/
    # Web Gitlab 접근포트 설정
    ProxyPassReverse http://127.0.0.1:8080
    # 개발 및 툴로 repository 접근을 하려면 아래설정 필요
    ProxyPassReverse http://127.0.0.1:8181
  </location>
  RewriteEngine on
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]

  # needed for downloading attachments
  DocumentRoot "/opt/gitlab/embedded/service/gitlab-rails/public"
</VirtualHost>

참고한 정보 : https://superuser.com/questions/1071950/trying-to-install-gitlab-on-apache-on-centos-7

 

 

'개발경험 및 메모 > Git' 카테고리의 다른 글

git revert  (0) 2022.09.05
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기