天天看点

3.linux 安装 gitlab

1.安装ssh

sudo yum install -y curl policycoreutils-pythonopenssh-server

2.将SSH服务设置成开机自启动

sudo systemctl enable sshd

3.启动SSH服务

sudo systemctl start sshd

4.添加http服务到firewalld,pemmanent表示永久生效,若不加--permanent系统下次启动后就会失效

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

5.安装Postfix以发送通知邮件

sudo yum install postfix

6.将postfix服务设置成开机自启动

sudo systemctl enable postfix

7.启动postfix

sudo systemctl start postfix

error:Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.

        vim /etc/postfix/main.cf

        inet_protocols = ipv4

               inet_interfaces = all

8.安装wget

yum -y install wget

9.下载git

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm

10.安装gitlab

rpm -i gitlab-ce-11.11.8-ce.0.el7.x86_64.rpm

12.修改git端口和访问地址

vim /etc/gitlab/gitlab.rb

修改此项配置 external_url 'http://192.168.1.21:9090';

修改此项配置 unicorn['port'] = 9091

13.创建 gitlab数据文件

mkdir /usr/local/data/gitlab

14.修改gitlab默认数据文件

vim /etc/gitlab/gitlab.rb

git_data_dirs({
	"default" => {
		"path" => "/usr/local/data/gitlab"
    }
})
           

修改path

15.刷新配置文件 三个步骤启动gitlab

gitlab-ctl stop

gitlab-ctl reconfigure //重置并启动GitLab

gitlab-ctl start

16.关闭防火墙浏览器访问 192.168.1.21:9090

17.浏览器输入 http://192.168.1.21:9090/users/sign_in root/5ivel!fe

继续阅读