gerrit的配置文件:gerrit.config

[gerrit]
        basePath = git                                    #git仓库的位置
        serverId = 135fae90-5324-49fc-8cb0-b7e8e4400e6c   #gerrit服务器的serverId
        canonicalWebUrl = http://localhost:8081/          #服务器地址,后续在浏览器中通过此地址访问gerrit服务器

[gitweb]

  type=gitweb

  url = http://ip地址:8081/gitweb   #gitweb查看的链接
  cgi = /usr/lib/cgi-bin/gitweb.cgi        #gitweb为可视化代码库的一个组件,此处安装gitweb时自动产生,暂时不管。
[database]
        type = mysql         #gerrit的数据库类型 ,本人设置为mysql
        hostname = localhost #gerrit的数据库地址 ,本人设置为localhost,你可以设置ip地址
        port = 3306          #gerrit的数据库端口,本人设置为3306 ,你可以设置mysql的端口
        database = gerrit    #gerrit的数据库,本人设置为gerrit,因为我的gerrit使用的是gerrit的mysql数据库
        username = nwpushuai #gerrit的数据库管理员,本人设置为nwpushuai,因为我的gerrit使用的是gerrit的mysql数据库管理员为nwpushuai
[index]
        type = LUCENE #默认即可
[auth]
        type = HTTP #认证方式
        logoutUrl = http://nwpushuai:nwpushuai@192.168.1.100:8080/
[receive]
        enableSignedPush = false  #是否允许启用签名推送支持
[sendemail]   #注册发确认邮件配置
        smtpServer = smtp.163.com                                                #邮件配置地址
        smtpServerPort = 25                                                      #邮件配置端口
        smtpUser = ××××××××××@163.com  
        from=Code Review <××××××××××@163.com> #这行是自己加的,不然注册的时候会提示失败,这里不用写密码,密码是写在security里的另一个文件里
[container]
        user = nwpushuai                                 #目前的linux用户
        javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre #jre地址
[sshd]
        listenAddress = *:29418   #ssh服务端口,保持默认
[httpd]
        listenUrl = proxy-http://*:8081/   #监听的链接用于apache反向连接
[cache]
        directory = cache  #缓存的方式,保存默认

 

 

nginx代理:gerrit216-http.conf

server {
     listen *:8081;
     server_name localhost;
     allow   all;
     deny    all;

     auth_basic "Welcomme to Gerrit Code Review Site!";

     location / {
        proxy_pass  http://localhost:8081;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
     }
}

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐