Como faço para corrigir o problema com o servidor Ubuntu 11.10 e o gitweb?

1

Oi e desculpe pelo inglês ruim primeiro: (...

Eu tenho um servidor Ubuntu 11.10 e eu quero fazer o servidor gitweb. Eu consultei este site - link .

então, eu tentei instalar o gitweb e reiniciar o servidor apache.

(as root account)
$ apt-get install gitweb
$ service apache2 restart

e eu tentei conectar meu servidor gitweb, mas não consigo conectar - Internal Server Error. Eu estava procurando por muito tempo e tentei resolver esse problema, eu não pude.

este é o meu gitweb e a informação do meu servidor -

  1. instalado 'mediawiki' e trabalhando agora.
  2. instalado 'apache2' e funcionando também.
  3. git também está funcionando. Eu tentei clonar o Git Repo para o meu desktop e sucesso conectado.
  4. instalado 'gitweb' e ... não está funcionando. - Erro interno do servidor.
  5. eu verifiquei meu log do apache2.

    [error] [client ---.---.---.---] (13)Permission denied: exec of '/usr/share/gitweb/index.cgi' failed
    [error] [client ---.---.---.---] Premature end of script headers: index.cgi
    
  6. O gitweb foi instalado em / usr / share / gitweb.

  7. esta é a permissão para / usr / share / gitweb forlder.

    -rwxr-xr-- 1 root root 221331 2012-05-08 02:24 gitweb.cgi
    lrwxrwxrwx 1 root root     10 2011-06-11 18:17 index.cgi -> gitweb.cgi
    drwxrwxrwx 2 root root   4096 2012-05-07 19:36 static
    
  8. isso é resultado de 'perl /usr/share/index.cgi'.

    Status: 404 Not Found^M
    Content-Type: text/html; charset=utf-8^M
    ^M
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
    <!-- git web interface version 1.7.5.4, (C) 2005-2006, Kay Sievers <[email protected]>, Christian Gierke -->
    <!-- git core binaries version 1.7.5.4 -->
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="generator" content="gitweb/1.7.5.4 git/1.7.5.4"/>
    <meta name="robots" content="index, nofollow"/>
    <title>Untitled Git</title>
    <link rel="stylesheet" type="text/css" href="static/gitweb.css"/>
    <link rel="shortcut icon" href="static/git-favicon.png" type="image/png" />
    </head>
    <body>
    <div class="page_header">
    <a title="git homepage" href="http://git-scm.com/"><img class="logo" height="27" src="static/git-logo.png" alt="git" width="72" /></a><a href="/">projects</a> / </div>
    <div class="page_body">
    <br /><br />
    404 - No projects found
    <br />
    </div>
    <div class="page_footer">
    <a class="rss_logo" href="?a=opml">OPML</a> <a class="rss_logo" href="?a=project_index">TXT</a>
    </div>
    <script type="text/javascript" src="static/gitweb.js"></script>
    </body>
    </html>
    
  9. /etc/gitweb.conf

    # path to git projects (<project>.git)
    $projectroot = "/home/git/repositories";
    
    # 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 = "/home/git/projects.list";
    
    # stylesheet to use
    @stylesheets = ("static/gitweb.css");
    
    # javascript code for gitweb
    $javascript = "static/gitweb.js";
    
    # logo to use
    $logo = "static/git-logo.png";
    
  10. /etc/apache2/conf.d/gitweb

    Alias /gitweb /usr/share/gitweb
    
    <Directory /usr/share/gitweb>
      Option FollowSymLinks +ExecCGI
      AddHandler cgi-script .cgi
    <Directory>
    
  11. eu executei este comando - "a2enmod cgi, a2enmod perl" e já habilitado.

por Kris 08.05.2012 / 07:33

1 resposta

0

Parece que o apache não pode executar index.cgi porque não tem permissão. index.cgi é um link simbólico para gitweb.cgi, e eu posso ver pelas permissões que somente o root pode executá-lo.

Normalmente, o Apache não é executado como usuário root, portanto, é necessário alterar as permissões do gitweb.cgi para permitir que o Apache o execute.

Tente executar este comando (como root) para alterar as permissões em gitweb.cgi

chmod +x /usr/share/gitweb/gitweb.cgi
    
por tjlevine 08.05.2012 / 09:59