我使用httpd2.2服务器在我的RHEL上设置了GIT并想要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'];发布于 2014-03-22 16:48:37
确保使用类似于my gitweb.conf的Perl语法。
在这里,变量的声明应该以"our“为前缀,以声明package, global variable)
our $home_link_str = "ITSVC projects";
our $site_name = "ITSVC Gitweb";发布于 2014-05-28 12:20:30
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,如您的配置中所示。
https://stackoverflow.com/questions/22561077
复制相似问题