Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

setup_proxy.mkd 3.4KB

il y a 11 ans
il y a 11 ans
il y a 11 ans
il y a 11 ans
il y a 11 ans
il y a 11 ans
il y a 11 ans
il y a 11 ans
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ## Running Gitblit behind Apache
  2. Gitblit runs fine behind Apache.
  3. Each Linux distribution may vary on the exact configuration of Apache 2.2.
  4. Here is a sample configuration that works on Debian 7.0 (Wheezy), your distribution may be different.
  5. ### Make sure we have Apache's proxy modules
  6. ```
  7. sudo su
  8. cd /etc/apache2/mods-enabled
  9. ln -s ../mods-available/proxy.load proxy.load
  10. ln -s ../mods-available/proxy_balancer.load proxy_balancer.load
  11. ln -s ../mods-available/proxy_http.load proxy_http.load
  12. ```
  13. ### Configuring Apache to use the proxy modules
  14. Now we must configure Apache to use the proxy modules and 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`.
  15. ```
  16. # Turn off support for true Proxy behaviour as we are acting as
  17. # a transparent proxy
  18. ProxyRequests Off
  19. # Turn off VIA header as we know where the requests are proxied
  20. ProxyVia Off
  21. # Turn on Host header preservation so that the servlet container
  22. # can write links with the correct host and rewriting can be avoided.
  23. #
  24. # This is important for all git push/pull/clone operations.
  25. ProxyPreserveHost On
  26. # Set the permissions for the proxy
  27. <Proxy>
  28. AddDefaultCharset off
  29. Order deny,allow
  30. Allow from all
  31. </Proxy>
  32. # The proxy context path must match the Gitblit context path.
  33. # For Gitblit GO, see server.contextPath in gitblit.properties.
  34. #ProxyPass /gitblit http://localhost:8080/gitblit
  35. #ProxyPassreverse /gitblit http://localhost:8080/gitblit
  36. # If your httpd frontend is https but you are proxying http Gitblit WAR or GO
  37. #Header edit Location ^http://([^/]+)/gitblit/ https://$1/gitblit/
  38. #Header edit Ajax-Location ^http://([^/]+)/gitblit/ https://$1/gitblit/
  39. # Additionally you will want to tell Gitblit the original scheme and port
  40. #RequestHeader set X-Forwarded-Proto https
  41. #RequestHeader set X-Forwarded-Port 443
  42. # If you are using subdomain proxying then you will want to tell Gitblit the appropriate
  43. # context path for your repository url.
  44. # If you are not using subdomain proxying, then ignore this setting.
  45. #RequestHeader set X-Forwarded-Context /
  46. ```
  47. **Please** make sure to:
  48. 1. Review the security of these settings as appropriate for your deployment
  49. 2. Uncomment the *ProxyPass* setting
  50. 3. Correctly set the ports and context paths both in the *ProxyPass* definition and your Gitblit installation
  51. 4. Set *web.mountParameters=false* in `gitblit.properties` or `web.xml` this will use parameterized URLs.
  52. Alternatively, you can respecify *web.forwardSlashCharacter*.
  53. ### Controlling Advertised Repository URLs
  54. In some reverse-proxy configurations you may be running Gitblit using an http interface with an https reverse-proxy proxy. This will lead to Gitblit generating incorrect repository urls.
  55. You can control the url that Gitblit generates by setting X-Forwarded headers in your proxy server.
  56. *X-Forwarded-Proto*://servername(:*X-Forwarded-Port*)(/*X-Forwarded-Context*)
  57. ---X:MEDIAWIKI---
  58. {| class="table table-bordered"
  59. ! Header
  60. ! Description
  61. |-
  62. | X-Forwarded-Port
  63. | The port to use in generated repository http/https urls
  64. |-
  65. | X-Forwarded-Proto
  66. | The protocol/scheme to use in generated repository http/https urls
  67. |-
  68. | X-Forwarded-Context
  69. | The context to use in generated repository http/https urls
  70. |}
  71. ---X:MEDIAWIKI---