centos7 安装gitlab及简单配置
1.安装
wget -O gitlab.rpm https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.11.3-ce.0.el7.x86_64.rpm/download.rpm
rpm -ivh gitlab.rpm
Gitlab目录
/opt/gitlab #主目录
/etc/gitlab #配置文件目录
/var/log/gitlab #日志目录
安装的同时,还会安装
Packages and dependencies.
Ruby.
Go.
Node.
System users.
Database.
Redis.
GitLab.
NGINX.
启动命令
#启动
gitlab-ctl reconfigure && gitlab-ctl start
#重启
gitlab-ctl reconfigure && gitlab-ctl restart
#查看状态
gitlab-ctl status
2.修改配置
vim /etc/gitlab/gitlab.rb
#external_url
external_url 'http://ip:10000'
#nginx的监听端口,访问要加上
nginx['listen_port'] = 10000
3.访问
用刚刚配置的端口访问即可
4.其他
4.1Nginx配置目录
/var/opt/gitlab/nginx/conf
按上面的配置,gitlab-http.conf的配置为
server {
listen *:10000;
server_name 10.130.97.94;
server_tokens off; ## Don't show the nginx version number, a security best practice
## Increase this if you want to upload large attachments
## Or if you want to accept large git objects over http
client_max_body_size 0;
## Real IP Module Config
## http://nginx.org/en/docs/http/ngx_http_realip_module.html
## HSTS Config
## https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/
add_header Strict-Transport-Security "max-age=31536000";
add_header Referrer-Policy strict-origin-when-cross-origin;
## Individual nginx logs for this GitLab vhost
access_log /var/log/gitlab/nginx/gitlab_access.log gitlab_access;
error_log /var/log/gitlab/nginx/gitlab_error.log;
if ($http_host = "") {
set $http_host_with_default "10.130.97.94:10000";
}
if ($http_host != "") {
set $http_host_with_default $http_host;
}
gzip on;
gzip_static on;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_vary on;
gzip_disable "msie6";
gzip_min_length 10240;
gzip_proxied no-cache no-store private expired auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml application/rss+xml;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 3600;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $http_host_with_default;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Proto http;
location ~ (.git/git-receive-pack$|.git/info/refs?service=git-receive-pack$|.git/gitlab-lfs/objects|.git/info/lfs/objects/batch$) {
proxy_cache off;
proxy_pass http://gitlab-workhorse;
proxy_request_buffering off;
}
location / {
proxy_cache off;
proxy_pass http://gitlab-workhorse;
}
location /assets {
proxy_cache gitlab;
proxy_pass http://gitlab-workhorse;
}
error_page 404 /404.html;
error_page 500 /500.html;
error_page 502 /502.html;
location ~ ^/(404|500|502)(-custom)?\.html$ {
root /opt/gitlab/embedded/service/gitlab-rails/public;
internal;
}
}
其中,请求会被发到gitlab-workhorse
location / {
proxy_cache off;
proxy_pass http://gitlab-workhorse;
}
gitlab-workhorse其实是在nginx.conf
upstream gitlab-workhorse {
server unix:/var/opt/gitlab/gitlab-workhorse/socket;
}
4.2常用命令
gitlab-ctl start #启动全部服务
gitlab-ctl restart #重启全部服务
gitlab-ctl stop #停止全部服务
gitlab-ctl restart nginx #重启单个服务
gitlab-ctl status #查看全部组件的状态
gitlab-ctl show-config #验证配置文件
gitlab-ctl uninstall #删除gitlab(保留数据)
gitlab-ctl cleanse #删除所有数据,重新开始
gitlab-ctl tail <svc_name> #查看服务的日志
gitlab-rails console production #进入控制台 ,可以修改root 的密码
4.3推荐链接
官方文档 https://gitlab.com/gitlab-org/gitlab-foss/blob/master/doc/install/installation.md
https://www.cnblogs.com/ssgeek/p/9328758.html
https://www.jianshu.com/p/8c02c3887889
centos7 安装gitlab及简单配置的更多相关文章
- CentOS7安装openjdk8+环境变量配置
CentOS7安装openjdk8+环境变量配置 步骤: 使用yum命令安装openjdk yum clean yum install -y java-1.8.0-openjdk-1.8.0.212. ...
- CentOS7安装GitLab、汉化、邮箱配置及使用
同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...
- CentOS7安装GitLab、汉化、邮箱配置及使用(转载)
同步首发: https://www.cnblogs.com/heyonggang/p/7778203.html http://www.yuanrengu.com/index.php/20171112. ...
- CentOS7安装GitLab、汉化及使用
同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...
- centos7安装gitlab并汉化
一.基础环境准备 1.安装依赖包 [root@gitlab-server ~]#yum install curl policycoreutils openssh-server openssh-clie ...
- CentOs7安装gitlab(转!)
沧浪之水清兮,可以濯吾缨; 沧浪之水浊兮,可以濯吾足. ...
- centos7安装gitlab与gitlab的汉化
Gitlab概述 GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. GitLab拥有与Github ...
- 安装MariaDB和简单配置
1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...
- Centos7安装GitLab
GitLab CE Download Archives gitlab安装调试小记 Gitlab Free Trial GitLab搭建手记 Gitlab社区版的使用 GUI PNG Gitlab升级到 ...
随机推荐
- 精选傻X错误 && 自己的套路
声明 参考课件由Accelerator汇编 1. 随手注意的细节 你写的main 真的是 main 么? 在无向图或者网络流找反向边的时候,编号 \(xor 1\) 的前提是,你的第一条边编号是 2或 ...
- blue bossa
blue bossa
- luoguP1791 [国家集训队]人员雇佣
题意 考虑先将所有价值加上,之后用最小割求最小代价. 考虑每个点对\((i,j)\),我们这样建边: 1.源点向每个点i连\(\sum\limits E_{i,j}\)容量的边. 2.每个点向汇点连雇 ...
- luoguP4774 [NOI2018]屠龙勇士
题意 考虑杀每只龙\(i\)时候用的剑是一定的,我们可以用multiset模拟一遍得到,设为\(b_i\). 发现我们要求一个\(x\)满足对每个\(i\)有:\(b_i*x\equiv a_i\pm ...
- windows上安装python和python开发工具
一.python安装: 登录python官网,下载需要的安装包:https://www.python.org/downloads/windows/.,一般就下载 executable installe ...
- ABP AOP 用例
介绍 在本文中,我将向您展示如何创建拦截器来实现AOP技术.我将使用ASP.NET Boilerplate(ABP)作为基础应用程序框架和Castle Windsor作为拦截库.这里描述的大多数技术对 ...
- resharper 8.2
用户名:ronle注册码:ZoJzmeVBoAv9Sskw76emgksMMFiLn4NM
- 腾讯微视:向前一步是悲壮,向后一步是绝望zz
“换做以往的任何一场战争,微博之战.搜索之战和电商之战——大量投入但始终不见效果,打到现在腾讯肯定已经交牌了.微视的不同之处在于,它有些悲壮,因为这是腾讯最不想交出的一张牌.” 文 | <财经& ...
- Linux shell自动读mongo数据、远程获取文件大小示例脚本
1.示例1 功能:对mongoDB导出数据,根据sid的不同状态进行统计 技术点:shell bash 读写文件.字符串截取.函数.用多个文件提到的map.grep查找并赋值给变量 #!/bin/b ...
- Uboot启动流程分析(三)
1.前言 在前面的文章Uboot启动流程分析(二)中,链接如下: https://www.cnblogs.com/Cqlismy/p/12002764.html 已经对_main函数的整个大体调用流程 ...