gitlab安装各种坑

news/2024/7/5 6:27:37

架构:源码安装, 数据库用mysql,网站用nginx

坑一.nginx报错

1
2
2016/07/19 09:26:11 [crit] 3881#0: *10 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket failed (13: Permission denied) while connecting to upstream, client: 192.168.1.180, server: www.gitlab810.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket:/", host: "www.gitlab810.com"
2016/07/19 09:26:11 [error] 3881#0: *10 open() "/home/git/gitlab/public/502.html" failed (13: Permission denied), client: 192.168.1.180, server: www.gitlab810.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket/", host: "www.gitlab810.com"

这是因为我的nginx使用的是www用户运行,而/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket/用户组是git,

解决方案:把git加入www用户组,并赋予实行权限

1
2
usermod -a -G git www
chmod g+rx /home/git/

坑二:nginx配置不准确

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[root@gitlaba git]# cat /usr/local/nginx/conf/vhosts.d/gitlab.conf |grep -v '#'
upstream gitlab-workhorse {
  server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
}
server {
  listen 80 ;
  server_name www.gitlab810.com;
  server_tokens off;
  access_log  logs/gitlab_access.log;
  error_log   logs/gitlab_error.log;
  location / {
    client_max_body_size 0;
    gzip off;
    proxy_read_timeout      300;
    proxy_connect_timeout   300;
    proxy_redirect          off;
    proxy_http_version 1.1;
    proxy_set_header    Host                $http_host;
    proxy_set_header    X-Forwarded-Host    "";
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto   $scheme;
    proxy_pass http://gitlab-workhorse;
  }
  error_page 404 /404.html;
  error_page 422 /422.html;
  error_page 500 /500.html;
  error_page 502 /502.html;
  error_page 503 /503.html;
  location ~ ^/(404|422|500|502|503)\.html$ {
    root /home/git/gitlab/public;
    internal;
  }
}

注意第55行:proxy_set_header    Host                $http_host; 要修改成自己的server_name


坑三:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@gitlaba git]# vim /home/git/gitlab-shell/config.yml
---
user: git
gitlab_url: "http://www.gitlab810.com/"
http_settings:
  self_signed_cert: false
auth_file: "/home/git/.ssh/authorized_keys"
redis:
  bin: /usr/local/redis/redis-cli
  namespace: resque:gitlab
  host: 127.0.0.1
  port: 6379
log_level: INFO
audit_usernames: false

gitlab_url: "http://www.gitlab810.com/" 这一项得用标准格式,我使用www.gitlab810.com的形式就报错



本文转自 yawei555 51CTO博客,原文链接:http://blog.51cto.com/huwei555/1827678,如需转载请自行联系原作者


http://lihuaxi.xjx100.cn/news/240539.html

相关文章

1.6 INSERT语句

1.6 INSERT语句正在更新内容,请稍后

把握机缘_机缘巧合,蒙太奇训练以及我的朋友如何使自己失业

把握机缘by Wiley Jones通过威利琼斯 机缘巧合,蒙太奇训练以及我的朋友如何使自己失业 (Serendipity, training montages, and how my friend automated himself out of a job) “No one person’s Hollywood success story has anything in common with anybody e…

form表单的action提交写到js中来,同时onclick事件也写在js中来。其action也可以通过ajax来提交的。...

假如你现在还在为自己的技术担忧,假如你现在想提升自己的工资,假如你想在职场上获得更多的话语权,假如你想顺利的度过35岁这个魔咒,假如你想体验BAT的工作环境,那么现在请我们一起开启提升技术之旅吧,详情请…

51单片机编码自学_这是9个月的自学式编码看起来像什么

51单片机编码自学by Stephen Mayeux斯蒂芬马约(Stephen Mayeux) 这是9个月的自学式编码看起来像什么 (Here’s What 9 Months of Self-Taught Coding Looks Like) 只是划伤表面 (Just Scratching the Surface) Today marks 9 months since I embarked on my journey as a self…

IE8下不识别indexOf的问题

1、为Array原型添加indexOf方法(如果学过面向对象,相当于给Array类添加实例方法),方法体如下: //添加数组IndexOf方法 if (!Array.prototype.indexOf){Array.prototype.indexOf function(elt /*, from*/){var len this.length >>> 0;var from Number(arguments[1])…

配深度学习环境要注意的不多,也就

1. 使用nvcc -V命令查看cuda版本,再在官网选择对应版本的pytorch。(是的不要根据python的版本去选择pytorch指令) 2. 用conda安装pytorch可能一直有cpuonly的玄学问题。(哪怕选择的是CUDA版本的pytorch安装命令)改用pip安装。 3. torchtext不会被顺带安装&#xf…

配置Tomcat和在Eclipse中创建Web工程

配置Tomcat服务器信息:在Tomcat的安装目录下有一个conf目录,里面存放着Tomcat服务器的配置文件,其中最为核心的配置文件是server.xml,在这个文件里我们可以配置服务器的各种参数,例如超时时间、连接数量、端口配置等等…

kvm启动报错

[rootstorage ~]# virsh -c qemu:///system list error: failed to connect to the hypervisor error: Failed to connect socket to /var/run/libvirt/libvirt-sock: No such file or directory原因:libvirt未启动解决方法[rootstorage ~]# libvirtd -d [rootst…