CentOS安装Gitlab CE

System Version:CentOS release 6.7(Final)
 

GitLab Community Edition (CE)

1、进入以下链接,按操作手册进行安装
 
CentOS安装Gitlab CE
 
2、安装配置依赖项
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
备注:如已经安装过请主动飘过
 
3、添加Gitlab仓库,并安装Gitlab软件包
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
 
备注:rpm安装方式
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-XXX.rpm
rpm -i gitlab-ce-XXX.rpm
 
4、配置和使用Gitlab
#sudo gitlab-ctl reconfigure
 
5、修改Gitlab主机地址和端口号
-------------------------------------------------------------
# cd /etc/gitlab/
# vim gitlab.rb
修改如下:
external_rul 'http://local' -> 'http://192.168.2.42'
-------------------------------------------------------------
修改Gitlab端口号,默认:80
# cd /var/opt/gitlab/nginx/conf
# vim gitlab-http.conf
修改如下:
server{
     listen *:80 -> 12080;
     server_name local -> 192.168.2.42;
}
-------------------------------------------------------------
 
6、启动Gitlab
# sudo gitlab-ctl start/stop/restart
 
7、登录Gitlab
浏览器访问http://192.168.2.42:12080
Username:root
Password:5iveL!fe
初次登录会要求修改密码
 
CentOS安装Gitlab CE
 
8、备注
亲测:执行sudo gitlab-ctl reconfig 会重新更改端口号为8

相关推荐