ThomasRedstone

Apache 2.4 Git HTTP Backend Configuration

Jun 10th, 2014
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <VirtualHost *:8080>
  2.      ServerName git.example.com
  3.      Options +ExecCGI +FollowSymLinks
  4.      AddHandler cgi-script cgi
  5.      DocumentRoot /var/web/example.com/
  6.      RewriteEngine On
  7.      AcceptPathInfo On
  8.      ErrorLog /var/log/apache2/git.example.com_error.log
  9.      CustomLog /var/log/apache2/git.example.com_access.log combined
  10.      SetEnv GIT_PROJECT_ROOT /srv/git
  11.      SetEnv GIT_HTTP_EXPORT_ALL
  12.      SetE       nv GITWEB_PROJECTROOT /srv/git
  13.      SetEnv GITWEB_CONFIG /etc/gitweb.conf
  14.      SetEnv GIT_HTTP_BACKEND "/usr/lib/git-core/git-http-backend"
  15.      ProxyPass /git/ !
  16.      ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
  17.      Alias /gitweb /usr/share/gitweb
  18.      <Directory /usr/share/gitweb>
  19.           Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
  20.           AddHandler perl-script .cgi
  21.           PerlResponseHandler ModPerl::Registry
  22.           PerlOptions +ParseHeaders
  23.           DirectoryIndex gitweb.cgi
  24.      </Directory>
  25.      <Directory /var/web/example.com>
  26.           Require all granted
  27.      </Directory>
  28.      <Directory /srv/git>
  29.           Options +Indexes
  30.           Require all granted
  31.      </Directory>
  32.      <Location /git>
  33.           AddHandler mod_python .py
  34.           PythonAccessHandler /opt/env-allura/src/allura/scripts/ApacheAccessHandler.py
  35.           AuthType Basic
  36.           #Realm/Title of login dialog
  37.           AuthName "RedstoneTechnology GIT Repository"
  38.           AuthBasicAuthoritative off
  39.           # Change this path if needed:
  40.           PythonOption ALLURA_VIRTUALENV /opt/env-allura
  41.           # This routes back to the allura webapp, port 8080 if running with paster server (~/start_allura)
  42.           # In a production environment, run allura with a real WSGI server, and
  43.           # change the IP address and port number as appropriate.
  44.           # And use https if possible, since the username and password are otherwise
  45.           # sent in the clear to Allura.
  46.           PythonOption ALLURA_AUTH_URL http://127.0.0.1:8081/auth/do_login
  47.           PythonOption ALLURA_PERM_URL http://127.0.0.1:8081/auth/repo_permissions
  48.           #AuthUserFile /dev/null
  49.           Require valid-user
  50.      </Location>
  51.      <Directory "/usr/lib/git-core*">
  52.          Require all granted
  53.          SetHandler cgi-script
  54.          Options +ExecCGI +FollowSymLinks
  55.      </Directory>
  56. </VirtualHost>
Advertisement