1

Hi and sorry for bad english first :(...

i have one ubuntu 11.10 server and i wanna make gitweb server. i refered to this site - http://www.snowfrog.net/2011/08/02/setting-up-gitweb-on-your-ubuntu-workstation/.

so, i tried to install gitweb and restart apache server.

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

and i tried to connect my gitweb server, but i can't connect - Internal Server Error. i was searching for a lot of time and tried to solve this problem, i coudn't.

this is my gitweb and my server infomation -

  1. installed 'mediawiki' and working now.
  2. installed 'apache2' and working too.
  3. git is working too. i tried to clone git repo to my desktop, and success connected.
  4. installed 'gitweb' and... not working. - Internal Server Error.
  5. i checked my apache2 log.

    [error] [client ---.---.---.---] (13)Permission denied: exec of '/usr/share/gitweb/index.cgi' failed
    [error] [client ---.---.---.---] Premature end of script headers: index.cgi
    
  6. gitweb was installed to /usr/share/gitweb.

  7. this is permission for /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. this is result to '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. i excuted this command - "a2enmod cgi, a2enmod perl" and already enabled.

1 Answer 1

0

Looks like apache can't execute index.cgi because it doesn't have permission. index.cgi is a symlink to gitweb.cgi, and I can see from it's permissions that only root can execute it.

Usually Apache doesn't run as the root user, so you need to change the permissions of gitweb.cgi to allow Apache to execute it.

Try running this command (as root) to change the permissions on gitweb.cgi

chmod +x /usr/share/gitweb/gitweb.cgi
1
  • Thanks for reply, and i did that command... but, it donesn't too :)
    – Kris
    May 8, 2012 at 8:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .