blob: f6853c81b918ee90c59a9c22b0bff39118f138bd [file] [log] [blame]
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -08001Gerrit Code Review - J2EE Installation
2======================================
3
4Description
5-----------
6
7Gerrit binary distributions include a standalone Jetty servlet
8container, but are packaged as a standard WAR file to permit easy
9deployment to other existing container installations if using the
10standalone daemon is not desired.
11
12Gerrit Code Review can be installed into any J2EE servlet container,
13including popular open source containers such as Jetty or Tomcat, or
Edwin Kempinf1acbb82011-09-15 12:49:42 +020014any commercial server which supports the J2EE servlet specification.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080015
16
17Installation
18------------
19
20* Complete the link:install.html#createdb[database setup] and
21 link:install.html#init[site initialization] tasks described
22 in the standard installation documentation.
23
David Pursehouse92463562013-06-24 10:16:28 +090024* Stop the embedded daemon that was automatically started by 'init':
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080025+
26----
27 review_site/bin/gerrit.sh stop
28----
29
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080030* Configure JNDI DataSource 'jdbc/ReviewDb'.
31+
32This DataSource must point to the database you created above.
33Don't forget to ensure your JNDI configuration can load the
34necessary JDBC drivers. You may wish to ensure connection pooling
35is configured and enabled within the DataSource.
36
Sasa Zivkov3b61df32013-02-05 17:28:40 +010037* Deploy the 'gerrit.war' file to your application server.
38+
39The deployment process differs between servers, but typically this
40can be accomplished by copying 'gerrit.war' into the 'webapps/'
41subdirectory of the container's installation.
42
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080043* ('Optional') Install Bouncy Castle Crypto API
44+
45If you enabled Bouncy Castle Crypto during 'init', copy the JAR
46from `'$site_path'/lib` into your servlet container's extensions
David Pursehouse221d4f62012-06-08 17:38:08 +090047directory so it's available to Gerrit Code Review.
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080048
49
50Jetty 7.x
51---------
52These directions will configure Gerrit as the default web
53application, allowing URLs like `http://example.com/4543` to jump
54directly to change 4543.
55
56Download and unzip a release version of Jetty. From here on we
57call the unpacked directory `$JETTY_HOME`.
58
59* link:http://www.eclipse.org/jetty/downloads.php[Jetty Downloads]
60
61If this is a fresh installation of Jetty, move into the installation
62directory and do some cleanup to remove the sample webapps:
63----
64 cd $JETTY_HOME
65 rm -rf contexts/* webapps/*
66----
67
68Copy Gerrit Code Review into the deployment:
69----
70 cp ~/gerrit.war webapps/gerrit.war
71 java -jar webapps/gerrit.war cat extra/jetty7/gerrit.xml >contexts/gerrit.xml
72----
73
74Install the required additional libraries by copying them into the
75`'$JETTY_HOME'/lib/ext` directory:
76
77----
78 cp ../review_db/lib/* lib/ext/
79 java -jar webapps/gerrit.war cat lib/commons-dbcp-1.2.2.jar >lib/ext/commons-dbcp-1.2.2.jar
Shawn O. Pearce0b43ad12010-04-12 08:10:42 -070080 java -jar webapps/gerrit.war cat lib/commons-pool-1.5.4.jar >lib/ext/commons-pool-1.5.4.jar
81 java -jar webapps/gerrit.war cat lib/h2-1.2.128.jar >lib/ext/h2-1.2.128.jar
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -080082 java -jar webapps/gerrit.war cat lib/postgresql-8.4-701.jdbc4.jar >lib/ext/postgresql-8.4-701.jdbc4.jar
83----
84
85Edit `'$JETTY_HOME'/contexts/gerrit.xml` to correctly configure
86the database and outgoing SMTP connections, especially the user
87and password fields.
88
89If OpenID authentication (or certain enterprise single-sign-on
90solutions) is being used, you may need to increase the
91header buffer size parameter, due to very long header lines
92being used by the OpenID authentication handshake process.
93Add the following to `'$JETTY_HOME'/etc/jetty.xml` under
94`org.eclipse.jetty.server.nio.SelectChannelConnector`:
95
96----
97 <Set name="headerBufferSize">16384</Set>
98----
99
100To start automatically when the system boots, create a start
101script and modify it for your configuration:
102
103----
Kyle Laker839edfc2013-03-08 01:05:10 -0500104 java -jar webapps/gerrit.war --cat extra/jetty7/gerrit-jetty.sh >/etc/init.d/gerrit-jetty
105 vi /etc/init.d/gerrit-jetty
Shawn O. Pearce9ad8ba52009-12-11 19:06:21 -0800106----
107
108[TIP]
109Under Jetty, restarting the web application (e.g. after modifying
110`system_config`) is as simple as touching the context config file:
111`'$JETTY_HOME'/contexts/gerrit.xml`
112
113
114GERRIT
115------
116Part of link:index.html[Gerrit Code Review]