From d1e31bfce96e4d385c1441c43f7d5ec3552731fe Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 17:38:54 +0100 Subject: [PATCH 1/9] Remove generic database.yml.example --- config/database.yml.example | 39 ------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 config/database.yml.example diff --git a/config/database.yml.example b/config/database.yml.example deleted file mode 100644 index c5a2b8d6..00000000 --- a/config/database.yml.example +++ /dev/null @@ -1,39 +0,0 @@ -# -# PRODUCTION -# -production: - adapter: mysql2 - encoding: utf8 - reconnect: false - database: gitlabhq_production - pool: 5 - username: root - password: "secure password" - # host: localhost - # socket: /tmp/mysql.sock - -# -# Development specific -# -development: - adapter: mysql2 - encoding: utf8 - reconnect: false - database: gitlabhq_development - pool: 5 - username: root - password: "secure password" - # socket: /tmp/mysql.sock - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: &test - adapter: mysql2 - encoding: utf8 - reconnect: false - database: gitlabhq_test - pool: 5 - username: root - password: "secure password" - # socket: /tmp/mysql.sock From 95ffe08674787b21172e38f9e1a4b47309c56418 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 17:53:24 +0100 Subject: [PATCH 2/9] Update database setup instructions to be more consistent --- doc/install/databases.md | 50 +++++++++++++++++++++---------------- doc/install/installation.md | 24 ++---------------- 2 files changed, 31 insertions(+), 43 deletions(-) diff --git a/doc/install/databases.md b/doc/install/databases.md index 1a6f739e..1e714d79 100644 --- a/doc/install/databases.md +++ b/doc/install/databases.md @@ -1,47 +1,63 @@ -# Databases: +# Setup Database -GitLab use MySQL as default database but you are free to use PostgreSQL. +GitLab supports the following databases: + +* MySQL (preferred) +* PostgreSQL ## MySQL + # Install the database packages sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev + # Install only the necessary gems + sudo -u gitlab -H bundle install --deployment --without development test postgres + # Login to MySQL $ mysql -u root -p + # Create a user for GitLab. (change $password to a real password) + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; + # Create the GitLab production database mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; - # Create the MySQL User change $password to a real password - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; - - # Grant proper permissions to the MySQL User + # Grant the GitLab user necessary permissopns on the table. mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; + # Quit the database session + mysql> \q + + # Try connecting to the new database with the new user + sudo -u gitlab -H mysql -u gitlab -p -D gitlabhq_production ## PostgreSQL + # Install the database packages sudo apt-get install -y postgresql-9.1 postgresql-server-dev-9.1 - # Connect to database server + # Install only the necessary gems + sudo -u gitlab -H bundle install --deployment --without development test mysql + + # Login to PostgreSQL sudo -u postgres psql -d template1 - # Add a user called gitlab. Change $password to a real password + # Create a user for GitLab. (change $password to a real password) template1=# CREATE USER gitlab WITH PASSWORD '$password'; # Create the GitLab production database & grant all privileges on database template1=# CREATE DATABASE gitlabhq_production OWNER gitlab; - # Quit from PostgreSQL server + # Quit the database session template1=# \q - # Try connect to new database - sudo -u gitlab psql -d gitlabhq_production + # Try connecting to the new database with the new user + sudo -u gitlab -H psql -d gitlabhq_production -#### Select the database you want to use +# Configure GitLab # Mysql sudo -u gitlab cp config/database.yml.mysql config/database.yml @@ -49,12 +65,4 @@ GitLab use MySQL as default database but you are free to use PostgreSQL. # PostgreSQL sudo -u gitlab cp config/database.yml.postgresql config/database.yml - # make sure to update username/password in config/database.yml - -#### Install gems - - # mysql - sudo -u gitlab -H bundle install --without development test postgres --deployment - - # or postgres - sudo -u gitlab -H bundle install --without development test mysql --deployment +Make sure to update username/password in config/database.yml. diff --git a/doc/install/installation.md b/doc/install/installation.md index 6876a875..2702aa89 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -122,21 +122,9 @@ Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wik and ensure you have followed all of the above steps carefully. -# 5. Mysql database +# 5. Database - sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev - - # Login to MySQL - $ mysql -u root -p - - # Create the GitLab production database - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; - - # Create the MySQL User change $password to a real password - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; - - # Grant proper permissions to the MySQL User - mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; +See doc/install/databases.md # 6. GitLab @@ -162,12 +150,6 @@ and ensure you have followed all of the above steps carefully. # sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml - # Copy mysql db config - # - # make sure to update username/password in config/database.yml - # - sudo -u gitlab cp config/database.yml.mysql config/database.yml - # Copy unicorn config # sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb @@ -269,8 +251,6 @@ You can login via web using admin generated with setup: # Advanced setup tips: -_Checkout databases.md for PostgreSQL_ - ## Customizing Resque's Redis connection If you'd like Resque to connect to a Redis server on a non-standard port or on From 78d3611eba515beb85b86c1fc238cbbdbb1bc02f Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 18:18:09 +0100 Subject: [PATCH 3/9] Remove redundant packages and move database specific ones to the db setup * build-essential requires make, gcc * remove libmysql++-dev: the mysql2 gem only requires libmysqlclient-dev * remove postgresql-server-dev-9.1: the pg gem only requires libpq-dev * replace python-dev, python-pip with python2.7: the pygments.rb gem only requires python2.7 --- doc/install/databases.md | 2 +- doc/install/installation.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/install/databases.md b/doc/install/databases.md index 1e714d79..92011647 100644 --- a/doc/install/databases.md +++ b/doc/install/databases.md @@ -35,7 +35,7 @@ GitLab supports the following databases: ## PostgreSQL # Install the database packages - sudo apt-get install -y postgresql-9.1 postgresql-server-dev-9.1 + sudo apt-get install -y postgresql-9.1 libpq-dev # Install only the necessary gems sudo -u gitlab -H bundle install --deployment --without development test mysql diff --git a/doc/install/installation.md b/doc/install/installation.md index 2702aa89..0c4cbf3c 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -44,7 +44,7 @@ Now install the required packages: sudo apt-get update sudo apt-get upgrade - sudo apt-get install -y wget curl gcc checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server git-core python-dev python-pip libyaml-dev postfix libpq-dev + sudo apt-get install -y wget curl build-essential checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev zlib1g-dev libicu-dev redis-server openssh-server git-core python2.7 libyaml-dev postfix sudo pip install pygments From 7591718ef206fcf3f0c4380b2d8928e1258d37a0 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 18:21:28 +0100 Subject: [PATCH 4/9] Consistently use sudo -u foo -H --- doc/install/installation.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 0c4cbf3c..09a47a19 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -83,21 +83,21 @@ Add your users to groups: Generate key: - sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa + sudo -u gitlab -H ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa # 4. Gitolite Clone GitLab's fork of the Gitolite source code: - sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite + sudo -u git -H git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite Setup: cd /home/git sudo -u git -H mkdir bin - sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' - sudo -u git sh -c 'gitolite/install -ln /home/git/bin' + sudo -u git -H sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' + sudo -u git -H sh -c 'gitolite/install -ln /home/git/bin' sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub sudo chmod 0444 /home/git/gitlab.pub @@ -107,7 +107,7 @@ Setup: Permissions: - sudo chmod -R g+rwX /home/git/repositories/ + sudo chmod -R ug+rwXs /home/git/repositories/ sudo chown -R git:git /home/git/repositories/ # clone admin repo to add localhost to known_hosts @@ -135,11 +135,11 @@ See doc/install/databases.md #### Get source code # Get gitlab code. Use this for stable setup - sudo -H -u gitlab git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab + sudo -u gitlab -H git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab # Skip this for stable setup. # Master branch (recent changes, less stable) - sudo -H -u gitlab git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab + sudo -u gitlab -H git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab #### Copy configs @@ -148,11 +148,11 @@ See doc/install/databases.md # Rename config files # - sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml + sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml # Copy unicorn config # - sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb + sudo -u gitlab -H cp config/unicorn.rb.example config/unicorn.rb #### Install gems @@ -172,7 +172,7 @@ Git requires a username and email in order to be able to do that. #### Setup application - sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production + sudo -u gitlab -H bundle exec rake gitlab:app:setup RAILS_ENV=production #### Setup GitLab hooks @@ -184,7 +184,7 @@ Git requires a username and email in order to be able to do that. Checking status: - sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production + sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production # OUTPUT EXAMPLE From 198e93ccf2b880d9dba52240dc8759b930b4ebf3 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 19:31:08 +0100 Subject: [PATCH 5/9] Update hardware and platform requirements guide --- doc/install/installation.md | 5 ++-- doc/install/requirements.md | 52 ++++++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 09a47a19..f531baf9 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -1,6 +1,7 @@ -_This installation guide created for Debian/Ubuntu and properly tested._ +This installation guide was created for Debian/Ubuntu and tested on it. + +Please read doc/install/requirements.md for hardware andplatform requirements. -_Checkout requirements before setup_ ### IMPORTANT diff --git a/doc/install/requirements.md b/doc/install/requirements.md index 75b02d64..ec5b013c 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -1,28 +1,56 @@ -## Platform requirements: +# Hardware -**The project is designed for the Linux operating system.** +We recommend you to run GitLab on a server with at least 1GB RAM. -It may work on FreeBSD and Mac OS, but we don't test our application for these systems and can't guarantee stability and full functionality. +The necessary hard disk space largely depends on the size of the repos you want +to use GitLab with. But as a *rule of thumb* you should have at least as much +free space as your all repos combined take up. -We officially support (recent versions of) these Linux distributions: + + +# Operating Systems + +## Linux + +GitLab is developed for the Linux operating system. + +GitLab officially supports (recent versions of) these Linux distributions: - Ubuntu Linux - Debian/GNU Linux -It should work on: +It should also work on (though they are not officially supported): +- Arch +- CentOS - Fedora -- CentOs +- Gentoo - RedHat -You might have some luck using these, but no guarantees: +## Other Unix Systems -- FreeBSD will likely work, see https://github.com/gitlabhq/gitlabhq/issues/796 -- MacOS X will likely work, see https://groups.google.com/forum/#!topic/gitlabhq/5IXHbPkjKLA +There is nothing that prevents GitLab from running on other Unix operating +systems. This means you may get it to work on systems running FreeBSD or OS X. +**If you want to try, please proceed with caution!** -GitLab does **not** run on Windows and we have no plans of making GitLab compatible. +## Windows + +GitLab does **not** run on Windows and we have no plans of supporting it in the +near future. -## Hardware: -We recommend to use server with at least 1GB RAM for gitlab instance. +# Rubies + +GitLab requires Ruby (MRI) 1.9.3 and several Gems with native components. +While it is generally possible to use other Rubies (like +[JRuby](http://jruby.org/) or [Rubinius](http://rubini.us/)) it might require +some work on your part. + + + +# Installation troubles and reporting success or failure + +If you have troubles installing GitLab following the official installation guide +or want to share your experience installing GitLab on a not officially supported +platform, please follow the the contribution guide (see CONTRIBUTING.md). From 4af26f66f87fb77487c9955e58826344af6d3f66 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 20:34:11 +0100 Subject: [PATCH 6/9] Update installation guide --- doc/install/installation.md | 230 +++++++++++++++++++----------------- 1 file changed, 121 insertions(+), 109 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index f531baf9..ac6615a9 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -3,87 +3,75 @@ This installation guide was created for Debian/Ubuntu and tested on it. Please read doc/install/requirements.md for hardware andplatform requirements. - -### IMPORTANT - -Please make sure you have followed all the steps below before posting to the mailing list with installation and configuration questions. - -Only create a GitHub Issue if you want a specific part of this installation guide updated. - -Also read the [Read this before you submit an issue](https://github.com/gitlabhq/gitlabhq/wiki/Read-this-before-you-submit-an-issue) wiki page. +**Important Note** +The following steps have been known to work. +If you deviate from this guide, do it with caution and make sure you don't +violate any assumptions GitLab makes about its environment. +If you find a bug/error in this guide please an issue or pull request following +the contribution guide (see CONTRIBUTING.md). - - - -# Basic setup +# Overview -The basic installation will provide you a GitLab setup with options: +The GitLab installation consists of setting up th following components: -1. ruby 1.9.3 -2. mysql as main db -3. gitolite v3 fork by gitlab -4. nginx + unicorn - -The installation consists of next steps: - -1. Packages / dependencies +1. Packages / Dependencies 2. Ruby -3. Users +3. System Users 4. Gitolite -5. Mysql -6. GitLab. -7. Nginx +5. Database +6. GitLab +7. Nginx -# 1. Packages / dependencies +# 1. Packages / Dependencies *Keep in mind that `sudo` is not installed on Debian by default. You should install it as root:* apt-get update && apt-get upgrade && apt-get install sudo -Now install the required packages: +Make sure your system is up-to-date: sudo apt-get update sudo apt-get upgrade +Install the required packages: + sudo apt-get install -y wget curl build-essential checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev zlib1g-dev libicu-dev redis-server openssh-server git-core python2.7 libyaml-dev postfix - sudo pip install pygments +# 2. Ruby -# 2. Install Ruby - - wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz - tar xfvz ruby-1.9.3-p194.tar.gz - cd ruby-1.9.3-p194 + wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz + tar xfvz ruby-1.9.3-p327.tar.gz + cd ruby-1.9.3-p327 ./configure make sudo make install -# 3. Users -Create user for git: +# 3. System Users + +Create a user for Git and Gitolite: sudo adduser \ --system \ --shell /bin/sh \ - --gecos 'git version control' \ + --gecos 'Git Version Control' \ --group \ --disabled-password \ --home /home/git \ git -Create user for GitLab: +Create a user for GitLab: - # ubuntu/debian - sudo adduser --disabled-login --gecos 'gitlab system' gitlab + sudo adduser --disabled-login --gecos 'GitLab' gitlab -Add your users to groups: - - sudo usermod -a -G git gitlab - sudo usermod -a -G gitlab git - -Generate key: + # Add it to the git group + sudo addmod -a -G git gitlab + # Generate the SSH key sudo -u gitlab -H ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa @@ -93,34 +81,43 @@ Clone GitLab's fork of the Gitolite source code: sudo -u git -H git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite -Setup: +Setup Gitolite with GitLab as its admin: +**Important Note** +GitLab assumes *full and unshared* control over this Gitolite installation. + + # Add Gitolite scripts to $PATH cd /home/git sudo -u git -H mkdir bin sudo -u git -H sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile' sudo -u git -H sh -c 'gitolite/install -ln /home/git/bin' + # Copy the gitlab user's (public) SSH key ... sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub sudo chmod 0444 /home/git/gitlab.pub + # ... and use it as the Gitolite admin key for setup sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub" - -Permissions: +Fix the directory permissions for the repository: + # Make sure the repositories dir is owned by git and it stays that way sudo chmod -R ug+rwXs /home/git/repositories/ sudo chown -R git:git /home/git/repositories/ - # clone admin repo to add localhost to known_hosts - # & be sure your user has access to gitolite +## Test if everything works so far + + # Clone the admin repo so SSH adds localhost to known_hosts ... + # ... and to be sure your users have access to Gitolite sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin - # if succeed you can remove it + # If it succeeded without errors you can remove the cloned repo sudo rm -rf /tmp/gitolite-admin -**IMPORTANT! If you can't clone `gitolite-admin` repository - DO NOT PROCEED WITH INSTALLATION** +**Impornant Note** +If you can't clone the `gitolite-admin` repository: **DO NOT PROCEED WITH INSTALLATION** Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide) -and ensure you have followed all of the above steps carefully. +and make sure you have followed all of the above steps carefully. # 5. Database @@ -130,135 +127,150 @@ See doc/install/databases.md # 6. GitLab + We'll install GitLab into the gitlab user's home directory cd /home/gitlab +## Clone the Source -#### Get source code - - # Get gitlab code. Use this for stable setup + # Clone the latest stable release sudo -u gitlab -H git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab - # Skip this for stable setup. - # Master branch (recent changes, less stable) - sudo -u gitlab -H git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab +**Note*** +You can change `stable` to `master` if you want the *bleeding edge* version, but +do so with caution! +## Configure it -#### Copy configs - - cd gitlab + cd /home/gitlab/gitlab - # Rename config files - # + # Copy the example GitLab config sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml - # Copy unicorn config - # + # Copy the example Unicorn config sudo -u gitlab -H cp config/unicorn.rb.example config/unicorn.rb -#### Install gems +Make sure to edit both files to match your setup. + +## Install Gems cd /home/gitlab/gitlab sudo gem install charlock_holmes --version '0.6.9' sudo gem install bundler - sudo -u gitlab -H bundle install --without development test postgres --deployment + sudo -u gitlab -H bundle install --deployment --without development test -#### Configure git client +## Configure Git -Gitlab needs to be able to commit and push changes to gitolite. -Git requires a username and email in order to be able to do that. +GitLab needs to be able to commit and push changes to Gitolite. In order to do +that Git requires a username and email. (Please use the `email.from` address +for the email) + sudo -u gitlab -H git config --global user.name "GitLab" sudo -u gitlab -H git config --global user.email "gitlab@localhost" - sudo -u gitlab -H git config --global user.name "Gitlab" -#### Setup application - - sudo -u gitlab -H bundle exec rake gitlab:app:setup RAILS_ENV=production - - -#### Setup GitLab hooks +## Setup GitLab hooks sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive sudo chown git:git /home/git/.gitolite/hooks/common/post-receive -#### Check application status +## Initialise Database and Activate Advanced Features -Checking status: + sudo -u gitlab -H bundle exec rake gitlab:app:setup RAILS_ENV=production + + +## Check Application Status + +Just to check we didn't miss anything. sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production +``` +# OUTPUT EXAMPLE +Starting diagnostic +config/database.yml............exists +config/gitlab.yml............exists +/home/git/repositories/............exists +/home/git/repositories/ is writable?............YES +remote: Counting objects: 603, done. +remote: Compressing objects: 100% (466/466), done. +remote: Total 603 (delta 174), reused 0 (delta 0) +Receiving objects: 100% (603/603), 53.29 KiB, done. +Resolving deltas: 100% (174/174), done. +Can clone gitolite-admin?............YES +UMASK for .gitolite.rc is 0007? ............YES +/home/git/share/gitolite/hooks/common/post-receive exists? ............YES +``` - # OUTPUT EXAMPLE - Starting diagnostic - config/database.yml............exists - config/gitlab.yml............exists - /home/git/repositories/............exists - /home/git/repositories/ is writable?............YES - remote: Counting objects: 603, done. - remote: Compressing objects: 100% (466/466), done. - remote: Total 603 (delta 174), reused 0 (delta 0) - Receiving objects: 100% (603/603), 53.29 KiB, done. - Resolving deltas: 100% (174/174), done. - Can clone gitolite-admin?............YES - UMASK for .gitolite.rc is 0007? ............YES - /home/git/share/gitolite/hooks/common/post-receive exists? ............YES +If you are all green - congratulations! You run a GitLab now. +But there are still a few steps to go. -If you got all YES - congratulations! You can run a GitLab app. -#### init script +## Install Init Script -Create init script in /etc/init.d/gitlab: +Download the init script (will be /etc/init.d/gitlab): sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/ sudo chmod +x /etc/init.d/gitlab -GitLab autostart: +Make GitLab start on boot: sudo update-rc.d gitlab defaults 21 -#### Now you should start GitLab application: + +Start your GitLab instance: sudo service gitlab start # 7. Nginx - # Install first +## Installation sudo apt-get install nginx - # Add GitLab to nginx sites & change with your host specific settings +## Site Configuration + +Download an example site config: + sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/ sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab +Make sure to edit the config file to match your setup: + # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** # to the IP address and fully-qualified domain name - # of the host serving GitLab. + # of your host serving GitLab sudo vim /etc/nginx/sites-enabled/gitlab - # Restart nginx: +## Restart + sudo /etc/init.d/nginx restart -# Done! Visit YOUR_SERVER for gitlab instance +# Done! -You can login via web using admin generated with setup: +Visit YOUR_SERVER for your first GitLab login. +The setup has created an admin account for you. You can use it to log in: admin@local.host 5iveL!fe +**Important Note** +Please go over to your profile page and immediately chage the password, so +nobody can access your GitLab by using this login information later on. + +**Enjoy!** + - - - # Advanced setup tips: -## Customizing Resque's Redis connection +## Custom Redis connections If you'd like Resque to connect to a Redis server on a non-standard port or on -a different host, you can configure its connection string in the -**config/resque.yml** file: +a different host, you can configure its connection string via the +`config/resque.yml` file. - production: redis.example.com:6379 - -**Ok - we have a working application now. ** -**But keep going - there are some things that should be done ** + # example + production: redis.example.tld:6379 From 0c59de2e71c0cc69b89f206265892d4f5f3ee93d Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 7 Dec 2012 17:28:05 +0100 Subject: [PATCH 7/9] Make sure the user edits gitlab.yml --- doc/install/installation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/install/installation.md b/doc/install/installation.md index ac6615a9..ed041203 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -146,9 +146,14 @@ do so with caution! # Copy the example GitLab config sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml + # Make sure to change "localhost" to the fully-qualified domain name of your + # host serving GitLab where necessary + sudo -u gitlab -H vim config/gitlab.yml + # Copy the example Unicorn config sudo -u gitlab -H cp config/unicorn.rb.example config/unicorn.rb +**Important Note** Make sure to edit both files to match your setup. ## Install Gems From f127382be3113b204c4cd26c0d325150054bcff4 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 7 Dec 2012 17:28:47 +0100 Subject: [PATCH 8/9] Add checking installtion with gitlab:env:info task --- doc/install/installation.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index ed041203..795a053a 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -185,7 +185,11 @@ for the email) ## Check Application Status -Just to check we didn't miss anything. +Check if GitLab and its environment is configured correctly: + + sudo -u gitlab -H bundle exec rake gitlab:env:info RAILS_ENV=production + +To make sure you didn't miss anything run a more thorough check with: sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production From d8a239e4b1418b7681d8a1abad20264573c85f11 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 7 Dec 2012 17:32:38 +0100 Subject: [PATCH 9/9] Add instructions for dealing with the Python 2 vs 3 mess --- doc/install/installation.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 795a053a..697b82b4 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -38,7 +38,24 @@ Make sure your system is up-to-date: Install the required packages: - sudo apt-get install -y wget curl build-essential checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev zlib1g-dev libicu-dev redis-server openssh-server git-core python2.7 libyaml-dev postfix + sudo apt-get install -y wget curl build-essential checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev zlib1g-dev libicu-dev redis-server openssh-server git-core libyaml-dev postfix + +Make sure you have the right version of Python installed. + + # Install Python + sudo apt-get install python + + # Make sure that Python is 2.x (3.x is not supported at the moment) + python --version + + # If it's Python 3 you might need to install Python 2 separately + sudo apt-get install python2.7 + + # Make sure you can access Python via `python2` + python2 --version + + # If you get a "command not found" error create a link to the python binary + sudo ln -s /usr/bin/python /usr/bin/python2 # 2. Ruby