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及简单配置的更多相关文章

  1. CentOS7安装openjdk8+环境变量配置

    CentOS7安装openjdk8+环境变量配置 步骤: 使用yum命令安装openjdk yum clean yum install -y java-1.8.0-openjdk-1.8.0.212. ...

  2. CentOS7安装GitLab、汉化、邮箱配置及使用

    同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...

  3. CentOS7安装GitLab、汉化、邮箱配置及使用(转载)

    同步首发: https://www.cnblogs.com/heyonggang/p/7778203.html http://www.yuanrengu.com/index.php/20171112. ...

  4. CentOS7安装GitLab、汉化及使用

    同步首发:http://www.yuanrengu.com/index.php/20171112.html 一.GitLab简介 GitLab是利用Ruby On Rails开发的一个开源版本管理系统 ...

  5. centos7安装gitlab并汉化

    一.基础环境准备 1.安装依赖包 [root@gitlab-server ~]#yum install curl policycoreutils openssh-server openssh-clie ...

  6. CentOs7安装gitlab(转!)

    沧浪之水清兮,可以濯吾缨; 沧浪之水浊兮,可以濯吾足.                                                                         ...

  7. centos7安装gitlab与gitlab的汉化

    Gitlab概述 GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目.  GitLab拥有与Github ...

  8. 安装MariaDB和简单配置

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...

  9. Centos7安装GitLab

    GitLab CE Download Archives gitlab安装调试小记 Gitlab Free Trial GitLab搭建手记 Gitlab社区版的使用 GUI PNG Gitlab升级到 ...

随机推荐

  1. pyspark 使用时环境设置

    在脚本中导入pyspark的流程 import os import sys spark_name = os.environ.get('SPARK_HOME',None) # SPARK_HOME即sp ...

  2. SpringBoot application.properties配置参数详情

    multipart multipart.enabled 开启上传支持(默认:true) multipart.file-size-threshold: 大于该值的文件会被写到磁盘上 multipart. ...

  3. mysql 的基本命令

    引子:Excel 最简单的数据库 Mysql:属于大型数据库 一.基本命令: 启动服务: 说明: 以管理员身份运行cmd 格式: net start 服务名称 实例: net start mysql ...

  4. JavaScript 数据结构与算法之美 - 非线性表中的树、堆是干嘛用的 ?其数据结构是怎样的 ?

    1. 前言 想学好前端,先练好内功,内功不行,就算招式练的再花哨,终究成不了高手. 非线性表(树.堆),可以说是前端程序员的内功,要知其然,知其所以然. 笔者写的 JavaScript 数据结构与算法 ...

  5. 【前端开发环境】前端使用GIT管理代码仓库需要掌握的几个必备技巧和知识点总结

    1. Git的三种状态 已提交 committed 已暂存 staged 已修改 modified 2. Git的三个区域 Git仓库 是 Git 用来保存项目的元数据和对象数据库的地方. 这是 Gi ...

  6. Springboot如何打包部署项目

    原文地址 目录 前言 1. 导入插件 2.idea中快速打包 3.java –jar运行项目 4.访问项目 5.发布到服务器 前言 用心写好每一篇文章,真心对待每一个读者 文章首发地址: www.ja ...

  7. SiftingAppender logback 动态 输出 日志 到指定日志文件

    SiftingAppender https://www.mkyong.com/logging/logback-different-log-file-for-each-thread/

  8. eclipse查看一个方法被谁调用的快捷键

    我们知道,在idea中是可以通过[ctrl+鼠标左键单击]去跳到方法调用方去的,但是在eclipse中却是不行的. 三种快捷键方式 这里列出在eclipse中查看一个方法被谁调用的三种方式(快捷键). ...

  9. Neo4j 第十二篇:使用Python驱动访问Neo4j

    neo4j官方驱动支持Python语言,驱动程序主要包含Driver类型和Session类型.Driver对象包含Neo4j数据库的详细信息,包括主机url.安全验证等配置,还管理着连接池(Conne ...

  10. Logstash:处理多个input

    Logstash:处理多个input Logstash的整个pipleline分为三个部分: input插件:提取数据. 这可以来自日志文件,TCP或UDP侦听器,若干协议特定插件(如syslog或I ...