这两天一直在给公司的服务器配置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. Python之DataFrame常用方法小结

    https://blog.csdn.net/a786150017/article/details/78573055

  2. scrapy中selenium的应用

    引入 在通过scrapy框架进行某些网站数据爬取的时候,往往会碰到页面动态数据加载的情况发生,如果直接使用scrapy对其url发请求,是绝对获取不到那部分动态加载出来的数据值.但是通过观察我们会发现 ...

  3. 转发 C# Win32 API程序控制鼠标的操作

    命名空间:using System.Runtime.InteropServices; 在程序中添加: [DllImport("User32")]public extern stat ...

  4. Cocos2dx利用intersectsRect函数检测碰撞

    if (sp1->boundingBox().intersectsRect(sp2->boundingBox())) { pLabel->setString(“碰撞飞机爆炸”); } ...

  5. PythonStudy——如何使输出不换行

    python 3.x版本打印不换行格式如下: print(x, end="") # end="" 可使输出不换行.双引号之间的内容就是结束的内容, # 可以是空 ...

  6. PHP的 preg_match_all

    语法:int preg_match_all ( string pattern, string subject, array &matches [, int flags] ) 这个函数的返回值是 ...

  7. crontab定时任务第一个周期未完成下一个周期执行就来了

    一.现象 有一个定时任务,每分钟执行一次,前一分钟还没有执行完成,下一个分钟就来了,怎么解决. 二.模拟 #!/bin/bash echo "开始 `date` " >> ...

  8. yum源搭建

    1:vim /etc/yum.repo.d/ll.repo [local]   这里不能有空格,如[local yum] name=local baseurl=file:///yum gpgcheck ...

  9. OpenLDAP主从

    yum -y install compat-openldap必须得安装这个   1:在主上       备份         cp /etc/openldap/slapd.conf /etc/open ...

  10. java-启动和关闭.exe程序

    链接: https://www.cnblogs.com/pengpengzhang/p/8675740.html https://blog.csdn.net/ZHANGHUI3239619/artic ...