Install

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum install gitlab-ce
vi /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
vi /etc/httpd/conf.d/gitlab.conf
systemctl restart httpd.service
#
/opt/gitlab/bin/gitlab-ctl  stop
/opt/gitlab/bin/gitlab-ctl  start 

Configure

external_url 'http://git.example.com'
gitlab_rails['gitlab_ssh_host'] = 'git.example.com'
gitlab_rails['time_zone'] = 'Europe/Kiev'
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'root@git.example.com'
gitlab_rails['gitlab_email_display_name'] = 'My git'
gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'
nginx['enable'] = false
unicorn['listen'] = '0.0.0.0'
unicorn['port'] = 8080

Apache config

/etc/httpd/conf.d/gitlab.conf
 <VirtualHost *>
    ServerName git.example.com
    # Put this in the main section of your configuration (or desired virtual host, if using Apache virtual hosts)
    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
        # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time
        Require all granted
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
#    ProxyHTMLURLMap / /
    <Location />
        # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time
        Require all granted
    </Location>
</VirtualHost>
<VirtualHost *:443>
  ServerName git.example.com
  ServerAdmin admin@example.com
  SSLEngine on
  SSLCertificateFile      /etc/ssl/certs/example.crt
  SSLCertificateKeyFile /etc/ssl/private/example.pem
  SSLCertificateChainFile /etc/ssl/certs/example-bundle.crt
  SSLVerifyClient none
  SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!RC4-SHA:!ECDHE-RSA-RC4-SHA
  SSLHonorCipherOrder on
  SSLProtocol All -SSLv2 -SSLv3
    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
        # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time
        Require all granted
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
#    ProxyHTMLURLMap / /
    <Location />
        # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time
        Require all granted
    </Location>
</VirtualHost>
  • No labels