Commit b2f57409931ddd9bf059e992bc255da93a8192b5
1 parent
4a535e17
Exists in
master
and in
4 other branches
Updated installation docs with better db origanisation
Showing
1 changed file
with
50 additions
and
48 deletions
Show diff stats
doc/installation.md
| @@ -70,14 +70,56 @@ Now install the required packages: | @@ -70,14 +70,56 @@ Now install the required packages: | ||
| 70 | sudo apt-get update | 70 | sudo apt-get update |
| 71 | sudo apt-get upgrade | 71 | sudo apt-get upgrade |
| 72 | 72 | ||
| 73 | - sudo apt-get install -y wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-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 | 73 | + 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 |
| 74 | + | ||
| 75 | + | ||
| 76 | +# Database | ||
| 77 | + | ||
| 78 | +## SQLite | ||
| 79 | + | ||
| 80 | + sudo apt-get install -y sqlite3 libsqlite3-dev | ||
| 81 | + | ||
| 82 | +## MySQL | ||
| 74 | 83 | ||
| 75 | - # If you want to use MySQL: | ||
| 76 | sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | 84 | sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev |
| 77 | 85 | ||
| 78 | - # If you want to use PostgreSQL: | 86 | + # Login to MySQL |
| 87 | + $ mysql -u root -p | ||
| 88 | + | ||
| 89 | + # Create the GitLab production database | ||
| 90 | + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | ||
| 91 | + | ||
| 92 | + # Create the MySQL User change $password to a real password | ||
| 93 | + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; | ||
| 94 | + | ||
| 95 | + # Grant proper permissions to the MySQL User | ||
| 96 | + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; | ||
| 97 | + | ||
| 98 | + | ||
| 99 | +## PostgreSQL | ||
| 100 | + | ||
| 79 | sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2 | 101 | sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2 |
| 80 | 102 | ||
| 103 | + # Connect to database server | ||
| 104 | + sudo -u postgres psql -d template1 | ||
| 105 | + | ||
| 106 | + # Add a user called gitlab. Change $password to a real password | ||
| 107 | + template1=# CREATE USER gitlab WITH PASSWORD '$password'; | ||
| 108 | + | ||
| 109 | + # Create the GitLab production database | ||
| 110 | + template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production; | ||
| 111 | + | ||
| 112 | + # Grant all privileges on database | ||
| 113 | + template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab; | ||
| 114 | + | ||
| 115 | + # Quit from PostgreSQL server | ||
| 116 | + template1=# \q | ||
| 117 | + | ||
| 118 | + # Try connect to new database | ||
| 119 | + $ su - gitlab | ||
| 120 | + $ psql -d gitlabhq_production -U gitlab | ||
| 121 | + | ||
| 122 | + | ||
| 81 | # 2. Install Ruby | 123 | # 2. Install Ruby |
| 82 | 124 | ||
| 83 | wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | 125 | wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz |
| @@ -172,62 +214,22 @@ and ensure you have followed all of the above steps carefully. | @@ -172,62 +214,22 @@ and ensure you have followed all of the above steps carefully. | ||
| 172 | # SQLite | 214 | # SQLite |
| 173 | sudo -u gitlab cp config/database.yml.sqlite config/database.yml | 215 | sudo -u gitlab cp config/database.yml.sqlite config/database.yml |
| 174 | 216 | ||
| 175 | - # Or | ||
| 176 | # Mysql | 217 | # Mysql |
| 177 | - # Install MySQL as directed in Step #1 | ||
| 178 | - | ||
| 179 | - # Login to MySQL | ||
| 180 | - $ mysql -u root -p | 218 | + sudo -u gitlab cp config/database.yml.mysql config/database.yml |
| 181 | 219 | ||
| 182 | - # Create the GitLab production database | ||
| 183 | - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | ||
| 184 | - | ||
| 185 | - # Create the MySQL User change $password to a real password | ||
| 186 | - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; | ||
| 187 | - | ||
| 188 | - # Grant proper permissions to the MySQL User | ||
| 189 | - mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; | ||
| 190 | - | ||
| 191 | - # Exit MySQL Server and copy the example config, make sure to update username/password in config/database.yml | ||
| 192 | - sudo -u gitlab cp config/database.yml.example config/database.yml | ||
| 193 | - | ||
| 194 | - # Or | ||
| 195 | # PostgreSQL | 220 | # PostgreSQL |
| 196 | - # Install PostgreSQL as directed in Step #1 | ||
| 197 | - | ||
| 198 | - # Connect to database server | ||
| 199 | - sudo -u postgres psql -d template1 | ||
| 200 | - | ||
| 201 | - # Add a user called gitlab. Change $password to a real password | ||
| 202 | - template1=# CREATE USER gitlab WITH PASSWORD '$password'; | ||
| 203 | - | ||
| 204 | - # Create the GitLab production database | ||
| 205 | - template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production; | ||
| 206 | - | ||
| 207 | - # Grant all privileges on database | ||
| 208 | - template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab; | ||
| 209 | - | ||
| 210 | - # Quit from PostgreSQL server | ||
| 211 | - template1=# \q | ||
| 212 | - | ||
| 213 | - # Try connect to new database | ||
| 214 | - $ su - gitlab | ||
| 215 | - $ psql -d gitlabhq_production -U gitlab | ||
| 216 | - | ||
| 217 | - # Exit PostgreSQL Server and copy the example config, make sure to update username/password in config/database.yml | ||
| 218 | sudo -u gitlab cp config/database.yml.postgres config/database.yml | 221 | sudo -u gitlab cp config/database.yml.postgres config/database.yml |
| 219 | 222 | ||
| 220 | - # If you need create development, test, staging or another database | ||
| 221 | - # Repeate some steps with actual commands | 223 | + # make sure to update username/password in config/database.yml |
| 222 | 224 | ||
| 223 | #### Install gems | 225 | #### Install gems |
| 224 | 226 | ||
| 225 | - # Please, check Gemfile before run bundle install | ||
| 226 | - # Select database gem, wich you will use | ||
| 227 | - # or run to setup gems with mysql usage | 227 | + # mysql |
| 228 | sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment | 228 | sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment |
| 229 | + | ||
| 229 | # or postgres | 230 | # or postgres |
| 230 | sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment | 231 | sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment |
| 232 | + | ||
| 231 | # or sqlite | 233 | # or sqlite |
| 232 | sudo -u gitlab -H bundle install --without development test mysql postgres --deployment | 234 | sudo -u gitlab -H bundle install --without development test mysql postgres --deployment |
| 233 | 235 |