zoukankan      html  css  js  c++  java
  • CentOS7下安装gitlab

    依赖环境安装
    [root@localhost ~]# yum -y install curl openssh-server ca-certificates postfix

    [root@localhost ~]# systemctl enable postfix #设置开机启动

    [root@localhost ~]# systemctl start postfix #开启postfix服务

    下载软件rpm包并安装
    [root@localhost src]#

    curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.2.2-ce.0.el7.x86_64.rpm

    安装软件包

    [root@localhost home]# rpm -i gitlab-ce-9.2.2-ce.0.el7.x86_64.rpm

    修改和自定义默认端口
    [root@localhost home]# vim /etc/gitlab/gitlab.rb

    external_url 'http://192.168.1.196:8089'

    ps:注意这里设置的端口不能被占用,默认是8080端口,如果8080已经使用,请自定义其它端口,并在防火墙设置开放相对应得端口

    启动GitLab
    [root@localhost home]# gitlab-ctl restart

    [root@localhost home]# gitlab-ctl reconfigure #重置

    提示”OK”表示启动成功;

    汉化GitLab
    使用浏览器访问服务器IP地址+端口名 192.168.1.196:8089

    默认用户名和密码: root /5iveL!fe

    这时的页面是英文版本的;

    汉化包下载地址: https://github.com/htve/GitlabForChinese/releases 并下载相应版本的汉化包

    导入汉化包

    [root@localhost home]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 <v9.2.2.zh1.diff

    重启GitLab服务 :gitlab-ctl restart

    修改GitLab的仓库存储路径
    修改GitLab的配置文件,找到git_data_dir位置

    [root@localhost ~]# vim /etc/gitlab/gitlab.rb

    git_data_dir “路径”

    停止当前GitLab,重新加载

    [root@localhost ~]# gitlab-ctl stop

    [root@localhost ~]# gitlab-ctl reconfigure

    就会在配置的路径下多出一个目录

    [root@localhost ~]# gitlab-ctl start #再启动服务

    [root@localhost ~]# systemctl start postfix

    root密码重置
    gitlab-rails console production

    user = User.where(id: 1).first

    user.password = '要设置的密码'

    user.password_confirmation = '要设置的密码' 12345678

    user.save!

    查看gitlab版本号: cat /opt/gitlab/version-manifest.json | grep build_version

  • 相关阅读:
    解题报告 百进制数
    解题报告 Loongint 的夜晚
    解题报告 树形图计数
    解题报告 一元三次方程求解
    解题报告 Loongint 的旅行安排
    解题报告 数字查找
    用C++编写简单绘图语言的词法分析器——程序清单
    C++ 连接 mysql 的一个例子(Visual Studio 2005)
    fedora 8 下JDK 6.0 配置
    IBM DB2 V9 常用命令
  • 原文地址:https://www.cnblogs.com/free-long/p/8603341.html
Copyright © 2011-2022 走看看