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