我已经使用 smart-http 设置了一个 git 服务器,我可以实现读取访问权限以进行克隆或从存储库中提取,但我无法实现写入访问权限来推送更改,所以当我给 git push origin master 时,我是得到错误,
error: Cannot access URL http://username:password@localhost/, return code 22
fatal: git-http-push failed
我有我的 httpd.conf 文件,
ServerName localhost
SetEnv GIT_PROJECT_ROOT /home/nitin/nitinhtml
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
<LocationMatch "^/git/.*/git-receive-pack$">
AuthType Basic
AuthName "Git Access"
Require group committers
</LocationMatch>
我将启用站点/mysite 文件配置为,
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gitserver1234
ServerAlias www.gitserver1234.com
SetEnv GIT_PROJECT_ROOT /home/nitin/nitinhtml
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git /var/www/gitweb/gitweb.cgi/
<Location /nitin>
AuthType Basic
AuthName "Private Git Access"
AuthUserFile "/etc/git-auth-file"
Required valid-user
</Location>
DocumentRoot /home/nitin/nitinhtml
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/nitin/nitinhtml>
Options EXecCGI Indexes
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
谁能指出这些文件中的错误?还是有任何其他方式来配置它们?