CentOS 7安装GitLab 11.4.5

安装GitLab没必要像网上说的配置那么复杂,也不要自行编译安装,直接使用Omnibus版本即可,也就是综合安装包,注意如下几点:

1、不需要替换Nginx,直接使用GitLab的原生集成,同时这种方式也方便以后的配置,对于网上的方法来说,这一步居然替换成其它的Nginx,不用原生自带的,那么不是给以后配置造成吭吗?!!!

2、对于SSL的配置统一不在GitLab配置,直接使用Nginx做反向代理做SSL。

3、在CentOS下配置postfix多半会错,解决方法参考:https://www.cnblogs.com/EasonJim/p/9944495.html

4、网上居然要配置sshd的服务?厉害?

5、对于firewalld的配置,我建议不要这个服务,改成iptables。

6、运维安装GitLab只要注意这几点:域名访问、仓库目录创建和迁移、邮件发送(后续讲解)

7、很多时候网上说GitLab国外的网址被墙?我检测了三大运营商的网络基本没什么问题,如果非要国内下载,可以参考这个网址配置:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

8、GitLab官网的安装教程是企业版本,只有有两个关键字ce、ee,ce代表社区免费版,ee代表企业版。

9、GitLab默认账号密码:root/5iveL!fe,默认启动端口是80。

下面是安装脚本的思路,不一定每台机器可以使用,只提供一个思路:

# 安装依赖
yum install -y curl policycoreutils-python

yum install -y postfix
systemctl enable postfix
systemctl start postfix
# fix postfix in centos bug
sed -i 's/inet_interfaces = localhost/inet_interfaces = all' /etc/postfix/main.cf
service postfix restart

# 下载安装
wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.5-ce.0.el7.x86_64.rpm -O gitlab-ce-11.4.5-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-11.4.5-ce.0.el7.x86_64.rpm

# 修改配置
# 域名(可选)
# sed -i 's/external_url \'http://gitlab.example.com\'/external_url \'http://gitlab.jsoft.com\'/g' /etc/gitlab/gitlab.rb
# 迁移目录
mv /var/opt/gitlab/git-data{,_bak}
mkdir -p /data/service/gitlab/git-data
chmod 775 /data
chmod 775 /data/service
chmod -R 775 /data/service/gitlab
rsync -av /var/opt/gitlab/git-data/repositories /data/service/gitlab/git-data/
ls -n /data/service/gitlab/git-data /var/opt/gitlab/git-data

# 启动
gitlab-ctl reconfigure
gitlab-ctl restart

(安装可选)国外源安装:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
yum install -y gitlab-ce

(安装可选)国内源安装:

cat > /etc/yum.repos.d/gitlab-ce.repo << EOF
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
EOF
# 更新源缓存
yum makecache

# 安装CE版
yum install -y gitlab-ce

全自动脚本:https://github.com/easonjim/centos-shell/blob/master/gitlab/install-gitlab_11.4.5.sh

 

参考:

https://about.gitlab.com/install/#centos-7

https://cloud.tencent.com/developer/article/1010163

https://blog.csdn.net/huhuhuemail/article/details/80519433

https://my.oschina.net/gccr/blog/591410

https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

https://laravel-china.org/topics/2829/centos-7-install-gitlab-ce-community-edition-and-modify-the-default-nginx

posted @ 2018-11-13 16:19  EasonJim  阅读(1565)  评论(0编辑  收藏  举报