ubuntu - gitolite - smart-http - 为 rc ("UMASK"提供未初始化的值)

标签 ubuntu apache2 gitolite

当我尝试对运行 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

最佳答案

好的,知道了 - 基本上我是从头开始重新安装的:

  1. > Install gitolite (将源代码安装到 /home/git 目录并使用 su - git 作为 git 用户运行设置)
  2. 阅读the warning here
  3. 运行 the steps in this document (即不运行文件 - 只是逐行运行)
  4. 不要运行 the exports here因为我们将以 git 用户身份运行 gitolite
  5. 使用 apt-get 安装 gitweb - 将其配置为指向位于 /home/git/repositories 的存储库
  6. 在此处将以下内容放入 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>
    
  7. 使用 styles for gitweb from here .

  8. 现在我可以通过 ssh 使用 git clone ssh://git@git.servername.com:gitolite-admin.git http://admin@git.servername.com/git/testing.git

    并查看它 http://servername.com/gitweb

关于ubuntu - gitolite - smart-http - 为 rc ("UMASK"提供未初始化的值),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11649208/

相关文章:

Docker 容器不会运行 : "file already closed" error

php - 调试 php.ini 语法错误

ruby - Apache2 不执行 .rb 文件 (mod_ruby)

基于gitolite的gitlab安装失败

git - git镜像后无法从远程存储库读取

git - 如何在私有(private) gitolite 服务器中镜像官方 Linux 内核树?

c - 是否可以在 FreeBSD 中使用 ubuntu 的共享对象库?

linux - 我如何在 ubuntu 中使用 electron builder 设置图标应用程序

基于虚拟主机的apache用户

python - 在 Django 应用程序中,每个用户只允许一个事件 session