{"id":3656,"date":"2016-09-30T11:46:33","date_gmt":"2016-09-30T09:46:33","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=3656"},"modified":"2017-05-10T22:47:43","modified_gmt":"2017-05-10T20:47:43","slug":"gitweb-on-apache","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/gitweb-on-apache\/","title":{"rendered":"gitweb on apache"},"content":{"rendered":"<pre class=\"brush:bash shell;gutter:true;toolbar:false\">\r\n# projects web page will be: https:\/\/192.168.1.8\/gitweb\/\r\n# Create a git project (e.g. testproject.git):\r\n# mkdir -p \/opt\/GITRepositories\/testproject.git\r\n# cd \/opt\/GITRepositories\/testproject.git\r\n# git init --bare --shared\r\n# cp -v \/opt\/GITRepositories\/test.git\/hooks\/post-update.sample \/opt\/GITRepositories\/test.git\/hooks\/post-update\r\n# now https:\/\/192.168.1.8\/testproject.git is ready for cloning:\r\n# git clone https:\/\/192.168.1.8\/testproject.git\r\n\r\n# cat \/etc\/httpd\/conf.d\/git.conf\r\nSetEnv GIT_PROJECT_ROOT \/opt\/GITRepositories\r\nSetEnv GIT_HTTP_EXPORT_ALL\r\n\r\n&lt;LocationMatch \"^\/[^\/]+\\.git(\/.*)\">\r\n\tAuthType Basic\r\n\tAuthName \"Git Access\"\r\n\tAuthUserFile \"\/opt\/GITRepositories\/committers.txt\"\r\n\tRequire valid-user\r\n\t# Require group committers\r\n&lt;\/LocationMatch>\r\n\r\nAliasMatch ^\/([^\/]+\\.git)\/(objects\/[0-9a-f]{2}\/[0-9a-f]{38})$\t\t\t\/opt\/GITRepositories\/$1\/$2\r\nAliasMatch ^\/([^\/]+\\.git)\/(objects\/pack\/pack-[0-9a-f]{40}.(pack|idx))$\t\/opt\/GITRepositories\/$1\/$2\r\nScriptAliasMatch \\\r\n\t\t\"(?x)^\/([^\/]+\\.git\/(HEAD | \\\r\n\t\t\t\t\t\tinfo\/refs | \\\r\n\t\t\t\t\t\tobjects\/(info\/[^\/]+ | \\\r\n\t\t\t\t\t\t\t\t[0-9a-f]{2}\/[0-9a-f]{38} | \\\r\n\t\t\t\t\t\t\t\tpack\/pack-[0-9a-f]{40}\\.(pack|idx)) | \\\r\n\t\t\t\t\t\tgit-(upload|receive)-pack))$\" \\\r\n\t\t\/usr\/libexec\/git-core\/git-http-backend\/$1\r\n\r\n# ScriptAlias \/gitweb\t\/var\/www\/git\/gitweb.cgi\r\nAlias \/gitweb \/var\/www\/git\r\n&lt;Directory \/var\/www\/git>\r\n\tAuthType Basic\r\n\tAuthName \"Git Access\"\r\n\tAuthUserFile \"\/opt\/GITRepositories\/committers.txt\"\r\n\tRequire valid-user\r\n\r\n\tOptions +ExecCGI\r\n\tAddHandler cgi-script .cgi\r\n\tDirectoryIndex gitweb.cgi\r\n&lt;\/Directory>\r\n\r\n# grep -i -P \"^[^#]\" \/etc\/gitweb.conf \r\n$projects_list_description_width = \"50\";\r\n$projectroot = \"\/opt\/GITRepositories\";\r\n$home_link_str = \"projects\";\r\n$base_url = \"https:\/\/192.168.1.8\/gitweb\/\";\r\n@git_base_url_list = qw(https:\/\/192.168.1.8)\r\n<\/pre>\n<pre>\r\nsee also <a href=\"https:\/\/adrhc.go.ro\/wordpress\/apache-basic-authentication-password-creation\/\" target=\"_blank\">Basic authentication password creation<\/a>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># projects web page will be: https:\/\/192.168.1.8\/gitweb\/ # Create a git project (e.g. testproject.git): # mkdir -p \/opt\/GITRepositories\/testproject.git # cd \/opt\/GITRepositories\/testproject.git # git init &#8211;bare &#8211;shared # cp -v \/opt\/GITRepositories\/test.git\/hooks\/post-update.sample \/opt\/GITRepositories\/test.git\/hooks\/post-update # now https:\/\/192.168.1.8\/testproject.git is ready for cloning: # git [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/gitweb-on-apache\/#more-3656\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">gitweb on apache<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8,44,11],"tags":[94,93],"class_list":["post-3656","post","type-post","status-publish","format-standard","hentry","category-configuration","category-howto","category-http-web-server","category-linux","tag-apache","tag-gitweb"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=3656"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/3656\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=3656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=3656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=3656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}