在CentOS 7上安装GitLab

jopen 8年前

网上安装gitlab的方法有一堆,由于墙的原因,没有一个能安装成功,最后终于在中文版官网上面找到了RPM包可以下载,进行一键安装:

中文官网地址:http://www.gitlab.cc/ 下载地址为:http://www.gitlab.cc/downloads

下面把步骤写一下:

安装必要的包

  1. sudo yum install curl openssh-server

    安装curl 和 openssh-server

  2. sudo systemctl enable sshd

    systemctlchkconfigservice命令的合体,上面这个命令是设置sshd开机自启

  3. sudo systemctl start sshd

    启动 sshd 服务

  4. sudo yum install postfix

    安装 postfix 邮件服务器

  5. sudo systemctl enable postfix

    设置 postfix 开机自启动

  6. sudo systemctl start postfix

    启动 postfix 服务

  7. sudo firewall-cmd --permanent --add-service=http

    防火墙永久开启 http 服务

  8. sudo systemctl reload firewalld

    防火墙设定生效

下载rpm包

进入 清华的镜像: http://mirror.tuna.tsinghua.edu.cn/gitlab-ce/

选择一个包下载下来,我下载的包名为:gitlab-ce-8.3.1-ce.1.el7.x86_64.rpm

chmod +x gitlab-ce-8.3.1-ce.1.el7.x86_64.rpm

rpm -i gitlab-ce-8.3.1-ce.1.el7.x86_64.rpm

配置

打开配置文件: vim /etc/gitlab/gitlab.rb

  1. 配置仓库URL地址

    修改配置项:external_url ,修改为你的gitlab的域名或IP地址

    注:此处必改,否则生成的仓库地址是 http://localhost/XXXX/XXX.git

  2. 配置仓库保存位置

    修改配置项:git_data_dir 默认为 /var/opt/gitlab/git-data

  3. 让配置生效

sudo gitlab-ctl reconfigure

在浏览器访问

http://192.168.3.211/

默认的用户名密码为:root/5iveL!fe

常见问题

官方文档地址:http://doc.gitlab.com/ce/

我只能帮到这里了

来自: http://my.oschina.net/gccr/blog/591410