GITWeb出现Httpd错误

时间:2014-03-21 14:05:37

标签: git apache gitweb

我设置GIT并希望在我的RHEL上使用HTTPD 2.2服务器上的GITWeb。当我尝试启动我的HTTPD服务器时,我收到以下错误消息。我确定有些模块缺失但不确定它是什么。

有人可以帮我吗?

[root@cmcccc httpd]# service httpd start
Starting httpd: Syntax error on line 2 of /etc/httpd/conf.d/gitweb.conf:
Invalid command '$projectroot', perhaps misspelled or defined by a module not included in the server configuration

下面是我的gitweb.conf

# path to git projects (<project>.git)
$projectroot = "/apps/opt/gitrepo";

# directory to use for temp files
$git_temp = "/tmp";

# target of the home link on top of all pages
#$home_link = $my_uri || "/";

# html text to include at home page
$home_text = "indextext.html";

# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;

# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";

# logo to use
$logo = "/gitweb/git-logo.png";

# the 'favicon'
$favicon = "/gitweb/git-favicon.png";

$feature{'snapshot'}{'default'} = ['zip','tgz'];

2 个答案:

答案 0 :(得分:0)

确保使用类似于my gitweb.conf的Perl语法。
这里,变量声明应该是&#34; our&#34;前缀,以声明package, global variable

our $home_link_str = "ITSVC projects";
our $site_name = "ITSVC Gitweb";

答案 1 :(得分:0)

apache上的gitweb配置应该类似于

Alias /gitweb /var/www/gitweb
<Location /gitweb>
SetEnv GITWEB_PROJECTROOT /var/git
</Location>
<Directory /var/www/gitweb>
   Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
    AllowOverride All
    order allow,deny
    Allow from all
    AddHandler cgi-script cgi
    DirectoryIndex gitweb.cgi
</Directory>

在您的情况下,GITWEB_PROJECTROOT的值为/ apps / opt / gitrepo,如配置中所示。