# Exec format error when using gitweb

6 messages from 2008-06-22 to 2008-06-22. Participants: Erez Zilber, Lea Wiemann, Luciano Rocha.
Thread: https://gitlist.dev/t/14085

## Erez Zilber, 2008-06-22 13:51

Subject: Exec format error when using gitweb
Message-ID: <ce513bcc0806220651g5cf59516w3fc30a68d7f09e79@mail.gmail.com>
URL: https://gitlist.dev/e/ce513bcc0806220651g5cf59516w3fc30a68d7f09e79%40mail.gmail.com

```
Hi,

I'm trying to config gitweb using v1.5.5.3. I'm able to see my
repositories (through gitweb) but I see the following errors in
/var/log/httpd/error_log. Can anyone help?

[Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] (8)Exec format
error: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] Premature end
of script headers: gitweb.css, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] (8)Exec format
error: exec of '/var/www/cgi-bin/gitweb/git-logo.png' failed, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] Premature end
of script headers: git-logo.png, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi

Thanks,
Erez

```

## Lea Wiemann, 2008-06-22 14:04

Subject: Re: Exec format error when using gitweb
Message-ID: <485E5BD6.6060105@gmail.com>
URL: https://gitlist.dev/e/485E5BD6.6060105%40gmail.com
In-Reply-To: <ce513bcc0806220651g5cf59516w3fc30a68d7f09e79@mail.gmail.com>

```
Erez Zilber wrote:
> [Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] (8)Exec format
> error: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:

Random guess: Did you make the data files (.css, .png) executable by 
accident, so your server is trying to execute them?

-- Lea

```

## Erez Zilber, 2008-06-22 14:11

Subject: Re: Exec format error when using gitweb
Message-ID: <ce513bcc0806220711k5e8c5085qfa330b017d736142@mail.gmail.com>
URL: https://gitlist.dev/e/ce513bcc0806220711k5e8c5085qfa330b017d736142%40mail.gmail.com
In-Reply-To: <485E5BD6.6060105@gmail.com>

```
On Sun, Jun 22, 2008 at 5:04 PM, Lea Wiemann <lewiemann@gmail.com> wrote:
> Erez Zilber wrote:
>>
>> [Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] (8)Exec format
>> error: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:
>
> Random guess: Did you make the data files (.css, .png) executable by
> accident, so your server is trying to execute them?
>

Thanks for the quick response. Yeah, I did that after I got
"Permission denied" errors. Now, I chnaged it and it looks like this:

[admin@kites ~]$ sudo ls -l /var/www/cgi-bin/gitweb
total 192
-rwxr-xr-x 1 apache root    164 Jun 19 13:57 git-favicon.png
-rw-r--r-- 1 apache root    208 Jun 19 13:57 git-logo.png
-rwxr-xr-x 1 apache root 170562 Jun 19 13:57 gitweb.cgi
-rwxr-xr-x 1 apache root     79 Jun 22 16:29 gitweb_config.perl
-rw-r--r-- 1 apache root   7112 Jun 19 13:57 gitweb.css

and I get the following errors:

[Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] (13)Permission
denied: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] Premature end
of script headers: gitweb.css, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] (13)Permission
denied: exec of '/var/www/cgi-bin/gitweb/git-logo.png' failed,
referer: http://kites/cgi-bin/gitweb/gitweb.cgi
[Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] Premature end
of script headers: git-logo.png, referer:
http://kites/cgi-bin/gitweb/gitweb.cgi

Erez

```

## Lea Wiemann, 2008-06-22 14:17

Subject: Re: Exec format error when using gitweb
Message-ID: <485E5EDF.1030002@gmail.com>
URL: https://gitlist.dev/e/485E5EDF.1030002%40gmail.com
In-Reply-To: <ce513bcc0806220711k5e8c5085qfa330b017d736142@mail.gmail.com>

```
Erez Zilber wrote:
> -rw-r--r-- 1 apache root   7112 Jun 19 13:57 gitweb.css
> 
> [Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] (13)Permission
> denied: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:

Apparently your web server is trying to execute gitweb.css even though 
its executable bit isn't set -- perhaps because it's located in the 
cgi-bin directory.  I suggest you open 
http://.../cgi-bin/gitweb/gitweb.css and try to get it to display the 
CSS file in your browser; this is a problem with your web server, not 
with gitweb.

(By the way, git-favicon.png and gitweb_config.perl shouldn't have their 
executable bits set either, since they're not CGI scripts.)

-- Lea

```

## Luciano Rocha, 2008-06-22 14:42

Subject: Re: Exec format error when using gitweb
Message-ID: <20080622144240.GA18324@bit.office.eurotux.com>
URL: https://gitlist.dev/e/20080622144240.GA18324%40bit.office.eurotux.com
In-Reply-To: <ce513bcc0806220651g5cf59516w3fc30a68d7f09e79@mail.gmail.com>

```
On Sun, Jun 22, 2008 at 04:51:52PM +0300, Erez Zilber wrote:
> Hi,
> 
> I'm trying to config gitweb using v1.5.5.3. I'm able to see my
> repositories (through gitweb) but I see the following errors in
> /var/log/httpd/error_log. Can anyone help?
> 
> [Sun Jun 22 16:33:53 2008] [error] [client 172.16.0.7] (8)Exec format
> error: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:
> http://kites/cgi-bin/gitweb/gitweb.cgi

If cgi-bin is configured as ScriptAlias in Apache httpd server, then it
will try to execute every file inside that directory. You should move
them elsewere, or use a different directory altogether, with ExecCGI
permissions.

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

```

## Erez Zilber, 2008-06-22 14:47

Subject: Re: Exec format error when using gitweb
Message-ID: <ce513bcc0806220747x38cf83c2g7cd355f34c090de2@mail.gmail.com>
URL: https://gitlist.dev/e/ce513bcc0806220747x38cf83c2g7cd355f34c090de2%40mail.gmail.com
In-Reply-To: <485E5EDF.1030002@gmail.com>

```
On Sun, Jun 22, 2008 at 5:17 PM, Lea Wiemann <lewiemann@gmail.com> wrote:
> Erez Zilber wrote:
>>
>> -rw-r--r-- 1 apache root   7112 Jun 19 13:57 gitweb.css
>>
>> [Sun Jun 22 17:06:08 2008] [error] [client 172.16.0.7] (13)Permission
>> denied: exec of '/var/www/cgi-bin/gitweb/gitweb.css' failed, referer:
>
> Apparently your web server is trying to execute gitweb.css even though its
> executable bit isn't set -- perhaps because it's located in the cgi-bin
> directory.  I suggest you open http://.../cgi-bin/gitweb/gitweb.css and try
> to get it to display the CSS file in your browser; this is a problem with
> your web server, not with gitweb.

I moved gitweb outside of cgi-bin and now it works OK. Thanks!

>
> (By the way, git-favicon.png and gitweb_config.perl shouldn't have their
> executable bits set either, since they're not CGI scripts.)
>

Sure.

Thanks,
Erez
> -- Lea
>

```
