centos 7 部署gitlab
1,准备环境
7.2最小化安装
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
yum install -y wget net-tools policycoreutils-python3 vim postfix
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl enable postfix
systemctl start postfix
#vi /etc/selinux/config
#SELINUX=enforcing改为SELINUX=disabled
优化系统
echo "ulimit -c unlimited" >>/etc/profile
echo "unset MAILCHECK" >>/etc/profile
echo "* soft nofile 65535" >>/etc/security/limits.conf
echo "* hard nofile 65535" >>/etc/security/limits.conf
echo "* soft nproc 65535" >>/etc/security/limits.conf
echo "* hard nproc 65535" >>/etc/security/limits.conf
echo "* soft stack unlimited" >>/etc/security/limits.conf
echo "* hard stack unlimited" >>/etc/security/limits.conf
echo "* soft core unlimited" >>/etc/security/limits.conf
echo "* hard core unlimited" >>/etc/security/limits.conf
echo "* soft data unlimited" >>/etc/security/limits.conf
echo "* hard data unlimited" >>/etc/security/limits.conf
echo "* soft fsize unlimited" >>/etc/security/limits.conf
echo "* hard fsize unlimited" >>/etc/security/limits.conf
reboot
2,开始下载包 看见狐狸头代表安装成了
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.12.9-ce.0.el7.x86_64.rpm
rpm -ivh gitlab-ce-13.12.9-ce.0.el7.x86_64.rpm
3,修改配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://gitlab.example.com' 修改为 external_url 'http://192.168.144.128:8099' gitlab浏览器请求页面,注意把端口改了别和服务冲突
4,加载配置,只要修改配置后就要重新加载配置
gitlab-ctl reconfigure
查看状态
gitlab-ctl status
5,浏览器登录修改默认密码
http://192.168.144.128:8099
6,习惯设置,中文 ,修改保存刷新页面
注册用户后需要管理用户批准后才可以登录。
管理用户批准
管理用户创建组
管理用户创建项目
后面想配置邮件,修改配置重新加载配置,备注如果遇到502,建议检查内存,还有就是重启服务的时候要等1分钟后在登录浏览器,重启后进程启动不是很快。最好不要使用太老的版本。
#进入到gitlab的shell界面
gitlab-rails console -e production
#选择root帐号
user = User.where(id:1).first
#密码需要大于8位数
user.password = 'abc123456'
#重复下密码
user.password_confirmation = 'abc123456'
#保存密码
user.save