본문 바로가기

아카이브/삽질노트

gerrit 재설치

반응형

1편에서 세팅을 완료하고 nginx 프록시 세팅을 통해 gerrit 페이지가 잘 뜨는건 확인하였지만 이메일 등록에서 막혀버림..


에러로그는 크게 두가지였는데.. 1. 입력한 smtp 서버 인증에 실패하였다.  2. smtp ok, but parse error?? 


기존 설치를 지우고 (추가로 깔았던 sendmail 도 필요 없었다) 최신 버전으로 재 설치&설정 몇가지 변경을 통해 메일 인증에 성공하였다. (페이지 ui도 조금 바뀌었음)


우선 최신버전으로 깔고 나서 gerrit_path/bin/gerrit.sh 을 구동시키면 나오던 워닝과 에러 로그도 사라졌는데 이유는 잘 모르겠다.. 아마 최신 버전이 아닌 gerrit + 설치 과정에서 추가 플러그인 호환이 잘 안되었던 걸까..



아무튼, 설치 옵션은 1편과 동일하되 최종 설치 후에 config 를 남겨 놓는다. 



#gerrit_path/etc/gerrit.config

[gerrit]

        basePath = git

        serverId = 250ace9c-e2a3-499a-bebf-56557631929f

        canonicalWebUrl = http://server_ip_installed_gerrit/gerrit/

[database]

        type = mysql

        hostname = server_ip_installed_gerrit

        database = gerritdb

        username = root

[auth]

        type = HTTP

[receive]

        enableSignedPush = false

[sendemail]

        smtpServer = smtp.gmail.com

        smtpServerPort = 465

        smtpUser = chirichidi (execpting under @~~)

        smtpEncryption = ssl

[container]

        user = root

        javaHome = /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64/jre

[sshd]

        listenAddress = *:29418

[httpd]

        listenUrl = proxy-http://*:8082/gerrit/    //nginx 프록시에서 gerrit 이 running 하고 있는 8082 로 요청을 던진다.

[cache]

        directory = cache





#gerrit_path/etc/secure.config
[auth]
        registerEmailPrivateKey = sdghshaigyoaigialghsgosdgois=
[sendemail]
        smtpPass = "mail_password"



#/etc/nginx/nginx.conf
user  nginx;
worker_processes  2;

error_log  /game/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    multi_accept off;
    use epoll;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"'
                           '$request_time $upstream_response_time';
    log_not_found on;

    access_log          /game/log/nginx/access.log  main;
    client_body_buffer_size 64K;
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    server_tokens   off;
    gzip            on;
    gzip_static     on;
    gzip_comp_level 5;
    gzip_min_length 1024;
    keepalive_timeout  0;
    fastcgi_buffer_size 16k;
    fastcgi_buffers     128 16k;
    limit_conn_zone     $binary_remote_addr     zone=addr:10m;

    include ./conf.d/*.conf;
}


#/etc/nginx/conf.d/webserver.conf
server {
            listen                          80;
            server_name                 my_ip;

            charset                         utf-8;

            location / {
                    root                    /game/public_html;
                    index                   index.html index.htm;
            }

            error_page  404         /404.html;

            location = /404.html {
                    root                    /usr/share/nginx/html;


            location = /php-status {
                    access_log              off;
                    fastcgi_pass    unix:/dev/shm/php5-fpm.sock;
                    fastcgi_param   SCRIPT_FILENAME /php-status;
                    include                 fastcgi_params;
            }

            location = /server-alive {
                    access_log              off;
                    fastcgi_pass    unix:/dev/shm/php5-fpm.sock;
                    fastcgi_param   SCRIPT_FILENAME /server-alive;
                    include                 fastcgi_params;
            }

            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                    root                    /usr/share/nginx/html;
            }

            location ~ \.php$ {
                    root            /game/public_html;
                    fastcgi_pass    unix:/dev/shm/php5-fpm.sock;
                    fastcgi_index   index.php;
                    fastcgi_param   SCRIPT_FILENAME /game/public_html$fastcgi_script_name;
                    include         fastcgi_params;
            }

            location ^~ /xhprof_html/ {

                    root /var/www/html/xhprof/xhprof_html/;
                    include fastcgi_params;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME /var/www/html/xhprof/xhprof_html$fastcgi_script_name;
                    fastcgi_pass unix:/dev/shm/php5-fpm.sock;

                    location ~ ^.*\.(css|js|gif)$ {}
            }


 location ^~ /gerrit/ {
                    proxy_pass        http://localhost:8090/gerrit/;
                    proxy_set_header  X-Forwarded-For $remote_addr;
                    proxy_set_header  Host $host;
            }
}


#/etc/nginx/conf.d/gerrit.conf

server {

            listen                          8090;


            charset                         utf-8;


            auth_basic "Private Property";                                //gerrit 사용시에 필요한 basic_auth 등록한 파일 

            auth_basic_user_file /etc/nginx/.htpasswd;


            location / {


            }


            location ^~ /gerrit/ {

                    proxy_pass        http://localhost:8082/gerrit/;        //여기서 gerrit listening port 로 던진다

                    proxy_set_header  X-Forwarded-For $remote_addr;

                    proxy_set_header  Host $host;

            }


            error_page  404         /404.html;


            location = /404.html {

                    root                    /usr/share/nginx/html;

            }


            error_page   500 502 503 504  /50x.html;

            location = /50x.html {

                    root                    /usr/share/nginx/html;

            }

    }


반응형

'아카이브 > 삽질노트' 카테고리의 다른 글

Line Messaging API 사용  (0) 2017.06.26
코드 리뷰 도구; gerrit (기본 설치)  (1) 2016.09.23