2020-06-11 21:30:57
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 http://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3、安装gitlab-ce
sudo yum install gitlab-ce
如果您不喜欢通过管道脚本安装存储库,您可以在这里找到整个脚本并手动选择并下载包并使用:
curl -LJO http://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 http 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
http://segmentfault.com/q/1010000003695935?_ea=337139
http://laravel-china.org/topics/2829/centos-7-install-gitlab-ce-community-edition-and-modify-the-default-nginx
http://about.gitlab.com/installation/#centos-7
http://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/
docker安装部署gitlab 配置使用部外nginx
04-14
centos7.3下配置LAMP部署WordPress博客
07-04
Virtualbox的centos7 nat和桥接网络配置
05-07
CentOS-5 yum安装nginx php53 mysql55 lnmp环境
04-18
saltstack快速批量安装nginx
07-16
centos7.1 LVS健康检查bash脚本
06-26
nginx编译安装动态模块(不需重新编译nginx)
06-25
使用nginx ngx_http_referer_module模块配置防盗链
06-28
使用Docker或者docker-compose搭建gitlab
04-27
Debian 7 (Wheezy)安装配置Apache mod_fastcgi PHP-FPM
07-20
Docker安装配置tomcat jdk
06-21
TR260 G2服务器内存DIMM安装配置和内存插的槽分布
06-23
centos 7 yum安装配置apache 2.4
07-15
docker部署zabbix监控系统(nginx mysql)
06-28
使用nginx limit_req限制用户请求速率
06-06
使用fpm工具制作nginx的rpm包
06-26
开启nginx的gzip压缩功能,节省流量
05-28
nginx使用教程(一):下载并编译安装nginx
07-07
Ubuntu 16.04配置nginx使用GeoIP
07-12
如何在CentOS 7上安装nginx
07-05
360安全桌面 v2.8.0.1001 官方安装版
42.53M
下载3d蓝光播放器(高清3D影音播放软件) V1.8.0.4 绿色免安装版
36.8 MB
下载HofoSetup(安装程序制作软件)v8.5.4 破解版
5.7M
下载Virtual CloneDrive V5.4.4.0 汉化纯净安装版
1.6MB
下载editplus3中文版 (附安装教程) v3.41
1.41M
下载h3c模拟器(网络虚拟环境配置工具) 1.5.2 正式版
59.1M
下载usb3.0驱动(硬件驱动安装工具) v6.6 绿色版
8.67MB
下载和平网络电视 v2.9.9.9 官方安装版
4.2M
下载矮人DOS工具箱 V5.3 Bulid 6.713 安装版
9.01M
下载硬盘安装器下载
17.35 MB
下载驱动总裁最新绿色免安装版 2.6.0.0 最新版
287.73M
下载黄山IE修复专家 v9.0 官方安装版
4.44MB
下载autocad2014(cad设计软件) 免费版
1505.28MB
下载pkpm2010破解版下载
1.56GB
下载xlive下载
21.3MB
下载系统之家一键重装系统下载
28.4M
下载