参考连接:
https://blog.csdn.net/DahlinSky/article/details/105857952
https://www.jianshu.com/p/d03a08dd28a2
https://blog.csdn.net/u014265398/article/details/105854686
一、准备运行环境
1、系统:
版本:centos7 64位
IP:192.168.0.130
内存:4G
处理器内核总数:4个
二、安装配置依赖关系
1、安装SSH
sudo yum install -y curl policycoreutils-pythonopenssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
2、安装防火墙
yum install firewalld systemd -y
service firewalld start
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
3、安装Postfix
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
三、下载安装Gitlab
1、下载安装Gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.9.4-ce.0.el7.x86_64.rpm
2、安装Gitlab
yum install gitlab-ce-12.9.4-ce.0.el7.x86_64.rpm
四、Gitlab相关配置
1、配置Gitlab
vim /etc/gitlab/gitlab.rb
# 修改内容:
external_url ‘http://192.168.224.130:8081’
nginx['listen_port'] = 8081
unicorn['port']=8089
2、开启端口8081、8089
firewall-cmd --zone=public --add-port=8081/tcp --permanent
firewall-cmd --zone=public --add-port=8089/tcp --permanent
3、查询端口号8089 是否开启:
firewall-cmd --query-port=8081/tcp
firewall-cmd --query-port=8089/tcp
4、重启防火墙:
firewall-cmd --reload
5、查询有哪些端口是开启的:
firewall-cmd --list-port
6、使配置文件生效
gitlab-ctl reconfigure
gitlab-ctl restart
五、测试安装
1、浏览器登陆测试
IP+端口
http://192.168.224.130:8081
六、Gitlab配置中文界面
1、需要先修改密码–>之后再次登陆
用户:root
密码:qwer1234
2、设置中文,再次登陆即可。
这不就中文了。
七、Gitlab 常用命令
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;