My linux world » GitLab

GitLab


Prerequiste

I assume that you have a Centos installation.

Installation

You can copy/paste this script and use it to configure automatically your server.

  1. #!/bin/bash
  2.  
  3. ##################################################
  4. # PARAMETERS
  5. ##################################################
  6.  
  7. listen_port=6745
  8.  
  9. ##################################################
  10. # INSTALLATION SCRIPT
  11. ##################################################
  12. echo "install gitlab"
  13. curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  14. dnf -y install gitlab-ce
  15. gitlab-ctl reconfigure
  16.  
  17. echo "configure external url for gitlab"
  18. sed -i "s/^\(external_url\s*\).*/\1'http:\/\/localhost:$listen_port\/gitlab'/" /etc/gitlab/gitlab.rb
  19. gitlab-ctl reconfigure
  20. gitlab-ctl restart
  21.  
  22. echo "configure httpd (create /etc/httpd/conf.d/gitlab.conf)"
  23. cat > /etc/httpd/conf.d/gitlab.conf << EOF
  24. ProxyPreserveHost On
  25. Proxypass /gitlab http://localhost:$listen_port/gitlab
  26. Proxypassreverse /gitlab http://localhost:$listen_port/gitlab
  27. ProxyRequests Off
  28. EOF
  29.  
  30. echo "restart httpd"
  31. systemctl restart httpd.service
  32.  
  33.  
  34. myip=`hostname -I`
  35. echo "Now meet you here: http://$myip/gitlab"
  36.  

That’s all 🙂


Copyright © 2023 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.

Fork me on GitHub