# An Apache httpd virtual host that serves cgit at the root of # git.example.org. Include it from httpd.conf, which supplies the user, the # MIME types and the logs. It needs mod_alias and mod_cgid, or mod_cgi under # the prefork MPM, and the commented examples also need mod_ssl for HTTPS # and mod_env for git-http-backend. # # The paths are one common layout, so adjust them to your system. # cgit.cgi /usr/lib/cgit, from make install with the two-line cgit.conf in README # static files /usr/share/cgit, from the same install # repositories /var/lib/git, the scan-path custom/cgitrc suggests # git-http-backend /usr/libexec/git-core, the directory git --exec-path prints # certificate /etc/ssl/certs/git.example.org.pem # key /etc/ssl/private/git.example.org.key # # The commented examples add HTTPS, which the bundled auth filters need # before they log anyone in, and smart HTTP clone and push through # git-http-backend. ServerName git.example.org # For HTTPS, change *:80 above to *:443, uncomment these three lines and # uncomment the host at the end, which sends plain HTTP on to HTTPS. # Apache also has to listen on 443. #SSLEngine on #SSLCertificateFile /etc/ssl/certs/git.example.org.pem #SSLCertificateKeyFile /etc/ssl/private/git.example.org.key # The five files cgit links to at the root are served off disk. Apache # takes the first alias that matches, so they come before the one that # hands every other path to cgit as its PATH_INFO. AliasMatch ^/(cgit\.css|cgit\.js|cgit\.png|favicon\.ico|robots\.txt)$ /usr/share/cgit/$1 # Smart HTTP clone and push at the urls cgit gives the repositories go to # git-http-backend. It finds them under GIT_PROJECT_ROOT and, with # GIT_HTTP_EXPORT_ALL, serves them without a git-daemon-export-ok file. # The safe.directory setting lets it open them while another user owns # them. Push is refused until a repository sets http.receivepack or the # server authenticates the user. #SetEnv GIT_PROJECT_ROOT /var/lib/git #SetEnv GIT_HTTP_EXPORT_ALL #SetEnv GIT_CONFIG_COUNT 1 #SetEnv GIT_CONFIG_KEY_0 safe.directory #SetEnv GIT_CONFIG_VALUE_0 * #ScriptAliasMatch ^/(.+/(info/refs|git-upload-pack|git-receive-pack))$ /usr/libexec/git-core/git-http-backend/$1 ScriptAlias / /usr/lib/cgit/cgit.cgi/ # The main httpd.conf refuses every directory it has not opened itself. Require all granted Require all granted # # Require all granted # # # ServerName git.example.org # Redirect permanent / https://git.example.org/ #