Hey there,
I have run out of ideas. Has anyone ever been able to get a git repo to work through Virtualmin on CentOS 6?
I will provide some details if they are necessary. I can’t even use the git repo. I set it up and it just tells me smart HTTP isn’t enabled so I can’t use it. I am on Windows now. I have tried using various programs as well as git bash but I would like to use NetBeans. Unfortunately I tried this several months ago in Ubuntu and had the exact same issue then.
I have tried this several times over the years and have never had success. All I ever get is an error which says:
“Git command returned with the following error: remote does not support smart HTTP push”
I have added various flavours of things like this to my Apache config for the virtual server in an effort to get it to work but have had absolutely no luck whatsoever:
# Set the root directory where git repositories reside
SetEnv GIT_PROJECT_ROOT /home/USERNAME/public_html/git/REPONAME.git
By default, the git-http-backend allows push for authenticated
users and this directive tells the backend when a user is authenticated.
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
Export all repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch “(?x)^/git/REPONAME.git/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}.(pack|idx)) | git-(upload|receive)-pack))$” /home/USERNAME/cgi-bin/git-http-backend/$1
USERNAME should be replaced by the virtual server username.
REPONAME should be replaced by the git repo name.
Here is another example of the entire virtual server Apache directives where I have disabled running CGI scripts as SUEXEC and set PHP to run as mod_php and had been messing with various configurations:
ServerName git.DOMAIN.org
DocumentRoot /home/git/public_html
ErrorLog /var/log/virtualmin/git.DOMAIN.org_error_log
CustomLog /var/log/virtualmin/git.DOMAIN.org_access_log combined
#ScriptAlias /cgi-bin/ /home/git/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/git/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
#<Directory /home/git/cgi-bin>
#allow from all
#AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
#
<Location /git>
DAV on
AuthType Basic
AuthName git.DOMAIN.org
AuthUserFile /home/git/etc/git.basic.passwd
Require valid-user
Satisfy All
RedirectMatch ^/git$ http://git.DOMAIN.org/git/gitweb.cgi
RedirectMatch ^/git/$ http://git.DOMAIN.org/git/gitweb.cgi
RewriteEngine off
AddHandler cgi-script .cgi
#ProxyPass /git/ !
#ProxyPassReverse /git/ !
#<Proxy *>
#allow from all
#
#<Location /git/REPONAME.git>
#Require user git
#
both http_backend and gitweb should be somewhere under here
<Directory /home/git/cgi-bin>
AllowOverride None
#Important! Lets apache execute the script!
Options +ExecCGI -Includes -IncludesNOEXEC +Indexes +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Set the root directory where git repositories reside
SetEnv GIT_PROJECT_ROOT /home/git/public_html/git/REPONAME.git
By default, the git-http-backend allows push for authenticated
users and this directive tells the backend when a user is authenticated.
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
Export all repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /dev/ /home/git/cgi-bin/git-http-backend/
#ScriptAliasMatch “(?x)^/git/REPONAME.git/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}.(pack|idx)) | git-(upload|receive)-pack))$” /home/git/cgi-bin/git-http-backend/$1
#ScriptAlias /git /home/git/public_html/list/
I have followed some of the things from the following sites, and maybe others:
http://blog.echothis.com/2012/07/20/setting-up-smart-http-for-git-on-virtualmin/comment-page-1/
http://stackoverflow.com/questions/5264949/cannot-push-git-to-remote-repository-with-http-https
http://git-scm.com/2010/03/04/smart-http.html
http://superuser.com/questions/473177/git-push-fatal-failed
Some people say webdav has to be enabled which it seems to be, however others say don’t use webdav and it doesn’t have to use webdav and can just use smart http which I apparently have absolutely no luck with.
I have even gone as far as trying to compile git from source to test if it’s the version of git but that didn’t change a thing either.
I have modified various lines and removed and added various lines to the Apache directives thinking something may be wrong or conflicting or missing, etc. Nothing ever changes, just get that blasted error again.
If anyone can help I will be forever greatful. =)
Thank you for your time.
Ryan