threads / discuss / 14085

Exec format error when using gitweb

Subject: Exec format error when using gitweb

## tl;dr

6 messages between Jun 22, 2008 and Jun 22, 2008.

replies: 5people: 3as markdown or json

Erez Zilber· Jun 22, 2008, 13:51 UTC · lore
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· Jun 22, 2008, 14:04 UTC · re: Erez Zilber · lore

Re: Exec format error when using gitweb

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· Jun 22, 2008, 14:11 UTC · re: Lea Wiemann · lore

Re: Exec format error when using gitweb

On Sun, Jun 22, 2008 at 5:04 PM, Lea Wiemann <lewiemann@gmail.com> wrote:
Show 8 quoted lines
> 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· Jun 22, 2008, 14:17 UTC · re: Erez Zilber · lore

Re: Exec format error when using gitweb

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
Erez Zilber· Jun 22, 2008, 14:47 UTC · re: Lea Wiemann · lore

Re: Exec format error when using gitweb

On Sun, Jun 22, 2008 at 5:17 PM, Lea Wiemann <lewiemann@gmail.com> wrote:
Show 12 quoted lines
> 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
>
Luciano Rocha· Jun 22, 2008, 14:42 UTC · re: Erez Zilber · lore

Re: Exec format error when using gitweb

On Sun, Jun 22, 2008 at 04:51:52PM +0300, Erez Zilber wrote:
Show 9 quoted lines
> 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/>

← back to recent threads