# Apache 2 version If you are using Apache version 2.4 or above, please use files [gitlab-apache2.4.conf](gitlab-apache2.4.conf) or [gitlab-ssl-apache2.4.conf](gitlab-ssl-apache2.4.conf) for the HTTP and HTTPS versions of the vhost repectively. # RHEL6/CentOS6 recommendations The up-to-date recommended [gitlab-ssl.conf](gitlab-ssl.conf) was configured on RHEL 6.4. ## Puma or unicorn? ### unicorn By default, Unicorn (i.e. `unicorn.rb`) is configured to listen on port `8080` in the gitlabhq documentation. Therefore, [gitlab-ssl.conf](gitlab-ssl.conf) does that by default. ### puma Info taken from [PR #87](https://github.com/gitlabhq/gitlab-recipes/pull/87). As apache's mod_proxy [doesn't support][sock] sockets, the proxy URL must be configured to use tcp instead of unix sockets. `/home/git/gitlab/config/puma.rb` should exist and be configured. Two changes must then be made: 1. In `gitlab-ssl.conf` replace `http://127.0.0.1:8080 ` with `http://0.0.0.0:9292`. Also replace `ProxyPassreverse http://gitlab.example.com:9292` 2. Edit `puma.rb`: comment out `bind 'tcp://0.0.0.0:9292'` and comment `bind "unix://#{application_path}/tmp/sockets/gitlab.socket"` ## Assumptions It is assumed GitLab will be running in a secure production environment. This Apache `httpd` configuration is hardened for that purpose. By default this configuration only allows strong SSL and HTTP is redirected to HTTPS. If self signed certificates are preferred then see below in this document on managing SSL certificates. Also see additional security recommendations located at the bottom of this document for `httpd`. Managing GitLab with plain text HTTP only is not recommended however [gitlab.conf](gitlab.conf) has been provided for that purpose. ### Encryption assumptions Only security ciphers TLSv1.0+ and SSLv3+ are used in [gitlab-ssl.conf](gitlab-ssl.conf). Only strong ciphers 128-bit or higher. Ciphers with known weaknesses (i.e. MD5 hashed and RC4 based ciphers) have been purposefully excluded. ### Run GitLab insecure with HTTP only Utilize [gitlab.conf](gitlab.conf) rather than [gitlab-ssl.conf](gitlab-ssl.conf). Running a production GitLab instance over plain text HTTP is not recommended. ## Customize gitlab-ssl.conf There are a few places in [gitlab-ssl.conf](gitlab-ssl.conf) which need to be customized for the GitLab installation. 1. `ServerName` is defined in two VirtualHosts. `ServerName` should be set to host name of the GitLab installation. 2. `SSLCertificateFile`, `SSLCertificateKeyFile`, and `SSLCACertificateFile` should be customized for signed certificates. 3. `ProxyPassReverse http://gitlab.example.com:8080` should be customized for public host name of the GitLab installation. 4. At the bottom of `gitlab-ssl.conf` log file names contain `gitlab.example.com`. The log file names should reflect the GitLab installation host name. A quicker method is to use `sed` to modify the file. sed -i 's/gitlab.example.com/yourhost.com/g' gitlab-ssl.conf Even with the quicker method `SSLCertificateFile`, `SSLCertificateKeyFile`, and `SSLCACertificateFile` should still be modified. ## SELinux modifications In a RHEL6 production environment it is assumed [SELinux is enabled](http://stopdisablingselinux.com/). SELinux must be configured with the following: setsebool -P httpd_can_network_connect on setsebool -P httpd_can_network_relay on setsebool -P httpd_read_user_content on semanage -i - <