In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces CentOS7 how to build gerrit code review service, the article is very detailed, has a certain reference value, interested friends must read it!
Step 1: create a dedicated account and working directory
Adduser gerrit;passwd gerrit; creates a dedicated working directory for gerrit: mkdir / home/gerrit
Step 2: configure the Java environment
1) download JDK: http://download.oracle.com/otn-pub/java/jdk-nb/8u161-8.2/jdk-8u161-nb-8_2-linux-x64.sh from the official website
2) add the execute permission chmod aquix jdk-8u161-nb-8_2-linux-x64.sh, and then run the script to install
3) set the environment variable and edit the / etc/profile or ~ / .bashrc file to add the following configuration at the end of the file
Export JAVA_HOME=/usr/local/jdk1.8.0_161export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=$JAVA_HOME/libexport PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$CLASSPATH
4) Test the Java environment. Enter: java-version at the terminal to check whether the version information is displayed normally. If so, the installation is successful.
Step 3: download and install gerrit
1) download gerrit from the official website: http://code.google.com/p/gerrit/ is stored in the / home/gerrit directory
2) install gerrit: java-jar gerrit-full-2.5.2.war init-d review_site, enter all the way, default installation
3) modify the gerrit configuration file as follows:
[gerrit] basePath = git/ / specify the location of all git libraries managed by gerrit, that is, review_site_project/git/ canonicalWebUrl = http://192.168.0.20:8081/ specify the URL where web accesses gerrit / / fill in your own ip and port number [database] type = h3 / / specify the default database type of gerrit. You can choose mysql. Install and create a gerrit account database = db/ReviewDB [auth] type = HTTP / / specify the authentication method when the browser logs in to gerrit [sendemail] enable = true smtpServer = smtp.126.com smtpServerPort = 25 smtpUser = xxx@126.com smtpPass = xxx sslVerify = false from = CodeReview [container] user = gerritserver / / the user identity of the machine where gerrit is located corresponds to the user created above To javaHome = / usr/lib/jvm/jdk7/jre / / the system itself comes with [sshd] listenAddress = *: 29418 / / specify the port number that the sshd service listens to [httpd] listenUrl = http://*:8081/project / / specify the http proxy address [cache] directory = cache / / cache location
4) start the gerrit service: review_site/bin/gerrit.sh start | stop | restart
If prompted with the following error: * * ERROR: GERRIT_SITE not set
You can modify it as follows: vim gerrit.sh
After the GERRIT_SITE variable is assigned, add the following line to change the value of the variable.
GERRIT_SITE=/home/gerrit/review_site
5) Boot: ln-snf / home/gerrit/review_site/bin/gerrit.sh / etc/init.d/gerrit.sh
Step 4: configure reverse proxy service (Nginx)
1) install Nginx reverse proxy server
Install gcc: yum install gcc-c++
Install PCRE: yum install-y pcre pcre-devel
Install zlib: yum install-y zlib zlib-devel
Install openssl: yum install-y openssl openssl-devel
Download nginx: https://nginx.org/en/download.html
Install Nginx:tar-xzvf nginx-1.13.7.tar.gz; cd nginx-1.13.7;./configure; make; make install
Boot: add a line / usr/local/nginx/sbin/nginx at the end of the vi / etc/rc.local file
2) configure 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 500502 503 504 / 50x.html; location = / 50x.html {root html;}
Start the Nginx service: / usr/local/nginx/sbin/nginx
3) set the account number and password of the first gerrit user
Touch. / review_site/etc/passwdhtpasswd-b. / review_site/etc/passwd gerrit gerrit
Step 5: test, visit: http://192.168.0.20, login with gerrit user
The above is all the contents of the article "how to build gerrit Code Review Service for CentOS7". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.