Commit f9def67981f34c843124b71823c6b1f41cf529e6

Authored by Dmitriy Zaporozhets
1 parent fd86bf4a

move installation docs under separate dir

doc/README_FOR_APP
... ... @@ -1,2 +0,0 @@
1   -Use this README file to introduce your application and point to useful places in the API for learning more.
2   -Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
doc/databases.md
... ... @@ -1,75 +0,0 @@
1   -# Databases:
2   -
3   -GitLab use mysql as default database but you are free to use PostgreSQL or SQLite.
4   -
5   -
6   -## SQLite
7   -
8   - sudo apt-get install -y sqlite3 libsqlite3-dev
9   -
10   -## MySQL
11   -
12   - sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
13   -
14   - # Login to MySQL
15   - $ mysql -u root -p
16   -
17   - # Create the GitLab production database
18   - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
19   -
20   - # Create the MySQL User change $password to a real password
21   - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
22   -
23   - # Grant proper permissions to the MySQL User
24   - mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
25   -
26   -
27   -## PostgreSQL
28   -
29   - sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2
30   -
31   - # Connect to database server
32   - sudo -u postgres psql -d template1
33   -
34   - # Add a user called gitlab. Change $password to a real password
35   - template1=# CREATE USER gitlab WITH PASSWORD '$password';
36   -
37   - # Create the GitLab production database
38   - template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production;
39   -
40   - # Grant all privileges on database
41   - template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab;
42   -
43   - # Quit from PostgreSQL server
44   - template1=# \q
45   -
46   - # Try connect to new database
47   - $ su - gitlab
48   - $ psql -d gitlabhq_production -U gitlab
49   -
50   -
51   -
52   -#### Select the database you want to use
53   -
54   - # SQLite
55   - sudo -u gitlab cp config/database.yml.sqlite config/database.yml
56   -
57   - # Mysql
58   - sudo -u gitlab cp config/database.yml.mysql config/database.yml
59   -
60   - # PostgreSQL
61   - sudo -u gitlab cp config/database.yml.postgres config/database.yml
62   -
63   - # make sure to update username/password in config/database.yml
64   -
65   -#### Install gems
66   -
67   - # mysql
68   - sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment
69   -
70   - # or postgres
71   - sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment
72   -
73   - # or sqlite
74   - sudo -u gitlab -H bundle install --without development test mysql postgres --deployment
75   -
doc/install/:w 0 → 100644
... ... @@ -0,0 +1,295 @@
  1 +_This installation guide created for Debian/Ubuntu and properly tested._
  2 +
  3 +_Checkout requirements before setup_
  4 +
  5 +### IMPORTANT
  6 +
  7 +Please make sure you have followed all the steps below before posting to the mailing list with installation and configuration questions.
  8 +
  9 +Only create a GitHub Issue if you want a specific part of this installation guide updated.
  10 +
  11 +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.
  12 +
  13 +- - -
  14 +
  15 +# Basic setup
  16 +
  17 +The basic installation will provide you a GitLab setup with options:
  18 +
  19 +1. ruby 1.9.3
  20 +2. mysql as main db
  21 +3. gitolite v3 fork by gitlab
  22 +4. nginx + unicorn
  23 +
  24 +The installation consists of next steps:
  25 +
  26 +1. Packages / dependencies
  27 +2. Ruby
  28 +3. Users
  29 +4. Gitolite
  30 +5. Mysql
  31 +6. GitLab.
  32 +7. Nginx
  33 +
  34 +
  35 +# 1. Packages / dependencies
  36 +
  37 +*Keep in mind that `sudo` is not installed on Debian by default. You should install it as root:*
  38 +
  39 + apt-get update && apt-get upgrade && apt-get install sudo
  40 +
  41 +Now install the required packages:
  42 +
  43 + sudo apt-get update
  44 + sudo apt-get upgrade
  45 +
  46 + 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
  47 +
  48 + sudo pip install pygments
  49 +
  50 +
  51 +# 2. Install Ruby
  52 +
  53 + wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
  54 + tar xfvz ruby-1.9.3-p194.tar.gz
  55 + cd ruby-1.9.3-p194
  56 + ./configure
  57 + make
  58 + sudo make install
  59 +
  60 +# 3. Users
  61 +
  62 +Create user for git:
  63 +
  64 + sudo adduser \
  65 + --system \
  66 + --shell /bin/sh \
  67 + --gecos 'git version control' \
  68 + --group \
  69 + --disabled-password \
  70 + --home /home/git \
  71 + git
  72 +
  73 +Create user for GitLab:
  74 +
  75 + # ubuntu/debian
  76 + sudo adduser --disabled-login --gecos 'gitlab system' gitlab
  77 +
  78 +Add your users to groups:
  79 +
  80 + sudo usermod -a -G git gitlab
  81 + sudo usermod -a -G gitlab git
  82 +
  83 +Generate key:
  84 +
  85 + sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
  86 +
  87 +
  88 +# 4. Gitolite
  89 +
  90 +Clone GitLab's fork of the Gitolite source code:
  91 +
  92 + sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
  93 +
  94 +Setup:
  95 +
  96 + cd /home/git
  97 + sudo -u git -H mkdir bin
  98 + sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile'
  99 + sudo -u git sh -c 'gitolite/install -ln /home/git/bin'
  100 +
  101 + sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
  102 + sudo chmod 0444 /home/git/gitlab.pub
  103 +
  104 + sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub"
  105 + sudo -u git -H sed -i 's/0077/0007/g' /home/git/.gitolite.rc
  106 + sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\1'\.\*'/g" /home/git/.gitolite.rc
  107 +
  108 +Permissions:
  109 +
  110 + sudo chmod -R g+rwX /home/git/repositories/
  111 + sudo chown -R git:git /home/git/repositories/
  112 +
  113 + # clone admin repo to add localhost to known_hosts
  114 + # & be sure your user has access to gitolite
  115 + sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
  116 +
  117 + # if succeed you can remove it
  118 + sudo rm -rf /tmp/gitolite-admin
  119 +
  120 +**IMPORTANT! If you can't clone `gitolite-admin` repository - DO NOT PROCEED WITH INSTALLATION**
  121 +Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide)
  122 +and ensure you have followed all of the above steps carefully.
  123 +
  124 +
  125 +# 5. Mysql database
  126 +
  127 + sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
  128 +
  129 + # Login to MySQL
  130 + $ mysql -u root -p
  131 +
  132 + # Create the GitLab production database
  133 + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
  134 +
  135 + # Create the MySQL User change $password to a real password
  136 + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
  137 +
  138 + # Grant proper permissions to the MySQL User
  139 + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
  140 +
  141 +
  142 +# 6. GitLab
  143 +
  144 + cd /home/gitlab
  145 +
  146 +
  147 +#### Get source code
  148 +
  149 + # Get gitlab code. Use this for stable setup
  150 + sudo -H -u gitlab git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab
  151 +
  152 + # Skip this for stable setup.
  153 + # Master branch (recent changes, less stable)
  154 + sudo -H -u gitlab git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab
  155 +
  156 +
  157 +#### Copy configs
  158 +
  159 + cd gitlab
  160 +
  161 + # Rename config files
  162 + #
  163 + sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
  164 +
  165 + # Copy mysql db config
  166 + #
  167 + # make sure to update username/password in config/database.yml
  168 + #
  169 + sudo -u gitlab cp config/database.yml.mysql config/database.yml
  170 +
  171 + # Copy unicorn config
  172 + #
  173 + sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb
  174 +
  175 +#### Install gems
  176 +
  177 + cd /home/gitlab/gitlab
  178 +
  179 + sudo gem install charlock_holmes --version '0.6.8'
  180 + sudo gem install bundler
  181 + sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment
  182 +
  183 +#### Setup application
  184 +
  185 + sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
  186 +
  187 +
  188 +#### Setup GitLab hooks
  189 +
  190 + sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
  191 + sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
  192 +
  193 +#### Check application status
  194 +
  195 +Checking status:
  196 +
  197 + sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
  198 +
  199 +
  200 + # OUTPUT EXAMPLE
  201 + Starting diagnostic
  202 + config/database.yml............exists
  203 + config/gitlab.yml............exists
  204 + /home/git/repositories/............exists
  205 + /home/git/repositories/ is writable?............YES
  206 + remote: Counting objects: 603, done.
  207 + remote: Compressing objects: 100% (466/466), done.
  208 + remote: Total 603 (delta 174), reused 0 (delta 0)
  209 + Receiving objects: 100% (603/603), 53.29 KiB, done.
  210 + Resolving deltas: 100% (174/174), done.
  211 + Can clone gitolite-admin?............YES
  212 + UMASK for .gitolite.rc is 0007? ............YES
  213 + /home/git/share/gitolite/hooks/common/post-receive exists? ............YES
  214 +
  215 +If you got all YES - congratulations! You can run a GitLab app.
  216 +
  217 +#### init script
  218 +
  219 +Create init script in /etc/init.d/gitlab:
  220 +
  221 + sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/
  222 + sudo chmod +x /etc/init.d/gitlab
  223 +
  224 +GitLab autostart:
  225 +
  226 + sudo update-rc.d gitlab defaults 21
  227 +
  228 +#### Now you should start GitLab application:
  229 +
  230 + sudo service gitlab start
  231 +
  232 +
  233 +# 7. Nginx
  234 +
  235 + # Install first
  236 + sudo apt-get install nginx
  237 +
  238 + # Add GitLab to nginx sites & change with your host specific settings
  239 + sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
  240 + sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
  241 +
  242 + # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN**
  243 + # to the IP address and fully-qualified domain name
  244 + # of the host serving GitLab.
  245 + sudo vim /etc/nginx/sites-enabled/gitlab
  246 +
  247 + # Restart nginx:
  248 + sudo /etc/init.d/nginx restart
  249 +
  250 +
  251 +# Done! Visit YOUR_SERVER for gitlab instance
  252 +
  253 +You can login via web using admin generated with setup:
  254 +
  255 + admin@local.host
  256 + 5iveL!fe
  257 +
  258 +
  259 +- - -
  260 +
  261 +
  262 +# Advanced setup tips:
  263 +
  264 +
  265 +## Quick setup
  266 +
  267 +> - - -
  268 +> The first 3 steps of this guide can be easily skipped by executing an install script:
  269 +>
  270 +> # Install curl and sudo
  271 +> apt-get install curl sudo
  272 +>
  273 +> # 3 steps in 1 command :)
  274 +> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh | sh
  275 +>
  276 +> Now you can go to [Step 4](#4-install-gitlab-and-configuration-check-status-configuration)
  277 +>
  278 +> Or if you are installing on Amazon Web Services using Ubuntu 12.04 you can do all steps (1 to 6) at once with:
  279 +>
  280 +> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
  281 +>
  282 +> for more detailed instructions read the HOWTO section of [the script](https://github.com/gitlabhq/gitlab-recipes/blob/master/install/debian_ubuntu_aws.sh)
  283 +> - - -
  284 +
  285 +
  286 +## Customizing Resque's Redis connection
  287 +
  288 +If you'd like Resque to connect to a Redis server on a non-standard port or on
  289 +a different host, you can configure its connection string in the
  290 +**config/resque.yml** file:
  291 +
  292 + production: redis.example.com:6379
  293 +
  294 +**Ok - we have a working application now. **
  295 +**But keep going - there are some things that should be done **
... ...
doc/install/databases.md 0 → 100644
... ... @@ -0,0 +1,75 @@
  1 +# Databases:
  2 +
  3 +GitLab use mysql as default database but you are free to use PostgreSQL or SQLite.
  4 +
  5 +
  6 +## SQLite
  7 +
  8 + sudo apt-get install -y sqlite3 libsqlite3-dev
  9 +
  10 +## MySQL
  11 +
  12 + sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
  13 +
  14 + # Login to MySQL
  15 + $ mysql -u root -p
  16 +
  17 + # Create the GitLab production database
  18 + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
  19 +
  20 + # Create the MySQL User change $password to a real password
  21 + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
  22 +
  23 + # Grant proper permissions to the MySQL User
  24 + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
  25 +
  26 +
  27 +## PostgreSQL
  28 +
  29 + sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2
  30 +
  31 + # Connect to database server
  32 + sudo -u postgres psql -d template1
  33 +
  34 + # Add a user called gitlab. Change $password to a real password
  35 + template1=# CREATE USER gitlab WITH PASSWORD '$password';
  36 +
  37 + # Create the GitLab production database
  38 + template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production;
  39 +
  40 + # Grant all privileges on database
  41 + template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab;
  42 +
  43 + # Quit from PostgreSQL server
  44 + template1=# \q
  45 +
  46 + # Try connect to new database
  47 + $ su - gitlab
  48 + $ psql -d gitlabhq_production -U gitlab
  49 +
  50 +
  51 +
  52 +#### Select the database you want to use
  53 +
  54 + # SQLite
  55 + sudo -u gitlab cp config/database.yml.sqlite config/database.yml
  56 +
  57 + # Mysql
  58 + sudo -u gitlab cp config/database.yml.mysql config/database.yml
  59 +
  60 + # PostgreSQL
  61 + sudo -u gitlab cp config/database.yml.postgres config/database.yml
  62 +
  63 + # make sure to update username/password in config/database.yml
  64 +
  65 +#### Install gems
  66 +
  67 + # mysql
  68 + sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment
  69 +
  70 + # or postgres
  71 + sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment
  72 +
  73 + # or sqlite
  74 + sudo -u gitlab -H bundle install --without development test mysql postgres --deployment
  75 +
... ...
doc/install/installation.md 0 → 100644
... ... @@ -0,0 +1,296 @@
  1 +_This installation guide created for Debian/Ubuntu and properly tested._
  2 +
  3 +_Checkout requirements before setup_
  4 +
  5 +
  6 +### IMPORTANT
  7 +
  8 +Please make sure you have followed all the steps below before posting to the mailing list with installation and configuration questions.
  9 +
  10 +Only create a GitHub Issue if you want a specific part of this installation guide updated.
  11 +
  12 +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.
  13 +
  14 +- - -
  15 +
  16 +# Basic setup
  17 +
  18 +The basic installation will provide you a GitLab setup with options:
  19 +
  20 +1. ruby 1.9.3
  21 +2. mysql as main db
  22 +3. gitolite v3 fork by gitlab
  23 +4. nginx + unicorn
  24 +
  25 +The installation consists of next steps:
  26 +
  27 +1. Packages / dependencies
  28 +2. Ruby
  29 +3. Users
  30 +4. Gitolite
  31 +5. Mysql
  32 +6. GitLab.
  33 +7. Nginx
  34 +
  35 +
  36 +# 1. Packages / dependencies
  37 +
  38 +*Keep in mind that `sudo` is not installed on Debian by default. You should install it as root:*
  39 +
  40 + apt-get update && apt-get upgrade && apt-get install sudo
  41 +
  42 +Now install the required packages:
  43 +
  44 + sudo apt-get update
  45 + sudo apt-get upgrade
  46 +
  47 + 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
  48 +
  49 + sudo pip install pygments
  50 +
  51 +
  52 +# 2. Install Ruby
  53 +
  54 + wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
  55 + tar xfvz ruby-1.9.3-p194.tar.gz
  56 + cd ruby-1.9.3-p194
  57 + ./configure
  58 + make
  59 + sudo make install
  60 +
  61 +# 3. Users
  62 +
  63 +Create user for git:
  64 +
  65 + sudo adduser \
  66 + --system \
  67 + --shell /bin/sh \
  68 + --gecos 'git version control' \
  69 + --group \
  70 + --disabled-password \
  71 + --home /home/git \
  72 + git
  73 +
  74 +Create user for GitLab:
  75 +
  76 + # ubuntu/debian
  77 + sudo adduser --disabled-login --gecos 'gitlab system' gitlab
  78 +
  79 +Add your users to groups:
  80 +
  81 + sudo usermod -a -G git gitlab
  82 + sudo usermod -a -G gitlab git
  83 +
  84 +Generate key:
  85 +
  86 + sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
  87 +
  88 +
  89 +# 4. Gitolite
  90 +
  91 +Clone GitLab's fork of the Gitolite source code:
  92 +
  93 + sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
  94 +
  95 +Setup:
  96 +
  97 + cd /home/git
  98 + sudo -u git -H mkdir bin
  99 + sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile'
  100 + sudo -u git sh -c 'gitolite/install -ln /home/git/bin'
  101 +
  102 + sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
  103 + sudo chmod 0444 /home/git/gitlab.pub
  104 +
  105 + sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub"
  106 + sudo -u git -H sed -i 's/0077/0007/g' /home/git/.gitolite.rc
  107 + sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\1'\.\*'/g" /home/git/.gitolite.rc
  108 +
  109 +Permissions:
  110 +
  111 + sudo chmod -R g+rwX /home/git/repositories/
  112 + sudo chown -R git:git /home/git/repositories/
  113 +
  114 + # clone admin repo to add localhost to known_hosts
  115 + # & be sure your user has access to gitolite
  116 + sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
  117 +
  118 + # if succeed you can remove it
  119 + sudo rm -rf /tmp/gitolite-admin
  120 +
  121 +**IMPORTANT! If you can't clone `gitolite-admin` repository - DO NOT PROCEED WITH INSTALLATION**
  122 +Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide)
  123 +and ensure you have followed all of the above steps carefully.
  124 +
  125 +
  126 +# 5. Mysql database
  127 +
  128 + sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
  129 +
  130 + # Login to MySQL
  131 + $ mysql -u root -p
  132 +
  133 + # Create the GitLab production database
  134 + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
  135 +
  136 + # Create the MySQL User change $password to a real password
  137 + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
  138 +
  139 + # Grant proper permissions to the MySQL User
  140 + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
  141 +
  142 +
  143 +# 6. GitLab
  144 +
  145 + cd /home/gitlab
  146 +
  147 +
  148 +#### Get source code
  149 +
  150 + # Get gitlab code. Use this for stable setup
  151 + sudo -H -u gitlab git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab
  152 +
  153 + # Skip this for stable setup.
  154 + # Master branch (recent changes, less stable)
  155 + sudo -H -u gitlab git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab
  156 +
  157 +
  158 +#### Copy configs
  159 +
  160 + cd gitlab
  161 +
  162 + # Rename config files
  163 + #
  164 + sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
  165 +
  166 + # Copy mysql db config
  167 + #
  168 + # make sure to update username/password in config/database.yml
  169 + #
  170 + sudo -u gitlab cp config/database.yml.mysql config/database.yml
  171 +
  172 + # Copy unicorn config
  173 + #
  174 + sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb
  175 +
  176 +#### Install gems
  177 +
  178 + cd /home/gitlab/gitlab
  179 +
  180 + sudo gem install charlock_holmes --version '0.6.8'
  181 + sudo gem install bundler
  182 + sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment
  183 +
  184 +#### Setup application
  185 +
  186 + sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
  187 +
  188 +
  189 +#### Setup GitLab hooks
  190 +
  191 + sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
  192 + sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
  193 +
  194 +#### Check application status
  195 +
  196 +Checking status:
  197 +
  198 + sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
  199 +
  200 +
  201 + # OUTPUT EXAMPLE
  202 + Starting diagnostic
  203 + config/database.yml............exists
  204 + config/gitlab.yml............exists
  205 + /home/git/repositories/............exists
  206 + /home/git/repositories/ is writable?............YES
  207 + remote: Counting objects: 603, done.
  208 + remote: Compressing objects: 100% (466/466), done.
  209 + remote: Total 603 (delta 174), reused 0 (delta 0)
  210 + Receiving objects: 100% (603/603), 53.29 KiB, done.
  211 + Resolving deltas: 100% (174/174), done.
  212 + Can clone gitolite-admin?............YES
  213 + UMASK for .gitolite.rc is 0007? ............YES
  214 + /home/git/share/gitolite/hooks/common/post-receive exists? ............YES
  215 +
  216 +If you got all YES - congratulations! You can run a GitLab app.
  217 +
  218 +#### init script
  219 +
  220 +Create init script in /etc/init.d/gitlab:
  221 +
  222 + sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/
  223 + sudo chmod +x /etc/init.d/gitlab
  224 +
  225 +GitLab autostart:
  226 +
  227 + sudo update-rc.d gitlab defaults 21
  228 +
  229 +#### Now you should start GitLab application:
  230 +
  231 + sudo service gitlab start
  232 +
  233 +
  234 +# 7. Nginx
  235 +
  236 + # Install first
  237 + sudo apt-get install nginx
  238 +
  239 + # Add GitLab to nginx sites & change with your host specific settings
  240 + sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
  241 + sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
  242 +
  243 + # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN**
  244 + # to the IP address and fully-qualified domain name
  245 + # of the host serving GitLab.
  246 + sudo vim /etc/nginx/sites-enabled/gitlab
  247 +
  248 + # Restart nginx:
  249 + sudo /etc/init.d/nginx restart
  250 +
  251 +
  252 +# Done! Visit YOUR_SERVER for gitlab instance
  253 +
  254 +You can login via web using admin generated with setup:
  255 +
  256 + admin@local.host
  257 + 5iveL!fe
  258 +
  259 +
  260 +- - -
  261 +
  262 +
  263 +# Advanced setup tips:
  264 +
  265 +
  266 +## Quick setup
  267 +
  268 +> - - -
  269 +> The first 3 steps of this guide can be easily skipped by executing an install script:
  270 +>
  271 +> # Install curl and sudo
  272 +> apt-get install curl sudo
  273 +>
  274 +> # 3 steps in 1 command :)
  275 +> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh | sh
  276 +>
  277 +> Now you can go to [Step 4](#4-install-gitlab-and-configuration-check-status-configuration)
  278 +>
  279 +> Or if you are installing on Amazon Web Services using Ubuntu 12.04 you can do all steps (1 to 6) at once with:
  280 +>
  281 +> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
  282 +>
  283 +> for more detailed instructions read the HOWTO section of [the script](https://github.com/gitlabhq/gitlab-recipes/blob/master/install/debian_ubuntu_aws.sh)
  284 +> - - -
  285 +
  286 +
  287 +## Customizing Resque's Redis connection
  288 +
  289 +If you'd like Resque to connect to a Redis server on a non-standard port or on
  290 +a different host, you can configure its connection string in the
  291 +**config/resque.yml** file:
  292 +
  293 + production: redis.example.com:6379
  294 +
  295 +**Ok - we have a working application now. **
  296 +**But keep going - there are some things that should be done **
... ...
doc/install/requirements.md 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +## Platform requirements:
  2 +
  3 +**The project is designed for the Linux operating system.**
  4 +
  5 +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.
  6 +
  7 +We officially support (recent versions of) these Linux distributions:
  8 +
  9 +- Ubuntu Linux
  10 +- Debian/GNU Linux
  11 +
  12 +It should work on:
  13 +
  14 +- Fedora
  15 +- CentOs
  16 +- RedHat
  17 +
  18 +You might have some luck using these, but no guarantees:
  19 +
  20 + - MacOS X
  21 + - FreeBSD
  22 +
  23 +GitLab does **not** run on Windows and we have no plans of making GitLab compatible.
  24 +
  25 +
  26 +## Hardware:
  27 +
  28 +We recommend to use server with at least 1GB RAM for gitlab instance.
... ...
doc/installation.md
... ... @@ -1,295 +0,0 @@
1   -_This installation guide created for Debian/Ubuntu and properly tested._
2   -
3   -_Checkout requirements before setup_
4   -
5   -### IMPORTANT
6   -
7   -Please make sure you have followed all the steps below before posting to the mailing list with installation and configuration questions.
8   -
9   -Only create a GitHub Issue if you want a specific part of this installation guide updated.
10   -
11   -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.
12   -
13   -- - -
14   -
15   -# Basic setup
16   -
17   -The basic installation will provide you a GitLab setup with options:
18   -
19   -1. ruby 1.9.3
20   -2. mysql as main db
21   -3. gitolite v3 fork by gitlab
22   -4. nginx + unicorn
23   -
24   -The installation consists of next steps:
25   -
26   -1. Packages / dependencies
27   -2. Ruby
28   -3. Users
29   -4. Gitolite
30   -5. Mysql
31   -6. GitLab.
32   -7. Nginx
33   -
34   -
35   -# 1. Install packages
36   -
37   -*Keep in mind that `sudo` is not installed on Debian by default. You should install it as root:*
38   -
39   - apt-get update && apt-get upgrade && apt-get install sudo
40   -
41   -Now install the required packages:
42   -
43   - sudo apt-get update
44   - sudo apt-get upgrade
45   -
46   - 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
47   -
48   - sudo pip install pygments
49   -
50   -
51   -# 2. Install Ruby
52   -
53   - wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
54   - tar xfvz ruby-1.9.3-p194.tar.gz
55   - cd ruby-1.9.3-p194
56   - ./configure
57   - make
58   - sudo make install
59   -
60   -# 3. Users
61   -
62   -Create user for git:
63   -
64   - sudo adduser \
65   - --system \
66   - --shell /bin/sh \
67   - --gecos 'git version control' \
68   - --group \
69   - --disabled-password \
70   - --home /home/git \
71   - git
72   -
73   -Create user for GitLab:
74   -
75   - # ubuntu/debian
76   - sudo adduser --disabled-login --gecos 'gitlab system' gitlab
77   -
78   -Add your users to groups:
79   -
80   - sudo usermod -a -G git gitlab
81   - sudo usermod -a -G gitlab git
82   -
83   -Generate key:
84   -
85   - sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
86   -
87   -
88   -# 4. Gitolite
89   -
90   -Clone GitLab's fork of the Gitolite source code:
91   -
92   - sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
93   -
94   -Setup:
95   -
96   - cd /home/git
97   - sudo -u git -H mkdir bin
98   - sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile'
99   - sudo -u git sh -c 'gitolite/install -ln /home/git/bin'
100   -
101   - sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
102   - sudo chmod 0444 /home/git/gitlab.pub
103   -
104   - sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub"
105   - sudo -u git -H sed -i 's/0077/0007/g' /home/git/.gitolite.rc
106   - sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\1'\.\*'/g" /home/git/.gitolite.rc
107   -
108   -Permissions:
109   -
110   - sudo chmod -R g+rwX /home/git/repositories/
111   - sudo chown -R git:git /home/git/repositories/
112   -
113   - # clone admin repo to add localhost to known_hosts
114   - # & be sure your user has access to gitolite
115   - sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
116   -
117   - # if succeed you can remove it
118   - sudo rm -rf /tmp/gitolite-admin
119   -
120   -**IMPORTANT! If you can't clone `gitolite-admin` repository - DO NOT PROCEED WITH INSTALLATION**
121   -Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide)
122   -and ensure you have followed all of the above steps carefully.
123   -
124   -
125   -# 5. Mysql database
126   -
127   - sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
128   -
129   - # Login to MySQL
130   - $ mysql -u root -p
131   -
132   - # Create the GitLab production database
133   - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
134   -
135   - # Create the MySQL User change $password to a real password
136   - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
137   -
138   - # Grant proper permissions to the MySQL User
139   - mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
140   -
141   -
142   -# 6. GitLab
143   -
144   - cd /home/gitlab
145   -
146   -
147   -#### Get source code
148   -
149   - # Get gitlab code. Use this for stable setup
150   - sudo -H -u gitlab git clone -b stable https://github.com/gitlabhq/gitlabhq.git gitlab
151   -
152   - # Skip this for stable setup.
153   - # Master branch (recent changes, less stable)
154   - sudo -H -u gitlab git clone -b master https://github.com/gitlabhq/gitlabhq.git gitlab
155   -
156   -
157   -#### Copy configs
158   -
159   - cd gitlab
160   -
161   - # Rename config files
162   - #
163   - sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
164   -
165   - # Copy mysql db config
166   - #
167   - # make sure to update username/password in config/database.yml
168   - #
169   - sudo -u gitlab cp config/database.yml.mysql config/database.yml
170   -
171   - # Copy unicorn config
172   - #
173   - sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb
174   -
175   -#### Install gems
176   -
177   - cd /home/gitlab/gitlab
178   -
179   - sudo gem install charlock_holmes --version '0.6.8'
180   - sudo gem install bundler
181   - sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment
182   -
183   -#### Setup application
184   -
185   - sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
186   -
187   -
188   -#### Setup GitLab hooks
189   -
190   - sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
191   - sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
192   -
193   -#### Check application status
194   -
195   -Checking status:
196   -
197   - sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production
198   -
199   -
200   - # OUTPUT EXAMPLE
201   - Starting diagnostic
202   - config/database.yml............exists
203   - config/gitlab.yml............exists
204   - /home/git/repositories/............exists
205   - /home/git/repositories/ is writable?............YES
206   - remote: Counting objects: 603, done.
207   - remote: Compressing objects: 100% (466/466), done.
208   - remote: Total 603 (delta 174), reused 0 (delta 0)
209   - Receiving objects: 100% (603/603), 53.29 KiB, done.
210   - Resolving deltas: 100% (174/174), done.
211   - Can clone gitolite-admin?............YES
212   - UMASK for .gitolite.rc is 0007? ............YES
213   - /home/git/share/gitolite/hooks/common/post-receive exists? ............YES
214   -
215   -If you got all YES - congratulations! You can run a GitLab app.
216   -
217   -#### init script
218   -
219   -Create init script in /etc/init.d/gitlab:
220   -
221   - sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/
222   - sudo chmod +x /etc/init.d/gitlab
223   -
224   -GitLab autostart:
225   -
226   - sudo update-rc.d gitlab defaults 21
227   -
228   -#### Now you should start GitLab application:
229   -
230   - sudo service gitlab start
231   -
232   -
233   -# 7. Nginx
234   -
235   - # Install first
236   - sudo apt-get install nginx
237   -
238   - # Add GitLab to nginx sites & change with your host specific settings
239   - sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
240   - sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
241   -
242   - # Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN**
243   - # to the IP address and fully-qualified domain name
244   - # of the host serving GitLab.
245   - sudo vim /etc/nginx/sites-enabled/gitlab
246   -
247   - # Restart nginx:
248   - sudo /etc/init.d/nginx restart
249   -
250   -
251   -# Done! Visit YOUR_SERVER for gitlab instance
252   -
253   -You can login via web using admin generated with setup:
254   -
255   - admin@local.host
256   - 5iveL!fe
257   -
258   -
259   -- - -
260   -
261   -
262   -# Advanced setup tips:
263   -
264   -
265   -## Quick setup
266   -
267   -> - - -
268   -> The first 3 steps of this guide can be easily skipped by executing an install script:
269   ->
270   -> # Install curl and sudo
271   -> apt-get install curl sudo
272   ->
273   -> # 3 steps in 1 command :)
274   -> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu.sh | sh
275   ->
276   -> Now you can go to [Step 4](#4-install-gitlab-and-configuration-check-status-configuration)
277   ->
278   -> Or if you are installing on Amazon Web Services using Ubuntu 12.04 you can do all steps (1 to 6) at once with:
279   ->
280   -> curl https://raw.github.com/gitlabhq/gitlab-recipes/master/install/debian_ubuntu_aws.sh | sh
281   ->
282   -> for more detailed instructions read the HOWTO section of [the script](https://github.com/gitlabhq/gitlab-recipes/blob/master/install/debian_ubuntu_aws.sh)
283   -> - - -
284   -
285   -
286   -## Customizing Resque's Redis connection
287   -
288   -If you'd like Resque to connect to a Redis server on a non-standard port or on
289   -a different host, you can configure its connection string in the
290   -**config/resque.yml** file:
291   -
292   - production: redis.example.com:6379
293   -
294   -**Ok - we have a working application now. **
295   -**But keep going - there are some things that should be done **
doc/requirements.md
... ... @@ -1,28 +0,0 @@
1   -## Platform requirements:
2   -
3   -**The project is designed for the Linux operating system.**
4   -
5   -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.
6   -
7   -We officially support (recent versions of) these Linux distributions:
8   -
9   -- Ubuntu Linux
10   -- Debian/GNU Linux
11   -
12   -It should work on:
13   -
14   -- Fedora
15   -- CentOs
16   -- RedHat
17   -
18   -You might have some luck using these, but no guarantees:
19   -
20   - - MacOS X
21   - - FreeBSD
22   -
23   -GitLab does **not** run on Windows and we have no plans of making GitLab compatible.
24   -
25   -
26   -## Hardware:
27   -
28   -We recommend to use server with at least 1GB RAM for gitlab instance.