Commit b60804bf10e34703d05a40a2545cf50c992ad459
Exists in
master
and in
4 other branches
Merge pull request #546 from sylis/patch-1
Added needed new line for code in markdown
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
doc/installation.md
@@ -82,27 +82,34 @@ Create user for git: | @@ -82,27 +82,34 @@ Create user for git: | ||
82 | 82 | ||
83 | 83 | ||
84 | Create user for gitlab: | 84 | Create user for gitlab: |
85 | + | ||
85 | # ubuntu/debian | 86 | # ubuntu/debian |
86 | sudo adduser --disabled-login --gecos 'gitlab system' gitlab | 87 | sudo adduser --disabled-login --gecos 'gitlab system' gitlab |
87 | 88 | ||
88 | Add your user to git group: | 89 | Add your user to git group: |
90 | + | ||
89 | sudo usermod -a -G git gitlab | 91 | sudo usermod -a -G git gitlab |
90 | 92 | ||
91 | Generate key: | 93 | Generate key: |
94 | + | ||
92 | sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa | 95 | sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa |
93 | 96 | ||
94 | Get gitolite source code: | 97 | Get gitolite source code: |
98 | + | ||
95 | cd /home/git | 99 | cd /home/git |
96 | sudo -H -u git git clone git://github.com/gitlabhq/gitolite /home/git/gitolite | 100 | sudo -H -u git git clone git://github.com/gitlabhq/gitolite /home/git/gitolite |
97 | 101 | ||
98 | Setup: | 102 | Setup: |
103 | + | ||
99 | sudo -u git -H /home/git/gitolite/src/gl-system-install | 104 | sudo -u git -H /home/git/gitolite/src/gl-system-install |
100 | sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | 105 | sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub |
101 | sudo chmod 777 /home/git/gitlab.pub | 106 | sudo chmod 777 /home/git/gitlab.pub |
102 | 107 | ||
103 | sudo -u git -H sed -i 's/0077/0007/g' /home/git/share/gitolite/conf/example.gitolite.rc | 108 | sudo -u git -H sed -i 's/0077/0007/g' /home/git/share/gitolite/conf/example.gitolite.rc |
104 | sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gl-setup -q /home/git/gitlab.pub" | 109 | sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gl-setup -q /home/git/gitlab.pub" |
110 | + | ||
105 | Permissions: | 111 | Permissions: |
112 | + | ||
106 | sudo chmod -R g+rwX /home/git/repositories/ | 113 | sudo chmod -R g+rwX /home/git/repositories/ |
107 | sudo chown -R git:git /home/git/repositories/ | 114 | sudo chown -R git:git /home/git/repositories/ |
108 | 115 | ||
@@ -131,6 +138,7 @@ Permissions: | @@ -131,6 +138,7 @@ Permissions: | ||
131 | sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml | 138 | sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml |
132 | 139 | ||
133 | #### Select db you want to use | 140 | #### Select db you want to use |
141 | + | ||
134 | # SQLite | 142 | # SQLite |
135 | sudo -u gitlab cp config/database.yml.sqlite config/database.yml | 143 | sudo -u gitlab cp config/database.yml.sqlite config/database.yml |
136 | 144 | ||
@@ -140,13 +148,16 @@ Permissions: | @@ -140,13 +148,16 @@ Permissions: | ||
140 | # Change username/password of config/database.yml to real one | 148 | # Change username/password of config/database.yml to real one |
141 | 149 | ||
142 | #### Install gems | 150 | #### Install gems |
151 | + | ||
143 | sudo -u gitlab -H bundle install --without development test --deployment | 152 | sudo -u gitlab -H bundle install --without development test --deployment |
144 | 153 | ||
145 | #### Setup DB | 154 | #### Setup DB |
155 | + | ||
146 | sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production | 156 | sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production |
147 | sudo -u gitlab bundle exec rake db:seed_fu RAILS_ENV=production | 157 | sudo -u gitlab bundle exec rake db:seed_fu RAILS_ENV=production |
148 | 158 | ||
149 | Checking status: | 159 | Checking status: |
160 | + | ||
150 | sudo -u gitlab bundle exec rake gitlab_status | 161 | sudo -u gitlab bundle exec rake gitlab_status |
151 | 162 | ||
152 | 163 | ||
@@ -169,6 +180,7 @@ If you got all YES - congrats! You can go to next step. | @@ -169,6 +180,7 @@ If you got all YES - congrats! You can go to next step. | ||
169 | # 5. Server up | 180 | # 5. Server up |
170 | 181 | ||
171 | Application can be started with next command: | 182 | Application can be started with next command: |
183 | + | ||
172 | # For test purposes | 184 | # For test purposes |
173 | sudo -u gitlab bundle exec rails s -e production | 185 | sudo -u gitlab bundle exec rails s -e production |
174 | 186 | ||
@@ -194,6 +206,7 @@ Application can be started with next command: | @@ -194,6 +206,7 @@ Application can be started with next command: | ||
194 | sudo apt-get install nginx | 206 | sudo apt-get install nginx |
195 | 207 | ||
196 | ## Unicorn | 208 | ## Unicorn |
209 | + | ||
197 | cd /home/gitlab/gitlab | 210 | cd /home/gitlab/gitlab |
198 | sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb | 211 | sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb |
199 | sudo -u gitlab unicorn_rails -c config/unicorn.rb -E production -D | 212 | sudo -u gitlab unicorn_rails -c config/unicorn.rb -E production -D |
@@ -223,9 +236,11 @@ Edit /etc/nginx/nginx.conf. Add next code to **http** section: | @@ -223,9 +236,11 @@ Edit /etc/nginx/nginx.conf. Add next code to **http** section: | ||
223 | mygitlab.com - change to your domain. | 236 | mygitlab.com - change to your domain. |
224 | 237 | ||
225 | Restart nginx: | 238 | Restart nginx: |
239 | + | ||
226 | /etc/init.d/nginx restart | 240 | /etc/init.d/nginx restart |
227 | 241 | ||
228 | Create init script in /etc/init.d/gitlab: | 242 | Create init script in /etc/init.d/gitlab: |
243 | + | ||
229 | #! /bin/bash | 244 | #! /bin/bash |
230 | ### BEGIN INIT INFO | 245 | ### BEGIN INIT INFO |
231 | # Provides: unicorn | 246 | # Provides: unicorn |
@@ -279,10 +294,13 @@ Create init script in /etc/init.d/gitlab: | @@ -279,10 +294,13 @@ Create init script in /etc/init.d/gitlab: | ||
279 | exit 0 | 294 | exit 0 |
280 | 295 | ||
281 | Adding permission: | 296 | Adding permission: |
297 | + | ||
282 | sudo chmod +x /etc/init.d/gitlab | 298 | sudo chmod +x /etc/init.d/gitlab |
283 | 299 | ||
284 | When server is rebooted then gitlab must starting: | 300 | When server is rebooted then gitlab must starting: |
301 | + | ||
285 | sudo update-rc.d gitlab defaults | 302 | sudo update-rc.d gitlab defaults |
286 | 303 | ||
287 | Now you can start/restart/stop gitlab like: | 304 | Now you can start/restart/stop gitlab like: |
305 | + | ||
288 | sudo /etc/init.d/gitlab restart | 306 | sudo /etc/init.d/gitlab restart |