Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I'm running LAMP on Arch and now want the gitweb going on apache. Followed the instructions as in https://wiki.archlinux.org/index.php/Gitweb but on the gitweb directory (here localhost/~myuser/gitweb) I get:

Server error!

The server encountered an internal error and was unable to complete your request.

Error message: 
Premature end of script headers: gitweb.cgi

If you think this is a server error, please contact the webmaster.

Error 500

Fri Jun 8 15:14:11 2012
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.3

Appreciating your helps. Thanks.

share|improve this question
Without additional information from e.g. the apache error log we won't be able to help. What happens if you execute the script yourself? –  Ulrich Dangel Jun 8 '12 at 14:25
Ending up in suexec.log I see this: [2012-06-08 13:29:51]: uid: (1000/myuser) gid: (1000/myuser) cmd: gitweb.cgi [2012-06-08 13:29:51]: command not in docroot (/usr/share/gitweb/gitweb.cgi) –  Haix64 Jun 8 '12 at 14:34
This is a security feature by suexec you are only allowed to execute a command within your document root, see httpd.apache.org/docs/2.2/suexec.html#model point 13 –  Ulrich Dangel Jun 8 '12 at 14:39
Thanks. I'm reading the page. But is there some major probability you have a solution for so I could test NOW? –  Haix64 Jun 8 '12 at 14:43
Move gitweb into your docroot, e.g. your public_html folder. You could either try to setup a symlink or hard link if you don't want to copy the file into your folder but i'd assume only a hardlink would work. –  Ulrich Dangel Jun 8 '12 at 14:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.