发布时间: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/
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
pkpm2010破解版(建筑结构设计软件)附安装教程
1.56GB
和平网络电视 v2.9.9.9 官方安装版
4.2M
矮人DOS工具箱 V5.3 Bulid 6.713 安装版
9.01M
硬盘安装器(系统安装工具) 1.6.10.6 中文版
17.35 MB
系统之家一键重装系统(系统自动安装工具)12.5.48.1830 最新版
28.4M
黄山IE修复专家 v9.0 官方安装版
4.44MB
autocad2014(cad设计软件) 免费版
1505.28MB
editplus3下载
1.41M
h3c模拟器下载
59.1M
usb3.0驱动下载
8.67MB
xlive下载
21.3MB
驱动总裁下载
287.73M
2020-02-27
外接投影机或电视只有图像,没有声音
ActiveMQ基于zookeeper的主从(levelDB Master/Slave)搭建
联想智能云教室快速安装说明(Lenovo M2300)V1.0
Docker命令行参考(14) – docker attach附着到一个运行中的容器
联想D400恢复系统的方法
联想小新打印机通过USB连接方式安装本地打印机驱动方法的介绍
Ps教程:中级教学—战争类海报合成
Lenovo XClarity Administrator(LXCA)本地越权漏洞
定时执行任务Crontab的20个例子