gitlab新增新用户有两种方式,第一种可以用户主动注册(自己设置密码);第二种也可以通过root管理员用户直接添加用户,发个邮件到用户的邮箱里,收到邮件后激活。
如果是第二种方式添加新用户的话,就需要配置gitlab邮箱了,而在linux环境里发送邮件就需要安装postfix(电子邮件服务器)工具

如果采用第二种方式添加用户就得在部署gitlab之前,先提前安装好所需要的依赖

# yum install -y curl policycoreutils-python openssh-server postfix
# systemctl enable postfix
# systemctl start postfix

输入systemctl status postfix确定postfix是否是启动状态,看到 Active: active (running)说明,已经启动了。

开始可以部署gitlab-ce了,之所以要找的是-ce版的,就因为这个社区版是免费的

使用清华大学的镜像仓库资源:https://mirrors.tuna.tsinghua.edu.cn/ ,找到 gitlab-ce,然后是yum目录(如果使用的是centos的话),之后el7,找到对应版本复制下载链接即可

#  wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

下载之后,直接用rpm命令安装
#  rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

安装完毕后,修改一下gitlab的配置文件:

# vim /etc/gitlab/gitlab.rb

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://gitlab.example.com'

## Legend
##! The following notations at the beginning of each line may be used to
##! differentiate between components of this file and to easily select them using

。。。

配置文件里的默认设置基本能满足需要,不用改太多,就把 external_url 这项的内容改为你的IP或域名即可(如:external_url 'http://170.56.136.28'  或 external_url 'http://xxxtest.com' )。

然后,重新加载配置:

# gitlab-ctl reconfigure

启动gitlab:

# gitlab-ctl restart

查看gitlab运行状况:

# gitlab-ctl status

 

posted on 2020-03-09 23:32  tianya2012  阅读(584)  评论(0编辑  收藏  举报