summaryrefslogtreecommitdiffstats
path: root/docs/01_setup.mkd
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-02-09 17:13:12 -0500
committerJames Moger <james.moger@gitblit.com>2012-02-09 17:13:12 -0500
commit4b9d645571ec49e61a7ac4d0056dacf9c7b282b3 (patch)
treedddc73502f473a443a0594d66f5e9494de9a17c9 /docs/01_setup.mkd
parente7883877a98dfcae3f75f1c1a562120d89aed22a (diff)
downloadgitblit-4b9d645571ec49e61a7ac4d0056dacf9c7b282b3.tar.gz
gitblit-4b9d645571ec49e61a7ac4d0056dacf9c7b282b3.zip
Added AJP connector and some documentation on how to use it (issue 59)
Diffstat (limited to 'docs/01_setup.mkd')
-rw-r--r--docs/01_setup.mkd62
1 files changed, 62 insertions, 0 deletions
diff --git a/docs/01_setup.mkd b/docs/01_setup.mkd
index 8b5702b6..1a3b9a9c 100644
--- a/docs/01_setup.mkd
+++ b/docs/01_setup.mkd
@@ -93,6 +93,68 @@ Command-Line parameters override the values in `gitblit.properties` at runtime.
**Example**
java -jar gitblit.jar --userService c:\myrealm.config --storePassword something
+
+## Running Gitblit behind Apache
+
+Gitblit runs fine behind Apache. You may use either *mod_proxy* (GO or WAR) or *mod_proxy_ajp* (GO).
+
+Each Linux distribution may vary on the exact configuration of Apache 2.2.
+Here is a sample configuration that works on Debian 7.0 (Wheezy), your distribution may be different.
+
+1. First we need to make sure we have Apache's proxy modules available.
+<pre>
+sudo su
+cd /etc/apache2/mods-enabled
+ln -s ../mods-available/proxy.load proxy.load
+ln -s ../mods-available/proxy_balancer.load proxy_balancer.load
+ln -s ../mods-available/proxy_http.load proxy_http.load
+ln -s ../mods-available/proxy_ajp.load proxy_ajp.load
+</pre>
+2. Then we need to make sure we are configuring Apache to use the proxy modules and to setup the proxied connection from Apache to Gitblit GO or from Apache to your chosen servlet container. The following snippet is stored as `/etc/apache2/conf.d/gitblit`.
+%BEGINCODE%
+# Turn off support for true Proxy behaviour as we are acting as
+# a transparent proxy
+ProxyRequests Off
+
+# Turn off VIA header as we know where the requests are proxied
+ProxyVia Off
+
+# Turn on Host header preservation so that the servlet container
+# can write links with the correct host and rewriting can be avoided.
+#
+# This is important for all git push/pull/clone operations.
+ProxyPreserveHost On
+
+# Set the permissions for the proxy
+&lt;Proxy *&gt;
+ AddDefaultCharset off
+ Order deny,allow
+ Allow from all
+&lt;/Proxy&gt;
+
+# Turn on Proxy status reporting at /status
+# This should be better protected than: Allow from all
+ProxyStatus On
+&lt;Location /status&gt;
+ SetHandler server-status
+ Order Deny,Allow
+ Allow from all
+&lt;/Location&gt;
+
+# The proxy context path must match the Gitblit context path.
+# For Gitblit GO, see server.contextPath in gitblit.properties.
+
+#ProxyPass /gitblit http://localhost:8080/gitblit
+#ProxyPass /gitblit ajp://localhost:8009/gitblit
+%ENDCODE%
+**Please** make sure to:
+ 1. Review the security of these settings as appropriate for your deployment
+ 2. Uncomment the *ProxyPass* setting for whichever connection you prefer (http/ajp)
+ 3. Correctly set the ports and context paths both in the *ProxyPass* definition and your Gitblit installation
+ If you are using Gitblit GO you can easily configure the AJP connector by specifying a non-zero AJP port.
+ Please remember that on Linux/UNIX, ports < 1024 require root permissions to open.
+ 4. Set *web.mountParameters=false* in `gitblit.properties` or `web.xml` this will use parameterized URLs.
+ Alternatively, you can respecify *web.forwardSlashCharacter*.
## Upgrading Gitblit
Generally, upgrading is easy.