CentOS7搭建gerrit 代码审查服务方法

2019-10-10 13:14:18王旭

2) 配置nginx: vim /usr/local/nginx/conf/nginx.conf

server {
    listen    80;
    server_name localhost;
    #charset koi8-r;
    #access_log logs/host.access.log main;
    location / {
      #root  html;
      #index index.html index.htm;
   auth_basic       "Welcome to Gerrit Code Review !";
      auth_basic_user_file  /home/gerrit/gerrit.passwd;
      proxy_pass       http://127.0.0.1:8081;
      proxy_set_header    X-Forwarded-For $remote_addr;
      proxy_set_header    Host $host;
    }


    #error_page 404       /404.html;


    # redirect server error pages to the static page /50x.html
    #
    error_page  500 502 503 504 /50x.html;
    location = /50x.html {
      root  html;
    }

启动Nginx服务:/usr/local/nginx/sbin/nginx

3)设置第一个gerrit用户的帐号和密码

touch ./review_site/etc/passwd
htpasswd -b ./review_site/etc/passwd gerrit gerrit

步骤五:测试,访问: http://192.168.0.20 ,用gerrit用户登录

以上这篇CentOS7搭建gerrit 代码审查服务方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易采站长站。