centos+gitlab+mysql_centos7安装配置gitlab(使用外部nginx)
1、安装依赖:
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 firewall-cmd –permanent –add-service=http
sudo systemctl reload firewalld
2、添加gitlab源:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3、安装gitlab-ce
sudo yum install gitlab-ce
如果您不喜欢通过管道脚本安装存储库,您可以在这里找到整个脚本并手动选择并下载包并使用:
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/download
rpm -i gitlab-ce-XXX.rpm
4、配置gitlab:
sudo gitlab-ctl reconfigure
至此gitlab安装成功,默认用户名为root。
5、停止gitlab自带的nginx
打开文件$sudo vi /etc/gitlab/gitlab.rb。
将nginx[‘enable’] = ture改为nginx[‘enable’] = false
重启gitlab:sudo gitlab-ctl reconfigure。
6、修改gitlab域名:
打开/etc/gitlab/gitlab.rb文件,将external_url参数修改为自己的域名。
7、添加外部nginx的gitlab配置文件:
vim /etc/nginx/conf.d/gitlab.conf
添加以下内容:
upstream gitlab {
# 7.x 版本在此位置
# server unix:/var/opt/gitlab/gitlab-rails/tmp/sockets/gitlab.socket;
# 8.0 位置
server unix://var/opt/gitlab/gitlab-rails/sockets/gitlab.socket;
}
server {
listen *:80;
server_name gitlab.xuwanqiu.com; # 请修改为你的域名
server_tokens off; # don’t show the version number, a security best practice
root /opt/gitlab/embedded/service/gitlab-rails/public;
# Increase this if you want to upload large attachments
# Or if you want to accept large git objects over http
client_max_body_size 250m;
# individual nginx logs for this gitlab vhost
access_log /var/log/gitlab/nginx/gitlab_access.log;
error_log /var/log/gitlab/nginx/gitlab_error.log;
location / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlab;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
# If you use https make sure you disable gzip compression
# to be safe against BREACH attack
proxy_read_timeout 300; # Some requests take more than 30 seconds.
proxy_connect_timeout 300; # Some requests take more than 30 seconds.
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
}
# Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
# WARNING: If you are using relative urls do remove the block below
# See config/application.rb under “Relative url support” for the list of
# other files that need to be changed for relative url support
location ~ ^/(assets)/ {
root /opt/gitlab/embedded/service/gitlab-rails/public;
# gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
}
error_page 502 /502.html;
}
参考资料:
http://blog.csdn.net/peterxiaoq/article/details/73330302
http://www.cnblogs.com/lixiuran/p/6761299.html
https://segmentfault.com/q/1010000003695935?_ea=337139
https://laravel-china.org/topics/2829/centos-7-install-gitlab-ce-community-edition-and-modify-the-default-nginx
https://about.gitlab.com/installation/#centos-7
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
http://jiankg.github.io/2015/06/12/%E5%9C%A8centos7%E4%B8%8A%E6%90%AD%E5%BB%BAgitlab%E7%9A%84%E6%AD%A3%E7%A1%AE%E5%A7%BF%E5%8A%BF/
centos+gitlab+mysql_centos7安装配置gitlab(使用外部nginx)相关推荐
- Ubuntu 20.04 安装配置 GitLab
Ubuntu 20.04 安装配置 GitLab GitLab GitLab 官网:https://about.gitlab.com/ GitLab CE 或 Community Edition 是一 ...
- CentOS 7.x安装配置
简述 VMware可以创建多个虚拟机,每个虚拟机上都可以安装各种类型的操作系统.安装方法也有很多种.下面,主要以ISO镜像安装为例,介绍CentOS 7.x的安装过程及相关的参数设置. 简述 创建虚拟 ...
- CentOS 5.5-yum安装配置LNMP
CentOS 5.5-yum安装配置LNMP [日期:2011-06-20] 来源:Linux社区 作者:fighter 一.安装所需的库文件和编译环境 yum -y install gcc ...
- linux php7 mongodb,CentOS 7下安装配置PHP7跟LAMP及MongoDB和Redis
CentOS 7下安装配置PHP7跟LAMP及MongoDB和Redis 我是想能yum就yum,所有软件的版本一直会升级,注意自己当时的版本是不是已经更新了. 首先装CentOS 7 装好cento ...
- CentOS 7.0安装配置Vsftp服务器
2019独角兽企业重金招聘Python工程师标准>>> 一.配置防火墙,开启FTP服务器需要的端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptable ...
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
2019独角兽企业重金招聘Python工程师标准>>> 准备篇: 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables -A ...
- cent mysql 配置,centos下MySQL安装配置
centos下MySQL安装配置 下载 https://dev.mysql.com/downloads/mysql/下载Linux-Generic版本 uname -a查看系统架构, 选择相应版本. ...
- Centos Denyhosts 一键安装配置脚本
Centos Denyhosts 一键安装配置脚本 一键安装denyhosts脚本并配置为常用配置.放置Linux服务器被暴力破解 由于不能上传tar文件.所以改为zip压缩. 将附件的zip压缩包解 ...
- CentOS 6.3安装配置LAMP服务器(Linux+Apache+MySQL+PHP5)
服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※ 本文档描述了如何在Linux服务器配置Apache.Mysql.PHP5 ...
最新文章
- carbon 验证时间格式_接口测试:用好“变量”,重复验证也不怕
- keepalive 原理讲解
- leetcood学习笔记-167-两数之和 II - 输入有序数组
- AE安装部署以及监测ArcEngine runtime 9.3是否安装
- mysql中merge的用法_mysql中merge表存儲引擎用法介紹
- Shell 脚本自动Telnet 并执行远端机器的脚本
- MVC 3 数据验证 Model Validation 详解
- 【GNN】图神经网络综述
- MyBatis插件开发:简单分页插件
- Android周日历可滑动可选择日期
- 拼多多Java面试题、笔试题(含答案)
- 转发:已经足够好用的IDEA社区版
- 云大计算机专业基础综合,2020云南大学计算机专业课改考408
- app运营,如何提高用户的参与度?
- rx590 黑苹果 无货_国考报名过审人数超85万,苹果iPhone 12开售排队
- python教学视频k_10个Python奇趣教程,附视频讲解+练手项目。
- Golang的单引号、双引号与反引号用法
- C语言无符号与有符号之间的比较
- Mock技术_配置json文件
- TAGE-SC-L预测器 “TAGE-SC-L Branch Predictors”(2016)
热门文章
- 1-Mybatis入门案例
- mysql view 子查询_mysql – View的SELECT包含FROM子句中的子查询
- 计算机设置成一个网络,同一个路由器上的电脑怎么设置成局域网连网打 – 手机爱问...
- MATLAB点击运行并计时没反应,MATLAB计时器对象陷阱和不良用法
- 电脑字体在哪个文件夹_在PS里如何安装字体
- 客户和顾客是一个意思吗_“啤酒度数”和“啤酒酒精度”一个意思吗?
- html字符串长度函数,最常用的20个javascript方法函数
- 三八妇女节可以应用的PSD分层模板
- 好的设计善于利用PSD模板,轻松搞定促销海报!
- 完美海报设计的4个技巧