{"id":458,"date":"2012-09-26T16:07:56","date_gmt":"2012-09-26T14:07:56","guid":{"rendered":"http:\/\/elkano.org\/blog\/?p=458"},"modified":"2012-09-26T16:07:56","modified_gmt":"2012-09-26T14:07:56","slug":"redmine-git-integration-with-apache","status":"publish","type":"post","link":"https:\/\/elkano.org\/blog\/redmine-git-integration-with-apache\/","title":{"rendered":"Redmine git integration with Apache"},"content":{"rendered":"<p>This is a quick post to explain in a few steps the integration of git scm with redmine.<\/p>\n<p>1- Install git package<\/p>\n<p>On Debian:<\/p>\n<pre class=\"prettyprint lang-xml\">\r\n# apt-get install git \r\n<\/pre>\n<p>2- Create base directory for git repositories<\/p>\n<pre class=\"prettyprint lang-xml\">\r\n# mkdir \/var\/git\r\n# cd \/var\/git\r\n<\/pre>\n<p>3- Create git repository and initialize<\/p>\n<pre class=\"dontquote prettyprint lang-xml\">\r\n# git init --bare myrepo.git\r\n# cd myrepo.git\r\n# git config http.receivepack true\r\n# git config user.name=&quot;your_username&quot;\r\n# git config user.email=&quot;username@domain&quot;\r\n<\/pre>\n<p>4- Finally set correct owner for apache<\/p>\n<pre class=\"dontquote prettyprint lang-xml\">\r\n# chown www-data:www-data \/var\/git\/myrepo.git -R\r\n<\/pre>\n<p>5- Configure Apache for git repositories<\/p>\n<p>In your redmine virtual host add the following:<\/p>\n<pre class=\"dontquote prettyprint lang-xml\">\r\n    ScriptAliasMatch \\\r\n          &quot;(?x)^\/git\/(.*\/(HEAD | \\\r\n                        info\/refs | \\\r\n                        objects\/(info\/[^\/]+ | \\\r\n                                 [0-9a-f]{2}\/[0-9a-f]{38} | \\\r\n                                 pack\/pack-[0-9a-f]{40}\\.(pack|idx)) | \\\r\n                        git-(upload|receive)-pack))$&quot; \\\r\n                       \/usr\/lib\/git-core\/git-http-backend\/$1\r\n\r\n        SetEnv GIT_PROJECT_ROOT \/var\/git\r\n        SetEnv GIT_HTTP_EXPORT_ALL\r\n    &lt;Location \/git&gt;\r\n      AuthType Basic\r\n      AuthName &quot;Redmine git repositories&quot;\r\n      Order deny,allow\r\n      Deny from all\r\n      #Allow from server_IP\r\n      Allow from 127.0.0.1\r\n      Require valid-user\r\n      Satisfy any\r\n      ## for mysql\r\n      RedmineDSN &quot;DBI:mysql:database=redmine;host=db_server&quot;\r\n      RedmineDbUser &quot;dbuser&quot;\r\n      RedmineDbPass &quot;dbpass&quot;\r\n    \r\n      PerlAccessHandler Apache::Authn::Redmine::access_handler\r\n      PerlAuthenHandler Apache::Authn::Redmine::authen_handler\r\n    &lt;\/Location&gt;\r\n<\/pre>\n<p>Go to redmine interface and create a git repository in your project specifying the project path as \/var\/git\/myrepo.git and that&#8217;s all!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick post to explain in a few steps the integration of git scm with redmine. 1- Install git package On Debian: # apt-get install git 2- Create base directory for git repositories # mkdir \/var\/git # cd \/var\/git 3- Create git repository and initialize # git init &#8211;bare myrepo.git # cd myrepo.git [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[63,62,145],"_links":{"self":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/458"}],"collection":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/comments?post=458"}],"version-history":[{"count":15,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/458\/revisions\/473"}],"wp:attachment":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/media?parent=458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/categories?post=458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/tags?post=458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}