This article will detail how to install and configure the Gerrit server in a brand new Ubuntu system. 1. install Ubuntu12.xx (I am using 12.10, other versions are not tested) 2. configure the java environment to download the jdk-6u34-linux-x64.bin (Baidu google), execute the installation in the terminal (if there is no permission, execute chmoda + xjdk-6u34-linux-x64.bin) $ :. jdk-6u34
This article will detail how to install and configure the Gerrit server in a brand new Ubuntu system.
1. Install Ubuntu12.xx (I am using 12.10, other versions are not tested)
2. Configure the java environment
Download the jdk-6u34-linux-x64.bin (Baidu google), run the installation in the terminal (if there is no permission, execute chmod a + x jdk-6u34-linux-x64.bin)
$:./Jdk-6u34-linux-x64.bin
The installation is automatically executed. After installation, configure related environment variables
$: Vim ~ /. Bashrc
Add the following environment variable: (username is your user name)
JAVA_HOME =/home/username/jdk1.6.0 _ 34
Export JRE_HOME = $ JAVA_HOME/jre
Export CLASSPATH = $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH
$: Source ~ /. Bashrc
Verify whether the configuration is successful:
$: Java-version
$: Javac
If no error is returned for the above terminal commands and the normal version information and help information are available, the JAVA environment configuration is successful and you can continue. If any error occurs, Baidu and google.
3. Configure Gerrit. xxx. war
Open the terminal, go to the directory where gerrit. xxx. war is located, and run:
$: Java-jar gerrit. xxx. war init-d review_site
Create '/home/username/review_site' [Y/n]?
...
Basically, you can press enter all the way. The default configuration is good. One thing you need to talk about is the authentication method OPENID. OPENID can be used to log on to google or yahoo Mail, but in some cases due to GFW, these may be difficult to use, so you can select http (recommended ). The managed database type varies from person to person. The default value is H2.
After the configuration is complete, the gerrit. sh script will be automatically called to start the gerrit service and the browser will be opened automatically. At this time, it must fail because apache2.
Before configuring apache2, you must make minor changes to the gerrit configuration file, which is review_site/etc/gerrit. config.
Change canonicalWebUrl under field [gerrit] To https: // 127.0.0.1: 8081/
Change listenUrl under field [httpd] to proxy-https: // 127.0.0.1: 8081/
Save it.