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