当我尝试对运行 gitolite 且启用了 smart-http 的服务器执行 git 克隆时,我在 /var/log/apache2/error.log
中收到以下错误
[Wed Jul 25 21:53:36 2012] [error] [client 124.149.104.106] FATAL: warn\tUse of
uninitialized value $rc{"UMASK"} in umask at /opt/git/gitolite-source/src/
gitolite-shell line 95, <DATA> line 1.<<newline>>
我确实在 /home/git/.gitolite.rc
UMASK
值设置为 0027
有没有想过为什么从 sites-available
中的文件中的 su_exec 调用时没有设置值?
我将 apache 作为 www-data 运行 - 并按照说明设置了对各种脚本的权限 here - 即:
install -d -m 0755 -o git -g git /var/www/bin
install -d -m 0755 -o www -g www /var/www/git
然后:
在 /var/www/bin
中创建一个名为 gitolite-suexec-wrapper.sh
的 shell 脚本,模式为 0700
并且拥有者用户和组 git
。
最佳答案
好的,知道了 - 基本上我是从头开始重新安装的:
- > Install gitolite (将源代码安装到
/home/git
目录并使用su - git
作为git
用户运行设置) - 阅读the warning here
- 运行 the steps in this document (即不运行文件 - 只是逐行运行)
- 不要运行 the exports here因为我们将以 git 用户身份运行 gitolite
- 使用 apt-get 安装 gitweb - 将其配置为指向位于
/home/git/repositories
的存储库 在此处将以下内容放入 apache 站点配置
/etc/apache2/sites-available/git.servername.com
<VirtualHost *:80> ServerAdmin mail@servername.com ServerAlias git ServerName git.servername.com DocumentRoot /var/www/git <Directory /var/www/git> Options +Indexes AllowOverride none Order allow,deny Allow from all </Directory> SuexecUserGroup git git ScriptAlias /git/ /var/www/bin/gitolite-suexec-wrapper.sh/ ScriptAlias /gitmob/ /var/www/bin/gitolite-suexec-wrapper.sh/ <Location /git> AuthType Basic AuthName "Git Access" Require valid-user AuthUserFile /home/git/gitolite-http-authuserfile </Location> Loglevel warn ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined </VirtualHost>
现在我可以通过 ssh 使用
git clone ssh://git@git.servername.com:gitolite-admin.git
http://admin@git.servername.com/git/testing.git
关于ubuntu - gitolite - smart-http - 为 rc ("UMASK"提供未初始化的值),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11649208/