zoukankan      html  css  js  c++  java
  • gitlab安装

    一、添加清华源

    cat>>/etc/yum.repos.d/gitlab-ce.repo<<EOF
    [gitlab-ce]
    name=gitlab-ce
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
    repo_gpgcheck=0
    gpgcheck=0
    enabled=1
    gpgkey=https://packages.gitlab.com/gpg.key
    EOF

    二、更新本地yum缓存,下载gitlab

    yum makecache
    
    yum install gitlab-ce -y
    

     

    三、修改配置文件

    vim /etc/gitlab/gitlab.rb
    external_url 'http://10.0.0.120'  ##改这一行
    gitlab-ctl reconfigure
    

      

    四、自己编译的nginx配置

    upstream gitlab {
        server unix:///var/opt/gitlab/gitlab-workhorse/socket;
    }
    server
      {
        listen       80;
        server_name  testgit.168p2p.com;
         server_tokens off;
        root /opt/gitlab/embedded/service/gitlab-rails/public;
        access_log /var/log/gitlab/nginx/gitlab_access.log;
        error_log /var/log/gitlab/nginx/gitlab_error.log;
        location / {
             try_files $uri $uri/index.html $uri.html @gitlab;
        }
        location @gitlab {
     
           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;
                 }
        location ~ ^/(assets)/ {
         root /opt/gitlab/embedded/service/gitlab-rails/public;
         expires max;
        add_header Cache-Control public;
         }
     
          error_page 502 /502.html;
          }
    

      

    五、根据日志授权

    chmod 755  /var/opt/gitlab/gitlab-workhorse/ 

  • 相关阅读:
    StrBlobPtr类——weak_ptr访问vector元素
    StrBlob类——智能指针作为成员
    关于智能指针类型shared_ptr的计数问题
    桌面计算器——可调用对象练习
    union
    虚析构函数
    条款04 确定对象被使用前已先被初始化
    条款03 尽可能使用const
    Bugku-CTF之web8(txt????)
    Bugku-CTF之各种绕过
  • 原文地址:https://www.cnblogs.com/zhangb8042/p/9177486.html
Copyright © 2011-2022 走看看