This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
computing:gitlab-ce [2018/08/04 21:59] – oemb1905 | computing:gitlab-ce [2024/02/17 19:49] – oemb1905 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
------------------------------------------- | ------------------------------------------- | ||
* **gitlab-ce** | * **gitlab-ce** | ||
* **Jonathan Haack** | * **Jonathan Haack** | ||
* **Haack' | * **Haack' | ||
- | * **netcmnd@jonathanhaack.com** | + | * **webmaster@haacksnetworking.org** |
------------------------------------------- | ------------------------------------------- | ||
Line 12: | Line 11: | ||
------------------------------------------- | ------------------------------------------- | ||
- | The steps: | + | The pre-requisites: |
+ | |||
+ | * Using Debian or similar | ||
+ | * Self Hosted Web Server using Apache 2.4 | ||
+ | * Available Domain with DNS set up | ||
+ | * Self-Signed Certificate is established as backup | ||
+ | * Letsencrypt, | ||
+ | |||
+ | If you are missing some of these pre-requisites, | ||
+ | |||
+ | The first thing you need to do is download and run the script that gitlab provides. | ||
+ | |||
+ | cd /tmp | ||
+ | curl -LO https:// | ||
+ | sudo bash / | ||
+ | |||
+ | Now that that is done, let's begin by installing Gitlab Community Edition and editing the Ruby configuration file to work with the LAMP stack: | ||
sudo apt install gitlab-ce | sudo apt install gitlab-ce | ||
sudo nano / | sudo nano / | ||
| | ||
- | In this file, you need to edit 6 lines. | + | In this file, you need to edit 6 lines. |
- | external_url 'http://gitlab.example.fr' | + | external_url 'https://example.com |
gitlab_workhorse[' | gitlab_workhorse[' | ||
gitlab_workhorse[' | gitlab_workhorse[' | ||
Line 25: | Line 40: | ||
web_server[' | web_server[' | ||
nginx[' | nginx[' | ||
+ | # | ||
+ | | ||
+ | Optionally, if you want your ssh on an alternate port, then configure one more option in the gitlab.rb file. Of course, you will also need to adjust your sshd_config and you firewall (if applicable) to permit traffic on this port. | ||
+ | gitlab_rails[' | ||
+ | Ok, now that the configuration file is set up, let's make sure that your Apache Web Server has appropriate configuration files. | ||
+ | | ||
+ | * [[https:// | ||
+ | |||
+ | These both work in production, so feel free to use and share. | ||
+ | |||
+ | sudo a2enmod proxy_http | ||
+ | sudo a2enmod proxy | ||
+ | sudo a2enmod rewrite | ||
+ | | ||
+ | You should now be able to cofnigure gitlab-ce with its built in configuration tool:: | ||
+ | |||
+ | sudo gitlab-ctl reconfigure | ||
+ | |||
+ | After you complete these steps, restart both the Apache Web Server and the Gitlab services as follows: | ||
+ | |||
+ | sudo systemctl restart apache2.service | ||
+ | sudo systemctl restart gitlab-runsvdir.service | ||
+ | | ||
+ | I do not use the default Let's Encrypt tool in '' | ||
+ | |||
+ | ------------------------------------------- | ||
+ | |||
+ | Need to migrate your gitlab-ce instance to a new host? First, prepare the backups and configs on the old host and copy those the new host. | ||
+ | |||
+ | sudo gitlab-ctl stop unicorn | ||
+ | sudo gitlab-ctl stop sidekiq | ||
+ | sudo gitlab-rake gitlab: | ||
+ | mkdir gitlab-old-host | ||
+ | sudo cp / | ||
+ | sudo cp / | ||
+ | sudo cp -R / | ||
+ | sudo cp / | ||
+ | scp -r ~/ | ||
+ | | ||
+ | Now that you have copied those configs and files over the new host, it is time to restore the new host with those backups. | ||
+ | |||
+ | sudo cp gitlab-old-host/ | ||
+ | sudo cp -r gitlab-old-host/ | ||
+ | sudo gitlab-ctl reconfigure | ||
+ | sudo gitlab-ctl stop unicorn | ||
+ | sudo gitlab-ctl stop sidekiq | ||
+ | sudo cp gitlab-old/ | ||
+ | sudo chown git:git / | ||
+ | sudo gitlab-rake gitlab: | ||
+ | sudo gitlab-ctl start | ||
+ | sudo gitlab-rake gitlab: | ||
+ | | ||
+ | Navigate to your web browser, and all should be restored. | ||
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] | + | --- //[[webmaster@haacksnetworking.org|oemb1905]] |