Commit 03f43291cdf60c6a185383d7d218fd87196d6231
1 parent
f9def679
Exists in
master
and in
4 other branches
Remove easy script cause its should be improved
Showing
2 changed files
with
1 additions
and
316 deletions
Show diff stats
doc/install/:w
| ... | ... | @@ -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. 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/installation.md
| ... | ... | @@ -262,27 +262,7 @@ You can login via web using admin generated with setup: |
| 262 | 262 | |
| 263 | 263 | # Advanced setup tips: |
| 264 | 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 | - | |
| 265 | +_Checkout databases.md for postgres or sqlite_ | |
| 286 | 266 | |
| 287 | 267 | ## Customizing Resque's Redis connection |
| 288 | 268 | ... | ... |