gitlab搭建

偏执的太偏执、 2024-04-17 14:52 146阅读 0赞

gitlab搭建

安装并配置必要的依赖项

1.安装所需软件

[root@localhost ~]# yum install -y curl policycoreutils-python openssh-server

  1. yum install -y curl policycoreutils-python openssh-server

image.png

2.启动并设置sshd服务开机自启

如果已经开启sshd了可以跳过次步骤,一般都是开启的

  1. systemctl enable sshd
  2. systemctl start sshd

3.在系统防火墙中打开HTTP访问

如果已经关闭防火墙可以跳过次步骤

  1. firewall-cmd --permanent --add-service=http
  2. systemctl reload firewalld

添加http服务 并且重新加载防火墙

4.安装邮件服务

安装postfix
[root@localhost ~]# yum -y install postfix
image.png
设置开机自启动
[root@localhost ~]# systemctl enable postfix
启动
[root@localhost ~]# systemctl start postfix

在Postfix安装期间,可能会出现配置屏幕。选择“Internet Site”并按Enter键。使用服务器的外部DNS作为“邮件名称”,然后按Enter键。如果出现其他屏幕,请继续按Enter键接受默认值。

添加GitLab软件包存储库并安装软件包

1.添加镜像

镜像可以在https://packages.gitlab.com/gitlab/gitlab-ce这找到后下载
wget —content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ol/7/gitlab-ce-10.0.2-ce.0.el7.x86\_64.rpm/download.rpm

2.安装gitlab

[root@localhost ~]# rpm -i gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm
出现下图安装成功 需要一点时间
image.png

3.修改gitlab配置文件

指定服务器ip和自定义端口

[root@localhost ~]# vim /etc/gitlab/gitlab.rb

external_url ‘http://localhost:7011’

4.启动

启动gitlab服务
[root@localhost ~]# gitlab-ctl reconfigure
Running handlers:
Running handlers complete
Chef Client finished, 360/515 resources updated in 01 minutes 20 seconds
gitlab Reconfigured!

image.png
[root@localhost ~]# gitlab-ctl restart
ok: run: gitaly: (pid 20345) 1s
ok: run: gitlab-monitor: (pid 20380) 0s
ok: run: gitlab-workhorse: (pid 20420) 1s
ok: run: logrotate: (pid 20454) 0s
ok: run: nginx: (pid 20460) 1s
ok: run: node-exporter: (pid 20477) 0s
ok: run: postgres-exporter: (pid 20501) 0s
ok: run: postgresql: (pid 20511) 0s
ok: run: prometheus: (pid 20558) 0s
ok: run: redis: (pid 20575) 0s
ok: run: redis-exporter: (pid 20580) 1s
ok: run: sidekiq: (pid 20624) 0s
ok: run: unicorn: (pid 20634) 1s
image.png

访问

根据上面我们设定的网址访问网站
访问成功如下图所示
第一次访问需要修改密码
image.png

发表评论

表情:
评论列表 (有 0 条评论,146人围观)

还没有评论,来说两句吧...

相关阅读