Gitlab Install
By makeaweli
- 2 minutes read - 343 wordsInstalling Ruby
yaml
Ruby gem will thrown an error each time it runs that it wasn’t compiled with libyaml. The following links fixed this issue:
- http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/
- https://github.com/sstephenson/ruby-build/issues/119
Active Directory Configuration
ldap:
enabled: true
host: 'coruscant.gemini.edu'
base: 'CN=users,DC=gemini,DC=edu'
port: 3268
uid: 'sAMAccountName'
method: 'plain' # plain
bind_dn: 'CN=srv_webuser,OU=Service Accounts,DC=gemini,DC=edu'
password: ???
MySQL Configuration
We need to modify the database config to use our external MySQL server as we don’t plan on running a local MySQL.
vi /home/gitlab/gitlab/config/database/yml
production:
adapter: mysql2
encoding: utf8
reconnect: false
database:
pool: 5
username:
password:
host: hbfmysql1.hi.gemini.edu
Post receive File Fix
Make sure that the path to the post receive hooks for gitolite is readable by the gitolite user:
Gitolite Configuration
Nginx Proxy
We need to use a reverse proxy because gitlab is running on port 3000.
Here’s the nginx config in `/etc/nginx/conf.d/gitlab.conf`:
upstream gitlab {
server 10.1.50.17:3000;
}
server {
listen 10.1.50.17:80; # e.g., listen 192.168.1.1:80;
server_name gitlab.hi.gemini.edu; # e.g., server_name source.example.com;
root /home/gitlab/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
## send request back to apache1 ##
location / {
proxy_pass http://gitlab;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Troubleshooting
gitlab can’t connect to gitolite
Try updating the gitolite keys
Redis
The bundle my give timeout errors. This may be related to the redis server not running.
A few things to try:
- /etc/init.d/redis status
- read the redis log: /var/log/redis/redis.log
- delete the default redis database: /var/lib/redis/dump.rdp
ssh key redundancy
If you remove and add users with duplicate ssh keys, gitolite may still have a copy cached which will prevent the either user ssh git access.
To test this, ssh as `git@gitlab.hi.gemini.edu`. The output will show you which repos you have permissions for. If you see any errors, remove the ssh key for the redundant user:
If gitolite is still adding the old user, clone the gitolite-admin repo and remove the user’s key manually:
Sources
Installing Gitlab 4
- https://github.com/nielsbasjes/gitlab-recipes/blob/master/install/CentOS_6.md#make-the-git-account-known-and-allowed-to-the-gitlab-user
- https://github.com/gitlabhq/gitlabhq/wiki/From-4.0-to-4.1
https://github.com/gitlabhq/gitlabhq/wiki/From-3.1-to-4.0
Installing Gitlab 3
- http://howto.basjes.nl/linux/installing-gitlab-on-centos-6
- http://dlaxar.blogspot.co.at/2012/06/installing-gitlab-with-gitolite-on.html