GitLab 安装步骤
- 下载地址 ,下载 GitLab rpm安装包
- 安装GitLab所需相关依赖
yum install policycoreutils openssh-clients postfix
- 启动SSH服务并设置开机启动
systemctl enable sshd && systemctl start sshd
- 设置 postfix 开机自启,并启动
systemctl enable postfix && systemctl start postfix
5 开放SSH以及Http服务,然后重新加载防火墙列表
firewall-cmd --add-service=ssh --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
6.安装GitLab ,安装完成后,第一次运行GitLab前,需要执行一次配置初始化操作。 gitlab-ctl reconfig。 这个过程耗时比较长。
rpm -Uvh gitlab-ce-15.1.0-ce.0.el7.x86_64.rpm
- 修改PUMA端口号,默认8080, 修改gitlab.rb 配置监听PUMA端口号
vim /var/opt/gitlab/gitlab-rails/etc/puma.rb
vim /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
- 接下来就可以使用gitlab-ctl指令来操作gitlab服务了。
- gitlab-ctl reconfigure 重新配置gitlab。
- gitlab-ctl start 启动gitlab
- gitlab-ctl stop 停止gitlab
- gitlab-ctl restart 重启gitlab
- gitlab-ctl status 查看gitlab服务状态
- gitlab-ctl tail 查看gitlab服务日志
服务启动完成后,就可以访问gitlab服务了。默认的服务端口就是80端口。默认的用户名是root,密码存放在/etc/gitlab/initial_root_password文件中(通常建议登录后立即修改默认密码)。
-
如果需要修改访问的地址和端口,可以修改/etc/gitlab/gitlab.rb配置文件,修改其中的external_url属性即可
Jenkins 安装
- 下载地址,参照官方文档下载
https://www.jenkins.io/download/
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install fontconfig java-11-openjdk
yum install jenkins
2.安装完成后,查看Jenkins安装位置
rpm -ql jenkins
- 进入Jenkins.war 目录位置,启动Jenkins
nohup java -jar jenkins.war --httpPort=9999
这种方式不会占用当前命令行窗口,日志输出到nohup.out下
- 防火墙开放端口
firewall-cmd --permanent --zone=public --add-port=端口号/tcp
- 重启防火墙:
systemctl reload firewalld
- 查看是否开放端口9999:
firewall-cmd --list-ports
- 查看Jenkins初始密码,nohup.out中日志查找
cat nohup.out