CentOS7下安装Gitlab社区版【安装步骤、IP改域名、修改端口】
这两天一直在给公司的服务器配置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改域名、修改端口】的更多相关文章
- Gitlab 社区版安装部署和维护指南
因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.这篇文章是在 Gitlab 7.4 的环境下配置的,相关内容可能已经过时. 后续做了一次迁移,将 Gitlab 升级到了 ...
- win10 Ubuntu子系统安装&odoo10社区版安装
参考文档: http://www.cnblogs.com/odoouse/p/5995603.html https://www.jianshu.com/p/58090215bda8 一.win10 U ...
- 【Git】 GitLab服务器社区版安装与配置
GitLab简介 GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务 GitLab系统架构 当~git在图片中引用时,它表示git用户的主目录 ...
- centos7上安装docker-ce社区版
报错:Error: docker-ce-selinux conflicts with 2:container-selinux-2.12-2.gite7096ce.el7.noarch 转载:http: ...
- Centos7下PHP的卸载与安装nginx
Centos7下PHP的卸载与安装nginx CentOS上PHP完全卸载,想把PHP卸载干净,直接用yum的remove命令是不行的,需要查看有多少rpm包,然后按照依赖顺序逐一卸载. 1.首先查看 ...
- Gitlab - 安装的社区版 Gitlab-ce,解决访问网页报502-Whoops, GitLab is taking too much time to respond的问题
问题背景 在自己虚拟机(centos7)上装了 Gitlab-ce,就是社区版的 Gitlab,版本是 13.0+ 问题描述 浏览器访问 Gitlab 网站,报 502 问题翻译 502-Whoops ...
- centos7上安装docker社区版
container(容器) docker(集装箱) 容器的优点 1. 启动速度快 2. 节省资源 3. 兼容性高 保证机器正常上网 #ping www.baidu.com CPU需要支持虚拟化 # g ...
- OpenAcc社区版安装教程(Linux版)(更新版)
官方安装过程如下图所示 1.安装前 下载OpenAcc社区版 1,目前为止的最新版,平台是Linux,选择Linux x86-64. 我的服务器系统是CentOs 下载地址链接:https://www ...
- yum install mysql-community-server yum方式安装mysql(社区版实操)
前言:rpm方式或者这种yum安装时比较简单的方式,但是不推荐,但是确实很着急的话,可以采用这种安装这种方式不利于后续对mysql的管理,如果是多实例或者是复杂的一些架构的话,还是推荐利用源码包编译方 ...
随机推荐
- python rtree包查找三维空间下的最近设备
rtree模块有2个常用的类:rtree.index.Index和rtree.index.Property.其中rtree.index.Index用于进行数据操作,rtree.index.Proper ...
- Arch Linux 独特的包管理器相关名词解释及用法对照
https://wiki.archlinux.org/index.php/PacmanPacman包管理器是Arch Linux的主要特色之一.它结合了简单的二进制包格式和易于使用的构建系统.pacm ...
- groovy学习知识
(1)Groovy是一种基于JVM的敏捷开发语言,它结合了Python.Ruby和Smalltalk的许多强大的特性,Groovy 代码能够与 Java 代码很好地结合,也能用于扩展现有代码.它是一种 ...
- Spring各个jar包作用
Spring AOP:Spring的面向切面编程,提供AOP(面向切面编程)的实现Spring Aspects:Spring提供的对AspectJ框架的整合Spring Beans:Spring IO ...
- utf-8mb4和排序规则
MySQL在5.5.3之后增加了这个utf8mb4的编码,mb4就是most bytes 4的意思,专门用来兼容四字节的unicode. 最新的 UTF-8 规范只使用一到四个字节,最大能编码21位, ...
- docker push到私有仓库
1.登录 docker login http://xxxxx.com 2.登录私有hub创建项目 例如项目叫:abc-dev 2.给镜像打tag docker tag 2e25d8496557 xxx ...
- delphi 下载
最新(更多)内容,请到 http://www.cnblogs.com/key-ok/p/3465486.html Borland Pascal v7.1 (13.89 Mb) Delphi 1 ...
- sequelize的mssql配置
配置文件 development: { username: process.env.LOCAL_USERNAME, password: process.env.LOCAL_PASSWORD, data ...
- centos 7中监控mysql 数据库脚本(监控端口)
centos 7中监控mysql 数据库脚本(监控端口) 监控mysql数据库的方法如下: 1.监控端口 netstat -nltp |grep 3306 2.监控进程 ps -ef |grep 33 ...
- Python日志模块logging&JSON
日志模块的用法 json部分 先开一段测试代码:注意 str可以直接处理字典 eval可以直接将字符串转成字典的形式 dic={'key1':'value1','key2':'value2'} ...