Centos 6.5上安装GitLab服务及问题解决(6)

[git@Git gitlab]$ sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn -P /etc/init.d/
[git@Git gitlab]$ sudo mv /etc/init.d/gitlab-unicorn /etc/init.d/gitlab
[git@Git gitlab]$ sudo chmod +x /etc/init.d/gitlab
[git@Git gitlab]$ sudo chkconfig --add gitlab
[git@Git gitlab]$ sudo chkconfig gitlab on
[git@Git gitlab]$ sudo /etc/init.d/gitlab start

12)复制配置文件[这里使用nginx做为WEB服务]
[git@Git gitlab]$ cp lib/support/nginx/gitlab /usr/local/nginx/conf/conf.d/
[git@Git gitlab]$ cd /usr/local/nginx/conf/conf.d/
[git@Git gitlab]$ sudo chown -R git:git .
[git@Git conf.d]$ cp gitlab gitlab.conf
[git@Git conf.d]$ vi gitlab.conf
upstream gitlab {
  server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
  listen *:80 default_server;        # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
  server_name git.test.com;    # e.g., server_name source.example.com;
  server_tokens off;    # don't show the version number, a security best practice
  root /home/git/gitlab/public;
  client_max_body_size 5m;
  access_log  logs/gitlab_access.log;
  error_log  logs/gitlab_error.log;
  location / {
    try_files $uri $uri/index.html $uri.html @gitlab;
  }
  location @gitlab {
    proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
    proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
    proxy_redirect    off;
    proxy_set_header  X-Forwarded-Proto $scheme;
    proxy_set_header  Host              $http_host;
    proxy_set_header  X-Real-IP        $remote_addr;
    proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_pass ;
  }
}
[git@Git conf.d]$ sudo service nginx restart

13)拉取GitLab静态文件
[git@Git conf.d]$ cd /home/git/gitlab
[git@Git gitlab]$ bundle exec rake assets:precompile RAILS_ENV=production
[git@Git gitlab]$ sudo service gitlab restart

14)访问测试

初始管理员帐号和密码为:
admin@local.host
5iveL!fe

1)访问 如果配置正常会显示如下页面:

CentOS 6.5上构建GitLab服务及问题总结

2)输入默认的登陆账号和密码,会提示你修改默认密码:

CentOS 6.5上构建GitLab服务及问题总结

3)密码修改后,会重新跳回到登陆界面:

CentOS 6.5上构建GitLab服务及问题总结

4)重新输入登陆账号和新密码,登陆成功后显示如下:

CentOS 6.5上构建GitLab服务及问题总结

Ubuntu 12.04 上安装 GitLab

GitLab 5.3 升级注意事项

在 CentOS 上部署 GitLab (自托管的Git项目仓库)

在RHEL6/CentOS6/ScientificLinux6上安装GitLab 6.0.2

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/e37dbe61225a187bef7dcb0655fbfcdf.html