基于CentOS7.x gitlab环境搭建,卸载,汉化
gitlab环境搭建,卸载,汉化 --搭建篇
环境搭建
- 安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix
- 设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
-
下载gitlab安装包,然后安装
- 10.0.x版本需要大于4G内存,否则报502(解决办法创建4G的swap,并且赋600权限)
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.4-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-10.0.4-ce.0.el7.x86_64.rpm
chmod -R 755 /var/log/gitlab- 8.x版本直接安装
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm - 修改gitlab配置文件指定服务器ip和自定义端口
vim /etc/gitlab/gitlab.rb
- 重置并启动GitLab
- 查看gitlab版本
head -1 /opt/gitlab/version-manifest.txt
- 设置、重置root密码(下面代码一行一行执行,初始化123456789密码)
cd /opt/gitlab/bin
gitlab-rails console production
user=User.where(id:1).first
user.password=123456789
user.password_confirmation=123456789
user.save!
exit