Gitlab uses Ngix instead of Apache. Both are web and use the same ports which conflict with the ports. If we want to use Gitlab with Apache we need to use proxy configurations. For SSL I am using Let's encrypt . I used the vim to edit the /etc/gitlab/gitlab.rb.
external_url "https://gitlab.tagpy.com"
gitlab_rails['trusted_proxies'] = ['127.0.0.1']
nginx['listen_addresses'] = ['127.0.0.1']
nginx['listen_port'] = 14500
nginx['real_ip_trusted_addresses'] = ['127.0.0.1']
nginx['real_ip_header'] = 'X-Forwarded-For'
nginx['real_ip_recursive'] = 'on'
# These are optional I think
letsencrypt['enable'] = true
nginx['custom_gitlab_server_config'] = "location /.well-known/acme-challenge/ {\n root /var/opt/gitlab/nginx/www/; \n}\n"
letsencrypt['auto_renew'] = true
letsencrypt['auto_renew_hour'] = "12"
letsencrypt['auto_renew_minute'] = "30"
letsencrypt['auto_renew_day_of_month'] = "*/7"
After editing I used the below command to implement my changes.
sudo gitlab-ctl reconfigure
I created the /etc/apache2/sites-available/gitlab-le-ssl.conf under sites available with following configurations
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName gitlab.tagpy.com
ServerSignature On
ProxyPreserveHost On
ProxyErrorOverride On
SSLProxyEngine on
ProxyRequests Off
ProxyPass / https://127.0.0.1:14500/
ProxyPassReverse / https://127.0.0.1:14500/
# ProxyPassReverse http://gitlab.tagpy.com/
SSLCertificateFile /etc/letsencrypt/live/gitlab.tagpy.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/gitlab.tagpy.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>