diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-17 11:30:42 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-17 11:30:42 +0100 |
commit | a0ccb0731b3598533051067ab24fb007b1d6e44f (patch) | |
tree | a380f2d36e66c70235badebd38ec8a0dfa782941 /doc/install | |
parent | 34a6f83d3e79670774e916e0b38016a74ae9dff1 (diff) | |
parent | 300e16065a4fca95ff04de96d31e34f57cf9a4a4 (diff) | |
download | gitlab-ce-a0ccb0731b3598533051067ab24fb007b1d6e44f.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor
Diffstat (limited to 'doc/install')
-rw-r--r-- | doc/install/installation.md | 45 | ||||
-rw-r--r-- | doc/install/redis.md | 60 | ||||
-rw-r--r-- | doc/install/relative_url.md | 126 | ||||
-rw-r--r-- | doc/install/requirements.md | 2 |
4 files changed, 211 insertions, 22 deletions
diff --git a/doc/install/installation.md b/doc/install/installation.md index 2cc2dbef41b..7ae73450afb 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -124,7 +124,7 @@ Download Ruby and compile it: mkdir /tmp/ruby && cd /tmp/ruby curl -O --progress https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.gz - echo 'e2e195a4a58133e3ad33b955c829bb536fa3c075 ruby-2.2.4.tar.gz' | shasum -c - && tar xzf ruby-2.2.4.tar.gz + echo 'b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761 ruby-2.2.4.tar.gz' | sha256sum -c - && tar xzf ruby-2.2.4.tar.gz cd ruby-2.2.4 ./configure --disable-install-rdoc make @@ -182,25 +182,20 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da ## 6. Redis -As of this writing, most Debian/Ubuntu distributions ship with Redis 2.2 or -2.4. GitLab requires at least Redis 2.8. +GitLab requires at least Redis 2.8. -Ubuntu users [can use a PPA](https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server) -to install a recent version of Redis. - -The following instructions cover building and installing Redis from scratch: +If you are using Debian 8 or Ubuntu 14.04 and up, then you can simply install +Redis 2.8 with: ```sh -# Build Redis -wget http://download.redis.io/releases/redis-2.8.23.tar.gz -tar xzf redis-2.8.23.tar.gz -cd redis-2.8.23 -make +sudo apt-get install redis-server +``` -# Install Redis -cd utils -sudo ./install_server.sh +If you are using Debian 7 or Ubuntu 12.04, follow the special documentation +on [an alternate Redis installation](redis.md). Once done, follow the rest of +the guide here. +``` # Configure redis to use sockets sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig @@ -224,7 +219,7 @@ if [ -d /etc/tmpfiles.d ]; then fi # Activate the changes to redis.conf -sudo service redis_6379 start +sudo service redis-server restart # Add git to the redis group sudo usermod -aG redis git @@ -238,9 +233,9 @@ sudo usermod -aG redis git ### Clone the Source # Clone GitLab repository - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 8-4-stable gitlab + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 8-5-stable gitlab -**Note:** You can change `8-4-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! +**Note:** You can change `8-5-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! ### Configure It @@ -267,6 +262,9 @@ sudo usermod -aG redis git sudo chmod -R u+rwX tmp/pids/ sudo chmod -R u+rwX tmp/sockets/ + # Create the public/uploads/ directory + sudo -u git -H mkdir public/uploads/ + # Make sure GitLab can write to the public/uploads/ directory sudo chmod -R u+rwX public/uploads @@ -355,7 +353,7 @@ GitLab Shell is an SSH access and repository management software developed speci cd /home/git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git cd gitlab-workhorse - sudo -u git -H git checkout 0.6.2 + sudo -u git -H git checkout 0.6.4 sudo -u git -H make ### Initialize Database and Activate Advanced Features @@ -370,9 +368,9 @@ GitLab Shell is an SSH access and repository management software developed speci # When done you see 'Administrator account created:' -**Note:** You can set the Administrator/root password by supplying it in environmental variable `GITLAB_ROOT_PASSWORD` as seen below. If you don't set the password (and it is set to the default one) please wait with exposing GitLab to the public internet until the installation is done and you've logged into the server the first time. During the first login you'll be forced to change the default password. +**Note:** You can set the Administrator/root password and e-mail by supplying them in environmental variables, `GITLAB_ROOT_PASSWORD` and `GITLAB_ROOT_EMAIL` respectively, as seen below. If you don't set the password (and it is set to the default one) please wait with exposing GitLab to the public internet until the installation is done and you've logged into the server the first time. During the first login you'll be forced to change the default password. - sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=yourpassword + sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=yourpassword GITLAB_ROOT_EMAIL=youremail ### Secure secrets.yml @@ -481,6 +479,11 @@ You can use `sudo service gitlab start` and `sudo service gitlab stop` to start ## Advanced Setup Tips +### Relative URL support + +See the [Relative URL documentation](relative_url.md) for more information on +how to configure GitLab with a relative URL. + ### Using HTTPS To use GitLab with HTTPS: diff --git a/doc/install/redis.md b/doc/install/redis.md new file mode 100644 index 00000000000..4075e6283d0 --- /dev/null +++ b/doc/install/redis.md @@ -0,0 +1,60 @@ +# Install Redis on old distributions + +GitLab requires at least Redis 2.8. The following guide is for Debian 7 and +Ubuntu 12.04. If you are using Debian 8 or Ubuntu 14.04 and up, follow the +[installation guide](installation.md). + +## Install Redis 2.8 in Debian 7 + +Redis 2.8 is included in the Debian Wheezy [backports] repository. + +1. Edit `/etc/apt/sources.list` and add the following line: + + ``` + deb http://http.debian.net/debian wheezy-backports main + ``` + +1. Update the repositories: + + ``` + sudo apt-get update + ``` + +1. Install `redis-server`: + + ``` + sudo apt-get -t wheezy-backports install redis-server + ``` + +1. Follow the rest of the [installation guide](installation.md). + +## Install Redis 2.8 in Ubuntu 12.04 + +We will [use a PPA](https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server) +to install a recent version of Redis. + +1. Install the PPA repository: + + ``` + sudo add-apt-repository ppa:chris-lea/redis-server + ``` + + Your system will now fetch the PPA's key. This enables your Ubuntu system to + verify that the packages in the PPA have not been interfered with since they + were built. + +1. Update the repositories: + + ``` + sudo apt-get update + ``` + +1. Install `redis-server`: + + ``` + sudo apt-get install redis-server + ``` + +1. Follow the rest of the [installation guide](installation.md). + +[backports]: http://backports.debian.org/Instructions/ "Debian backports website" diff --git a/doc/install/relative_url.md b/doc/install/relative_url.md new file mode 100644 index 00000000000..b341b6311c6 --- /dev/null +++ b/doc/install/relative_url.md @@ -0,0 +1,126 @@ +## Install GitLab under a relative URL + +_**Note:** +This document describes how to run GitLab under a relative URL for installations +from source. If you are using an Omnibus package, +[the steps are different][omnibus-rel]. Use this guide along with the +[installation guide](installation.md) if you are installing GitLab for the +first time._ + +--- + +While it is recommended to install GitLab on its own (sub)domain, sometimes +this is not possible due to a variety of reasons. In that case, GitLab can also +be installed under a relative URL, for example `https://example.com/gitlab`. + +There is no limit to how deeply nested the relative URL can be. For example you +could serve GitLab under `/foo/bar/gitlab/git` without any issues. + +Note that by changing the URL on an existing GitLab installation, all remote +URLs will change, so you'll have to manually edit them in any local repository +that points to your GitLab instance. + +--- + +The TL;DR list of configuration files that you need to change in order to +serve GitLab under a relative URL is: + +- `/home/git/gitlab/config/application.rb` +- `/home/git/gitlab/config/gitlab.yml` +- `/home/git/gitlab/config/unicorn.rb` +- `/home/git/gitlab-shell/config.yml` +- `/etc/default/gitlab` + +After all the changes you need to recompile the assets and [restart GitLab]. + +### Relative URL requirements + +If you configure GitLab with a relative URL, the assets (JavaScript, CSS, fonts, +images, etc.) will need to be recompiled, which is a task which consumes a lot +of CPU and memory resources. To avoid out-of-memory errors, you should have at +least 2GB of RAM available on your system, while we recommend 4GB RAM, and 4 or +8 CPU cores. + +See the [requirements](requirements.md) document for more information. + +### Enable relative URL in GitLab + +_**Note:** +Do not make any changes to your web server configuration file regarding +relative URL. The relative URL support is implemented by GitLab Workhorse._ + +--- + +Before following the steps below to enable relative URL in GitLab, some +assumptions are made: + +- GitLab is served under `/gitlab` +- The directory under which GitLab is installed is `/home/git/` + +Make sure to follow all steps below: + +1. (Optional) If you run short on resources, you can temporarily free up some + memory by shutting down the GitLab service with the following command: + + ```shell + sudo service gitlab stop + ``` + +1. Edit `/home/git/gitlab/config/application.rb` and uncomment/change the + following line: + + ```ruby + config.relative_url_root = "/gitlab" + ``` + +1. Edit `/home/git/gitlab/config/gitlab.yml` and uncomment/change the + following line: + + ```yaml + relative_url_root: /gitlab + ``` + +1. Edit `/home/git/gitlab/config/unicorn.rb` and uncomment/change the + following line: + + ```ruby + ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" + ``` + +1. Edit `/home/git/gitlab-shell/config.yml` and append the relative path to + the following line: + + ```yaml + gitlab_url: http://127.0.0.1/gitlab + ``` + +1. Make sure you have copied the supplied init script and the defaults file + as stated in the [installation guide](installation.md#install-init-script). + Then, edit `/etc/default/gitlab` and set in `gitlab_workhorse_options` the + `-authBackend` setting to read like: + + ```shell + -authBackend http://127.0.0.1:8080/gitlab + ``` + + **Note:** + If you are using a custom init script, make sure to edit the above + gitlab-workhorse setting as needed. + +1. After all the above changes recompile the assets. This is an important task + and will take some time to complete depending on the server resources: + + ``` + cd /home/git/gitlab + sudo -u git -H bundle exec rake assets:clean assets:precompile RAILS_ENV=production + ``` + +1. [Restart GitLab][] for the changes to take effect. + +### Disable relative URL in GitLab + +To disable the relative URL, follow the same steps as above and set up the +GitLab URL to one that doesn't contain a relative path. + +[omnibus-rel]: http://doc.gitlab.com/omnibus/settings/configuration.html#configuring-a-relative-url-for-gitlab "How to setup relative URL in Omnibus GitLab" +[restart gitlab]: ../administration/restart_gitlab.md#installations-from-source "How to restart GitLab" diff --git a/doc/install/requirements.md b/doc/install/requirements.md index 006dae8ca9a..c6a1c20d02f 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -66,7 +66,7 @@ If you have enough RAM memory and a recent CPU the speed of GitLab is mainly lim You need at least 2GB of addressable memory (RAM + swap) to install and use GitLab! With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage. -- 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly **advise against** this amount of memory. See the unicorn worker section below for more advise. +- 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly **advise against** this amount of memory. See the unicorn worker section below for more advice. - 1GB RAM + 1GB swap supports up to 100 users but it will be slow - **2GB RAM** is the **recommended** memory size and supports up to 100 users - 4GB RAM supports up to 1,000 users |