CentOS7安装gitlab+汉化

mini安装centos7

更新yum源

  1. yum -y install net-tools wget lrzsz lsof  
  2. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup  
  3. cd /etc/yum.repos.d/  
  4. wget http://mirrors.163.com/.help/CentOS7-Base-163.repo  
  5. yum clean all  
  6. yum makecache  
  7. yum -y update  
  8. yum -y install pcre pcre-devel openssl openssl-devel gcc-c++
  9. yum -y install curl policycoreutils openssh-server openssh-clients postfix vim 
  10. firewall-cmd --permanent --add-service=http
  11. systemctl reload firewalld

 

添加GitLab镜像源并安装

vim /etc/yum.repos.d/gitlab_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

 

安装git

yum -y install gitlab-ce

 

配置gitlab

vim /etc/gitlab/gitlab.rb

# 编辑对外的域名(gitlab.papamk.com请添加A记录指向本服务器的公网IP):
external_url 'http://192.168.1.249/'

 

重新编译gitlab

gitlab-ctl reconfigure

 

汉化gitlab

cd /home
wget https://gitlab.com/xhang/gitlab/-/archive/11-0-stable-zh/gitlab-11-0-stable-zh.tar.gz
tar -zxvf gitlab-11-0-stable-zh.tar.gz

 

由于复制过多覆盖需要确认,所以把~/.bashrc进行修改

vi ~/.bashrc
注销cp命令
#alias cp='cp -i'
source ~/.bashrc

 

覆盖gitlab的所有页面

cp -rf ./gitlab-11-0-stable-zh/* /opt/gitlab/embedded/service/gitlab-rails/

 

重新编译gitlab

gitlab-ctl reconfigure

 

启动gitlab

gitlab-ctl start

 

查看是否启动

netstat -tpln

tcp        0      0 127.0.0.1:9100          0.0.0.0:*               LISTEN      18040/node_exporter 
tcp        0      0 127.0.0.1:9229          0.0.0.0:*               LISTEN      18022/gitlab-workho 
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      18185/unicorn maste 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      18035/nginx: master 
tcp        0      0 127.0.0.1:9168          0.0.0.0:*               LISTEN      18018/ruby          
tcp        0      0 127.0.0.1:8082          0.0.0.0:*               LISTEN      18153/sidekiq 5.1.3 
tcp        0      0 127.0.0.1:9236          0.0.0.0:*               LISTEN      17999/gitaly        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      12972/sshd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1312/master         
tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      18035/nginx: master 
tcp        0      0 0.0.0.0:6783            0.0.0.0:*               LISTEN      17993/alertmanager  
tcp        0      0 127.0.0.1:9121          0.0.0.0:*               LISTEN      18143/redis_exporte 
tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      18130/prometheus    
tcp        0      0 127.0.0.1:9187          0.0.0.0:*               LISTEN      18118/postgres_expo 
tcp        0      0 127.0.0.1:9093          0.0.0.0:*               LISTEN      17993/alertmanager  
tcp6       0      0 ::1:9168                :::*                    LISTEN      18018/ruby          
tcp6       0      0 :::22                   :::*                    LISTEN      12972/sshd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      1312/master

出现以下这些进程就是正常的了。

打开页面:http://192.168.1.249

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(服务器)