CentOs6.8 yum安装GitLab

注:CentOs6不要安装太新的GitLab,我第一次安装的是最新的,一直报502错误

一、配置yum源  vi /etc/yum.repos.d/gitlab-ce.repo 里面写下面的内容

            [gitlab-ce]

            name=Gitlab CE Repository
            gpgcheck=0
            enabled=1

二、更新本地的yum缓存:sudo yum makecache

三、安装GitLab

sudo yum install gitlab-ce        #自动安装最新版
sudo yum install gitlab-ce-x.x.x    #安装指定版本(我这里安装的是8.15.3)

四、修改默认配置文件:vi /etc/gitlab/gitlab.rb

external_url 'http://对外的ip:端口号'

如果有必要的话修改下这个unicorn['port'] = 端口号,如果上面已经可以了就不需要这一步

五、启动服务sudo gitlab-ctl reconfigure

六、根据external_url 去访问,第一次登录使用的用户名和密码为 root 和 5iveL!fe,登录后默认叫你修改密码。

七、GitLab常用命令

sudo gitlab-ctl start    # 启动所有 gitlab 组件;
sudo gitlab-ctl stop        # 停止所有 gitlab 组件;
sudo gitlab-ctl restart        # 重启所有 gitlab 组件;
sudo gitlab-ctl status        # 查看服务状态;
sudo gitlab-ctl reconfigure        # 启动服务;
sudo vim /etc/gitlab/gitlab.rb        # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
sudo gitlab-ctl tail        # 查看日志;

猜你喜欢

转载自blog.csdn.net/h2520ny/article/details/80824450