CentOS 7 最小安装后操作
- 设置时区
timedatectl set-timezone Asia/Shanghai
- 添加 Gitlab 清华源
vi /etc/yum.repos.d/gitlab-ce.repo
- [gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
- 添加 yum 163源并更新CentOS
yum -y install wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all && yum makecache && yum -y update
- 安装GItlab
- 安装最新Gitlab
sudo yum install gitlab-ce
- 安装指定版本
cd /tmp && wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.0-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-9.5.0-*.rpm
- 安装最新Gitlab
- 编辑gitlab.rb文件
vi /etc/gitlab/gitlab.rb
- 将
external_url 'http://localhost'
改成将external_url 'http://您服务器的ip或域名'
- 汉化
cd /opt && curl -LJO https://github.com/htve/GitlabForChinese/releases/download/v9.5.0/v9.5.0.zh1.diff
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v9.5.0.*.diff
- 配置gitlab
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
- 开启防火墙
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
systemctl restart firewalld.service
CentOS 7 安装后更新
- 卸载已有Gitlab安装(放心,数据是安全的)
yum -y remove gitlab-ce
- 删除卸载后残留
rm -rf /opt/gitlab
- 执行安装的
4,6,7