gitolite - smart-http - 为 rc("UMASK") 提供未初始化的值 [英] gitolite - smart-http - gives uninitialised value for rc("UMASK")

查看:22
本文介绍了gitolite - smart-http - 为 rc("UMASK") 提供未初始化的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试对运行 gitolite 且启用了 smart-http 的服务器执行 git clone 时,我的 /var/log/apache2/error.log 中出现以下错误

I'm getting the following error in my /var/log/apache2/error.log when I try to do a git clone to my server running gitolite with smart-http enabled

[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

有没有想过为什么从 sites-available 中的文件中的 su_exec 调用时未设置该值?

Any thoughts why the value isn't setting when called from an su_exec from a file in sites-available?

我将 apache 作为 www-data 运行 - 并按照说明设置了各种脚本的权限 这里 - 即:

I'm running apache as www-data - and have set up permissions on the various scripts as per the instructions here - ie:

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.

create a shell script inside /var/www/bin named gitolite-suexec-wrapper.sh, with mode 0700 and owned by user and group git.

推荐答案

好吧 - 基本上我从头开始重新安装:

Ok got it - basically I reinstalled starting from scratch:

  1. 安装 gitolite(将源安装到 /home/git 目录并使用 su - git) 以 git 用户身份运行设置
  2. 阅读此处的警告
  3. 运行本文档中的步骤(即不运行文件 - 只是一行一行)
  4. 不要运行此处的导出,因为我们将运行 gitolite 作为 git用户
  5. 使用 apt-get 安装 gitweb - 将其配置为指向位于 /home/git/repositories
  6. 的存储库
  7. 将以下内容放入apache站点配置中/etc/apache2/sites-available/git.servername.com

  1. Install gitolite (installing the source to the /home/git directory and running the setup as the git user using su - git)
  2. Read the warning here
  3. Run the steps in this document (ie not run the file - just line by line)
  4. Don't run the exports here as we'll run gitolite as the git user
  5. Install gitweb using apt-get - configure it to point to the repositories at /home/git/repositories
  6. Put the following into the apache site configuration here /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>

  • 使用 此处的 gitweb 样式.

    现在我可以使用 ssh 访问我的网站git clone ssh://git@git.servername.com:gitolite-admin.githttp://admin@git.servername.com/git/testing.git

    Now I can access my site via ssh using git clone ssh://git@git.servername.com:gitolite-admin.git http://admin@git.servername.com/git/testing.git

    并在http://servername.com/gitweb

    这篇关于gitolite - smart-http - 为 rc("UMASK") 提供未初始化的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆