Commit a962217db808616065a8160458fe6f4a084f7cd1

Authored by Dmitriy Zaporozhets
2 parents 48d37272 76f2e065

Merge branch 'install-guide-improvements' of /home/git/repositories/gitlab/gitlabhq

doc/install/databases.md
@@ -11,10 +11,17 @@ GitLab supports the following databases: @@ -11,10 +11,17 @@ GitLab supports the following databases:
11 # Install the database packages 11 # Install the database packages
12 sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev 12 sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
13 13
  14 + # Pick a database root password (can be anything), type it and press enter
  15 + # Retype the database root password and press enter
  16 +
14 # Login to MySQL 17 # Login to MySQL
15 mysql -u root -p 18 mysql -u root -p
16 19
17 - # Create a user for GitLab. (change $password to a real password) 20 + # Type the database root password
  21 +
  22 + # Create a user for GitLab
  23 + # do not type the 'mysql>', this is part of the prompt
  24 + # change $password in the command below to a real password you pick
18 mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; 25 mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
19 26
20 # Create the GitLab production database 27 # Create the GitLab production database
@@ -29,6 +36,16 @@ GitLab supports the following databases: @@ -29,6 +36,16 @@ GitLab supports the following databases:
29 # Try connecting to the new database with the new user 36 # Try connecting to the new database with the new user
30 sudo -u git -H mysql -u gitlab -p -D gitlabhq_production 37 sudo -u git -H mysql -u gitlab -p -D gitlabhq_production
31 38
  39 + # Type the password you replaced $password with earlier
  40 +
  41 + # You should now see a 'mysql>' prompt
  42 +
  43 + # Quit the database session
  44 + mysql> \q
  45 +
  46 + # You are done installing the database and can go back to the rest of the installation.
  47 +
  48 +
32 ## PostgreSQL 49 ## PostgreSQL
33 50
34 # Install the database packages 51 # Install the database packages
doc/install/installation.md
@@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components: @@ -36,10 +36,10 @@ The GitLab installation consists of setting up the following components:
36 `sudo` is not installed on Debian by default. Make sure your system is 36 `sudo` is not installed on Debian by default. Make sure your system is
37 up-to-date and install it. 37 up-to-date and install it.
38 38
39 - # run as root  
40 - apt-get update  
41 - apt-get upgrade  
42 - apt-get install sudo 39 + # run as root!
  40 + apt-get update -y
  41 + apt-get upgrade -y
  42 + apt-get install sudo -y
43 43
44 **Note:** 44 **Note:**
45 Vim is an editor that is used here whenever there are files that need to be 45 Vim is an editor that is used here whenever there are files that need to be
@@ -55,7 +55,7 @@ Install the required packages: @@ -55,7 +55,7 @@ Install the required packages:
55 Make sure you have the right version of Python installed. 55 Make sure you have the right version of Python installed.
56 56
57 # Install Python 57 # Install Python
58 - sudo apt-get install python 58 + sudo apt-get install -y python
59 59
60 # Make sure that Python is 2.5+ (3.x is not supported at the moment) 60 # Make sure that Python is 2.5+ (3.x is not supported at the moment)
61 python --version 61 python --version
@@ -73,15 +73,17 @@ Make sure you have the right version of Python installed. @@ -73,15 +73,17 @@ Make sure you have the right version of Python installed.
73 mail server. By default, Debian is shipped with exim4 whereas Ubuntu 73 mail server. By default, Debian is shipped with exim4 whereas Ubuntu
74 does not ship with one. The recommended mail server is postfix and you can install it with: 74 does not ship with one. The recommended mail server is postfix and you can install it with:
75 75
76 - sudo apt-get install postfix 76 + sudo apt-get install -y postfix
  77 +
  78 +Then select 'Internet Site' and press enter to confirm the hostname.
77 79
78 # 2. Ruby 80 # 2. Ruby
79 81
80 -Remove old 1.8 ruby if present 82 +Remove the old Ruby 1.8 if present
81 83
82 - sudo apt-get remove ruby1.8 84 + sudo apt-get remove -y ruby1.8
83 85
84 -Download and compile it: 86 +Download Ruby and compile it:
85 87
86 mkdir /tmp/ruby && cd /tmp/ruby 88 mkdir /tmp/ruby && cd /tmp/ruby
87 curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz 89 curl --progress http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | tar xz
@@ -92,7 +94,7 @@ Download and compile it: @@ -92,7 +94,7 @@ Download and compile it:
92 94
93 Install the Bundler Gem: 95 Install the Bundler Gem:
94 96
95 - sudo gem install bundler 97 + sudo gem install bundler --no-ri --no-rdoc
96 98
97 99
98 # 3. System Users 100 # 3. System Users
@@ -106,28 +108,25 @@ Create a `git` user for Gitlab: @@ -106,28 +108,25 @@ Create a `git` user for Gitlab:
106 108
107 GitLab Shell is a ssh access and repository management software developed specially for GitLab. 109 GitLab Shell is a ssh access and repository management software developed specially for GitLab.
108 110
109 - # Login as git  
110 - sudo su git  
111 -  
112 # Go to home directory 111 # Go to home directory
113 cd /home/git 112 cd /home/git
114 113
115 # Clone gitlab shell 114 # Clone gitlab shell
116 - git clone https://github.com/gitlabhq/gitlab-shell.git 115 + sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
117 116
118 cd gitlab-shell 117 cd gitlab-shell
119 118
120 # switch to right version 119 # switch to right version
121 - git checkout v1.4.0 120 + sudo -u git -H git checkout v1.4.0
122 121
123 - cp config.yml.example config.yml 122 + sudo -u git -H cp config.yml.example config.yml
124 123
125 # Edit config and replace gitlab_url 124 # Edit config and replace gitlab_url
126 # with something like 'http://domain.com/' 125 # with something like 'http://domain.com/'
127 - vim config.yml 126 + sudo -u git -H vim config.yml
128 127
129 # Do setup 128 # Do setup
130 - ./bin/install 129 + sudo -u git -H ./bin/install
131 130
132 131
133 # 5. Database 132 # 5. Database
@@ -152,8 +151,7 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install @@ -152,8 +151,7 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install
152 sudo -u git -H git checkout 5-3-stable 151 sudo -u git -H git checkout 5-3-stable
153 152
154 **Note:** 153 **Note:**
155 -You can change `5-3-stable` to `master` if you want the *bleeding edge* version, but  
156 -do so with caution! 154 +You can change `5-3-stable` to `master` if you want the *bleeding edge* version, but do so with caution!
157 155
158 ## Configure it 156 ## Configure it
159 157
@@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. @@ -205,10 +203,18 @@ Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup.
205 # Mysql 203 # Mysql
206 sudo -u git cp config/database.yml.mysql config/database.yml 204 sudo -u git cp config/database.yml.mysql config/database.yml
207 205
  206 + or
  207 +
208 # PostgreSQL 208 # PostgreSQL
209 sudo -u git cp config/database.yml.postgresql config/database.yml 209 sudo -u git cp config/database.yml.postgresql config/database.yml
210 210
211 -Make sure to update username/password in config/database.yml. 211 + # Make sure to update username/password in config/database.yml.
  212 + # You only need to adapt the production settings (first part).
  213 + # If you followed the database guide then please do as follows:
  214 + # Change 'root' to 'gitlab'
  215 + # Change 'secure password' with the value you have given to $password
  216 + # You can keep the double quotes around the password
  217 + sudo -u git -H vim config/database.yml
212 218
213 ## Install Gems 219 ## Install Gems
214 220
@@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml. @@ -216,10 +222,10 @@ Make sure to update username/password in config/database.yml.
216 222
217 sudo gem install charlock_holmes --version '0.6.9.4' 223 sudo gem install charlock_holmes --version '0.6.9.4'
218 224
219 - # For MySQL (note, the option says "without") 225 + # For MySQL (note, the option says "without ... postgres")
220 sudo -u git -H bundle install --deployment --without development test postgres 226 sudo -u git -H bundle install --deployment --without development test postgres
221 227
222 - # Or for PostgreSQL 228 + # Or for PostgreSQL (note, the option says "without ... mysql")
223 sudo -u git -H bundle install --deployment --without development test mysql 229 sudo -u git -H bundle install --deployment --without development test mysql
224 230
225 231
@@ -227,6 +233,10 @@ Make sure to update username/password in config/database.yml. @@ -227,6 +233,10 @@ Make sure to update username/password in config/database.yml.
227 233
228 sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production 234 sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
229 235
  236 + # Type 'yes' to create the database.
  237 +
  238 + # When done you see 'Administrator account created:'
  239 +
230 240
231 ## Install Init Script 241 ## Install Init Script
232 242
@@ -269,7 +279,7 @@ If you can't or don't want to use Nginx as your web server, have a look at the @@ -269,7 +279,7 @@ If you can't or don't want to use Nginx as your web server, have a look at the
269 [`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section. 279 [`Advanced Setup Tips`](./installation.md#advanced-setup-tips) section.
270 280
271 ## Installation 281 ## Installation
272 - sudo apt-get install nginx 282 + sudo apt-get install -y nginx
273 283
274 ## Site Configuration 284 ## Site Configuration
275 285
@@ -280,10 +290,8 @@ Download an example site config: @@ -280,10 +290,8 @@ Download an example site config:
280 290
281 Make sure to edit the config file to match your setup: 291 Make sure to edit the config file to match your setup:
282 292
283 - # **YOUR_SERVER_FQDN** to the fully-qualified  
284 - # domain name of your host serving GitLab. Also, replace  
285 - # the 'listen' line with the following:  
286 - # listen 80 default_server; # e.g., listen 192.168.1.1:80; 293 + # Change YOUR_SERVER_FQDN to the fully-qualified
  294 + # domain name of your host serving GitLab.
287 sudo vim /etc/nginx/sites-available/gitlab 295 sudo vim /etc/nginx/sites-available/gitlab
288 296
289 ## Restart 297 ## Restart
lib/support/init.d/gitlab
@@ -51,7 +51,7 @@ start() { @@ -51,7 +51,7 @@ start() {
51 exit 1 51 exit 1
52 else 52 else
53 if [ `whoami` = root ]; then 53 if [ `whoami` = root ]; then
54 - execute "rm $SOCKET_PATH/gitlab.socket" 54 + execute "rm -f $SOCKET_PATH/gitlab.socket"
55 execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS" 55 execute "RAILS_ENV=production bundle exec puma $DAEMON_OPTS"
56 execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &" 56 execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
57 echo "$DESC started" 57 echo "$DESC started"
lib/support/nginx/gitlab
@@ -7,7 +7,7 @@ upstream gitlab { @@ -7,7 +7,7 @@ upstream gitlab {
7 } 7 }
8 8
9 server { 9 server {
10 - listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea 10 + listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
11 server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; 11 server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
12 server_tokens off; # don't show the version number, a security best practice 12 server_tokens off; # don't show the version number, a security best practice
13 root /home/git/gitlab/public; 13 root /home/git/gitlab/public;