blob: 48751b761ced610d2e8af5982c378c41f3b9dcb9 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - J2EE Installation
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== Description
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -08004
5Gerrit binary distributions include a standalone Jetty servlet
6container, but are packaged as a standard WAR file to permit easy
7deployment to other existing container installations if using the
8standalone daemon is not desired.
9
10Gerrit Code Review can be installed into any J2EE servlet container,
11including popular open source containers such as Jetty or Tomcat, or
Edwin Kempinf1acbb82011-09-15 12:49:42 +020012any commercial server which supports the J2EE servlet specification.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080013
14
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080015== Installation
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080016
Edwin Kempin36c04a62018-12-10 14:13:56 +010017* Complete the link:install.html#init[site initialization] task
18 described in the standard installation documentation.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080019
David Pursehouse92463562013-06-24 10:16:28 +090020* Stop the embedded daemon that was automatically started by 'init':
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080021+
22----
23 review_site/bin/gerrit.sh stop
24----
25
Sasa Zivkov3b61df32013-02-05 17:28:40 +010026* Deploy the 'gerrit.war' file to your application server.
27+
28The deployment process differs between servers, but typically this
29can be accomplished by copying 'gerrit.war' into the 'webapps/'
30subdirectory of the container's installation.
31
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080032* ('Optional') Install Bouncy Castle Crypto API
33+
34If you enabled Bouncy Castle Crypto during 'init', copy the JAR
35from `'$site_path'/lib` into your servlet container's extensions
David Pursehouse221d4f62012-06-08 17:38:08 +090036directory so it's available to Gerrit Code Review.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080037
Sasa Zivkove5fc90e2013-05-10 15:12:13 +020038* ('Optional') link:config-auto-site-initialization.html[
39Configure Automatic Site Initialization on Startup]
40
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080041
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080042== Jetty 7.x
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080043These directions will configure Gerrit as the default web
44application, allowing URLs like `http://example.com/4543` to jump
45directly to change 4543.
46
47Download and unzip a release version of Jetty. From here on we
48call the unpacked directory `$JETTY_HOME`.
49
50* link:http://www.eclipse.org/jetty/downloads.php[Jetty Downloads]
51
52If this is a fresh installation of Jetty, move into the installation
53directory and do some cleanup to remove the sample webapps:
54----
55 cd $JETTY_HOME
56 rm -rf contexts/* webapps/*
57----
58
59Copy Gerrit Code Review into the deployment:
60----
61 cp ~/gerrit.war webapps/gerrit.war
62 java -jar webapps/gerrit.war cat extra/jetty7/gerrit.xml >contexts/gerrit.xml
63----
64
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080065Edit `'$JETTY_HOME'/contexts/gerrit.xml` to correctly configure
Edwin Kempin36c04a62018-12-10 14:13:56 +010066outgoing SMTP connections.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080067
68If OpenID authentication (or certain enterprise single-sign-on
69solutions) is being used, you may need to increase the
70header buffer size parameter, due to very long header lines
71being used by the OpenID authentication handshake process.
72Add the following to `'$JETTY_HOME'/etc/jetty.xml` under
73`org.eclipse.jetty.server.nio.SelectChannelConnector`:
74
75----
76 <Set name="headerBufferSize">16384</Set>
77----
78
79To start automatically when the system boots, create a start
80script and modify it for your configuration:
81
82----
Kyle Laker839edfc2013-03-08 01:05:10 -050083 java -jar webapps/gerrit.war --cat extra/jetty7/gerrit-jetty.sh >/etc/init.d/gerrit-jetty
84 vi /etc/init.d/gerrit-jetty
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080085----
86
87[TIP]
David Ostrovsky33295292016-03-15 12:17:35 +010088Under Jetty, restarting the web application is as simple as
89touching the context config file: `'$JETTY_HOME'/contexts/gerrit.xml`
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080090
David Pursehouse7eaea572014-10-21 11:02:29 +090091[[tomcat]]
David Ostrovskyd0c9a7b2014-04-27 11:27:50 +020092== Tomcat 7.x
93
David Pursehouse7eaea572014-10-21 11:02:29 +090094If a reverse proxy is used in front of Tomcat then see the
95link:config-reverseproxy.html[configuration instructions for encoding
96slashes]. Otherwise Tomcat must be configured to encode slashes, by adding
97`-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true` to the
98`CATALINA_OPTS` environment variable.
99
100Excerpt from the
101link:https://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html[
102documentation]:
David Ostrovskyd0c9a7b2014-04-27 11:27:50 +0200103
104----
105Property org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH:
106If this is true '%2F' and '%5C' will be permitted as path delimiters.
107If not specified, the default value of false will be used.
108----
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -0800109
110GERRIT
111------
112Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700113
114SEARCHBOX
115---------