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的管理,如果是多实例或者是复杂的一些架构的话,还是推荐利用源码包编译方 ...
随机推荐
- 2017-2018 ACM-ICPC, NEERC A题Automatic Door 挺棘手的模拟
题目链接:http://codeforces.com/contest/883/problem/A 题意大致就是有一个门,有n个人有规律的来,时刻分别是a,2a,3a.....na.有m个人无规律的来, ...
- linux下GCC编译文件
Linux终端使用技巧: Ctrl+Alt+T打开终端 Ctrl+c死循环退出程序 Shift+Ctrl+T:新建标签页 Shift+Ctrl+N:新建窗口 Shift+Ctrl+Q:关闭终端 终端中 ...
- c# 如何 使用共用体
用起来真的方便 转摘如下: C#借助FieldOffset属性实现共用体与强制类型转换 这两天被C#的强制类型转换弄得有点不习惯.事出如此. 在C#中,我打算读二进制文.文件的结构很简单,一连串的紧密 ...
- C++中多维数组传递参数
在c++自定义函数时我们有时需要传递参数,有时以多维数组作为参数,这里就遇到了多维数组该怎么传值的问题了,首先我们看看一维数组是怎么做的. void print_num(int num[], int ...
- configparse模块和hashlib模块
# import configparser # # config = configparser.ConfigParser() #config = {} # config['DEFAULT'] = {' ...
- Arch Linux 的休眠设置
https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate_(简体中文)https://wiki.archl ...
- linux4.15.1编译init/mounts报错
AR init/mounts.o arm-linux-ar: illegal option -- T Usage: arm-linux-ar [emulation options] [-]{dmpqr ...
- SpringAOP 注解方式
Spring-service-mvc.xml <context:component-scan base-package="com.restful.controller,com.rest ...
- PythonStudy——列表类型 List type
# 1.定义 ls = [3, 1, 2] # 语法糖 | 笑笑语法 print(ls) ls = list([3, 1, 2]) # 本质 print(ls) # 嵌套 ls = [3, 1, [3 ...
- PythonStudy——运算符优先级 Operator precedence
运算符优先级 以下所列优先级顺序按照从低到高优先级的顺序:同行为相同优先级. 1 Lambda #运算优先级最低 2 逻辑运算符: or 3 逻辑运算符: and 4 逻辑运算符:not 5 成员测试 ...