Gitlab安装说明请参照https://www.gitlab.cc/downloads/#centos6nginx
1. 安装配置依赖项git
如想使用Postfix来发送邮件,在安装期间请选择'Internet Site'. 您也能够用sendmai或者 配置SMTP服务 并 使用SMTP发送邮件.redis
在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口.sql
sudo yum install curl openssh-server openssh-clients postfix cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s http -s ssh
2. 添加GitLab仓库,并安装到服务器上centos
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash sudo yum install gitlab-ce
若是你不习惯使用命令管道的安装方式, 你能够在这里下载 安装脚本 或者 手动下载您使用的系统相应的安装包(RPM/Deb) 而后安装浏览器
curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-XXX.rpm rpm -i gitlab-ce-XXX.rpm
3. 启动GitLabbash
sudo gitlab-ctl reconfigure
4. 使用浏览器访问GitLab服务器
首次访问GitLab,系统会让你从新设置管理员的密码,设置成功后会返回登陆界面.ssh
默认的管理员帐号是root,若是你想更改默认管理员帐号,请输入上面设置的新密码登陆系统后修改账号名.curl
注意事项:
一、 因为下载速度太慢,推荐使用https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/中下载的rpm安装包进行安装,我使用的yum下gitlab-ce-8.16.4-ce.0.el6.x86_64.rpm
二、 安装gitlab会默认安装nginx、postgresql、redis等软件
三、 Gitlab默认使用80端口及8080端口,其中unicorn使用8080端口,如端口被占用,需解决端口冲突
四、 修改unicorn的8080端口可在/etc/gitlab/gitlab.rb中打开# unicorn['port'] = 8080 和 # gitlab_workhorse['auth_backend'] = http://localhost:8080 的注释,并修改8080端口,保存后运行sudo gitlab-ctl reconfigure便可。
五、 修改80端口可在/etc/gitlab/gitlab.rb中打开nginx['listen_port'] = nil,并修改nil为所需端口好,保存后运行sudo gitlab-ctl reconfigure便可。
同理,相应的其余组件也在gitlab.rb中修改端口号