这两天一直在给公司的服务器配置Gitlab(10.5.4)。过程很是痛苦,所以把过程记录一下。

1、安装CentOS7

从官网上下载了最新版CentOS-7-x86_64-DVD-1708.iso。用老毛桃制作了启动优盘。

安装时,选择 基础网络服务器。这个最让我头疼就是设置IP地址了,由于公司IP分段管理,让我好一个折腾。可以参见上文

http://blog.csdn.net/qwlovedzm/article/details/79562401

经验提示:网络设置比较麻烦,我直接用的图形界面设置的静态IP。这可是肺腑之言。

2、安装Gitlab

第一步 yum安装依赖
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
#安装防火墙
sudo yum install firewalld
sudo systemctl start firewalld
#firewall-cmd --permanent --add-service

#sudo systemctl reload firewalld

sudo firewall-cmd --add-service=http --permanent

sudo firewall-cmd --reload

第二步 下载安装gitlab package
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce    #安装指定版本 sudo yum install gitlab-ce-10.5.4
如果脚本无法运行, 可以直接下载下来
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-0.el7.x86_64.rpm/download
rpm -i gitlab-ce-XXX.rpm

#国内镜像:curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.5.4-ce.0.el7.x86_64.rpm

#rpm -i gitlab-ce-10.5.4.rpm

第三步 配置gitlab
sudo gitlab-ctl reconfigure
第四步 启动
sudo gitlab-ctl start
#centos7 防火墙 允许80端口或是其他指定端口

#sudo firewall-cmd --permanent --zone=public --add-port=80/tcp

#我的是815端口,所以要加进去。

sudo firewall-cmd --permanent --zone=public --add-port=815/tcp

sudo firewall-cmd --add-service=http --permanent

sudo firewall-cmd --reload

3、修改Gitlab默认访问端口

由于公司网站的80口被占用了,只能换成815,这个问题折磨了我两天时间。还是看得官网资料解决了。

--1更改端口
vim /etc/gitlab/gitlab.rb

输入内容:

external_url 'http://10.68.166.10:815'

nginx['listen_port'] = 815

nginx['listen_https'] = false

--2 改nigx端口
vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
查找如下内容并修改:

server {

listen *:815;
server_name 10.68.166.10
if ($http_host = "") {
   set $http_host_with_default "10.68.166.10:815";
}
}

--------------------------------------------------------------

修改完成后,执行

gitlab-ctl reconfigure

gitlab-ctl restart

打开浏览器,输入"http:/10.68.166.10:815",见到了久违的登录页。

GitLab服务器IP地址修改为域名

---------------------------------------------------------------------------------------------------------

1、在GitLab上新建一个项目test_gitlab,刚开始仓库地址是http://localhost/yulei/test_gitlab.git .

把localhost 换成域名(前提是可以将外网的指定端口映射到内网),修改方式如下:

修改gitlab.yml文件:

[cpp] view plain copy
[root@localhost config]# cd /opt/gitlab/embedded/service/gitlab-rails/config

2、修改gitlab.yml文件

[cpp] view plain copy
[root@localhost config]# vim gitlab.yml    
[root@localhost config]# vim gitlab.yml

3、重启GitLab,就可以在项目主页上看到URL变成了域名。

[cpp] view plain copy
gitlab-ctl restart

---------------------
作者:lelele1990
来源:CSDN
原文:https://blog.csdn.net/qwlovedzm/article/details/79576112
版权声明:本文为博主原创文章,转载请附上博文链接!

CentOS7下安装Gitlab社区版【安装步骤、IP改域名、修改端口】的更多相关文章

  1. Gitlab 社区版安装部署和维护指南

    因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gitlab 升级到了 ...

  2. win10 Ubuntu子系统安装&odoo10社区版安装

    参考文档: http://www.cnblogs.com/odoouse/p/5995603.html https://www.jianshu.com/p/58090215bda8 一.win10 U ...

  3. 【Git】 GitLab服务器社区版安装与配置

    GitLab简介 GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务 GitLab系统架构 当~git在图片中引用时,它表示git用户的主目录 ...

  4. centos7上安装docker-ce社区版

    报错:Error: docker-ce-selinux conflicts with 2:container-selinux-2.12-2.gite7096ce.el7.noarch 转载:http: ...

  5. Centos7下PHP的卸载与安装nginx

    Centos7下PHP的卸载与安装nginx CentOS上PHP完全卸载,想把PHP卸载干净,直接用yum的remove命令是不行的,需要查看有多少rpm包,然后按照依赖顺序逐一卸载. 1.首先查看 ...

  6. Gitlab - 安装的社区版 Gitlab-ce,解决访问网页报502-Whoops, GitLab is taking too much time to respond的问题

    问题背景 在自己虚拟机(centos7)上装了 Gitlab-ce,就是社区版的 Gitlab,版本是 13.0+ 问题描述 浏览器访问 Gitlab 网站,报 502 问题翻译 502-Whoops ...

  7. centos7上安装docker社区版

    container(容器) docker(集装箱) 容器的优点 1. 启动速度快 2. 节省资源 3. 兼容性高 保证机器正常上网 #ping www.baidu.com CPU需要支持虚拟化 # g ...

  8. OpenAcc社区版安装教程(Linux版)(更新版)

    官方安装过程如下图所示 1.安装前 下载OpenAcc社区版 1,目前为止的最新版,平台是Linux,选择Linux x86-64. 我的服务器系统是CentOs 下载地址链接:https://www ...

  9. yum install mysql-community-server yum方式安装mysql(社区版实操)

    前言:rpm方式或者这种yum安装时比较简单的方式,但是不推荐,但是确实很着急的话,可以采用这种安装这种方式不利于后续对mysql的管理,如果是多实例或者是复杂的一些架构的话,还是推荐利用源码包编译方 ...

随机推荐

  1. Centos yum 命令行 安装KDE Desktop

    1:修改yum源为本地源 (见相关随笔:centos 配置本地yum源) 2:# yum groupinstall "X Window System" ← 安装基本的X系统组件# ...

  2. jsonify

    在flask中通过响应,将json数据显示在网页中,并且将Content-Type该为application/json格式 1,第一种方法: from flask import jsonify @ap ...

  3. 怎么解决mysql 执行SQL过长问题------------?

    Could not execute JDBC batch update mysql中,in语句中参数个数是不限制的.不过对整段sql语句的长度有了限制(max_allowed_packet). 默认 ...

  4. 后台获取用户登录token 和获取前端参数方法

    //获取request请求中所有参数 Enumeration<String> names = request.getParameterNames(); HashMap<String, ...

  5. 文件内容比较difflib

    #!/usr/bin/env python#-*- coding:utf-8 -*-import difflibimport sys,osos.chdir('E:\\PythonWrok')a = o ...

  6. /etc/hosts和/etc/hostname区别

    /etc/hosts主要是ip和域名的对应 /etc/hostname主要是本地主机域名(本地主机名修改过后需要重启服务器才能生效) 如果我想在另一台linux主机里面使用域名访问上面这台主机A,只需 ...

  7. jQuery 点击后退(返回)执行函数

    <html> <head> <meta charset="UTF-8"> <meta name="viewport" ...

  8. live555 交叉编译移植到海思开发板

    本文章参考了.http://blog.csdn.net/lawishere/article/details/8182952,写了hi3518的配置说明.特此感谢 https://blog.csdn.n ...

  9. crm --- 1.admin , 展示列表 和 分页

    一.admin (创建超级用户) 1.注册: 1.创建一个超级管理员,使用如下命令: python manage.py createsuperuser 2.输入打算使用的登录名: username:m ...

  10. ubuntu拒绝root用户ssh远程登录解决办法

    ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录,解决办法就是:修改ssh配置,然后重启ssh服务即可. vi /etc/ssh/sshd_config 找到并用#注 ...