logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: [Solved] Apache 2.4 with CGI / perl does not execute cgi
Author
bouncybomb



Joined: 11 Aug 2016
Posts: 1
Location: London

PostPosted: Thu 11 Aug '16 14:52    Post subject: [Solved] Apache 2.4 with CGI / perl does not execute cgi Reply with quote

CLOSED

Hello Apache Lounge community,

I am trying to set up gitweb for my firm, but cgiweb.cgi is not executed and is instead returned. This is Apache 2.4 on Ubuntu LTS.

I have a2enmod'd cgid and restarted. The load is in the mod-enabled dir.

I have apt-get install'd libapache2-mod-perl2 and restarted. The load is in the mod-enabled dir.

Applying log level trace8 on my site conf I get this in the logs:


[Thu Aug 11 12:07:37.138014 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(394): [client 10.10.29.7:58037] Headers received from client:
[Thu Aug 11 12:07:37.138226 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Host: git
[Thu Aug 11 12:07:37.138343 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Connection: keep-alive
[Thu Aug 11 12:07:37.138418 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Cache-Control: max-age=0
[Thu Aug 11 12:07:37.138569 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Upgrade-Insecure-Requests: 1
[Thu Aug 11 12:07:37.138679 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome /51.0.2704.103 Safari/537.36
[Thu Aug 11 12:07:37.138781 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[Thu Aug 11 12:07:37.138917 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Accept-Encoding: gzip, deflate, sdch
[Thu Aug 11 12:07:37.138991 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] Accept-Language: en-US,en;q=0.8
[Thu Aug 11 12:07:37.139122 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] If-None-Match: \\"3d63a-539c987a0a86a\\"
[Thu Aug 11 12:07:37.139261 2016] [http:trace4] [pid 9674:tid 140415312172800] http_request.c(398): [client 10.10.29.7:58037] If-Modified-Since: Thu, 11 Aug 2016 10:50:10 GMT
[Thu Aug 11 12:07:37.139371 2016] [rewrite:trace2] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] init rewrite engine with reque sted uri /
[Thu Aug 11 12:07:37.139465 2016] [rewrite:trace3] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] applying pattern '^/$' to uri '/'
[Thu Aug 11 12:07:37.139562 2016] [rewrite:trace2] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] rewrite '/' -> '/usr/lib/cgi-b in/gitweb.cgi'
[Thu Aug 11 12:07:37.139642 2016] [rewrite:trace3] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] applying pattern '^/(.*\\.git/ (?!/?(HEAD|info|objects|refs)).*)?$' to uri '/usr/lib/cgi-bin/gitweb.cgi'
[Thu Aug 11 12:07:37.139727 2016] [rewrite:trace2] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] local path result: /usr/lib/cg i-bin/gitweb.cgi
[Thu Aug 11 12:07:37.139811 2016] [rewrite:trace1] [pid 9674:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:58037] 10.10.29.7 - - [git/sid#7fb50374ab50][rid#7fb5036c60a0/initial] go-ahead with /usr/lib/cgi-bin /gitweb.cgi [OK]
[Thu Aug 11 12:07:37.139949 2016] [authz_core:debug] [pid 9674:tid 140415312172800] mod_authz_core.c(809): [client 10.10.29.7:58037] AH01626: authorization result of Require all granted: granted
[Thu Aug 11 12:07:37.140026 2016] [authz_core:debug] [pid 9674:tid 140415312172800] mod_authz_core.c(809): [client 10.10.29.7:58037] AH01626: authorization result of <RequireAny>: granted
[Thu Aug 11 12:07:37.140090 2016] [core:trace3] [pid 9674:tid 140415312172800] request.c(293): [client 10.10.29.7:58037] request authorized without authentication by access_checker_ex hook: /
[Thu Aug 11 12:07:37.140267 2016] [http:trace3] [pid 9674:tid 140415312172800] http_filters.c(1006): [client 10.10.29.7:58037] Response sent with status 304, headers:
[Thu Aug 11 12:07:37.140346 2016] [http:trace5] [pid 9674:tid 140415312172800] http_filters.c(1013): [client 10.10.29.7:58037] Date: Thu, 11 Aug 2016 11:07:37 GMT
[Thu Aug 11 12:07:37.140408 2016] [http:trace5] [pid 9674:tid 140415312172800] http_filters.c(1016): [client 10.10.29.7:58037] Server: Apache/2.4.18 (Ubuntu)


Which seems to indicate that mod-cgid is never triggered and I have no idea why.

I see /usr/lib/cgi-bin is valid and has +ExecCGI in serve-cgi-bin.conf

Any help would be much appreciated.
Cheers.


[/b]Update:

I've adjusted the paths in my site conf so that the SciptAlias is used instead of the absolute path for cgi-bin, and I get errors from mod_deflate but same result:

[Thu Aug 11 15:44:06.890625 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(394): [client 10.10.29.7:51656] Headers received from client:
[Thu Aug 11 15:44:06.890786 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Host: git
[Thu Aug 11 15:44:06.890898 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Connection: keep-alive
[Thu Aug 11 15:44:06.890997 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Cache-Control: max-age=0
[Thu Aug 11 15:44:06.891096 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Upgrade-Insecure-Requests: 1
[Thu Aug 11 15:44:06.891192 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
[Thu Aug 11 15:44:06.891284 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[Thu Aug 11 15:44:06.891347 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Accept-Encoding: gzip, deflate, sdch
[Thu Aug 11 15:44:06.891440 2016] [http:trace4] [pid 10535:tid 140415312172800] http_request.c(398): [client 10.10.29.7:51656] Accept-Language: en-US,en;q=0.8
[Thu Aug 11 15:44:06.891529 2016] [rewrite:trace2] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] init rewrite engine with requested uri /
[Thu Aug 11 15:44:06.891606 2016] [rewrite:trace3] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] applying pattern '^/$' to uri '/'
[Thu Aug 11 15:44:06.891678 2016] [rewrite:trace2] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] rewrite '/' -> '/cgi-bin/gitweb.cgi'
[Thu Aug 11 15:44:06.891740 2016] [rewrite:trace3] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] applying pattern '^/(.*\\.git/(?!/?(HEAD|info|objects|refs)).*)?$' to uri '/cgi-bin/gitweb.cgi'
[Thu Aug 11 15:44:06.891814 2016] [rewrite:trace2] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] local path result: /cgi-bin/gitweb.cgi
[Thu Aug 11 15:44:06.891905 2016] [rewrite:trace2] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] prefixed with document_root to /usr/lib/cgi-bin/gitweb.cgi
[Thu Aug 11 15:44:06.891968 2016] [rewrite:trace1] [pid 10535:tid 140415312172800] mod_rewrite.c(476): [client 10.10.29.7:51656] 10.10.29.7 - - [git/sid#7fb50377eb50][rid#7fb5036c50a0/initial] go-ahead with /usr/lib/cgi-bin/gitweb.cgi [OK]
[Thu Aug 11 15:44:06.892065 2016] [authz_core:debug] [pid 10535:tid 140415312172800] mod_authz_core.c(809): [client 10.10.29.7:51656] AH01626: authorization result of Require all granted: granted
[Thu Aug 11 15:44:06.892145 2016] [authz_core:debug] [pid 10535:tid 140415312172800] mod_authz_core.c(809): [client 10.10.29.7:51656] AH01626: authorization result of <RequireAny>: granted
[Thu Aug 11 15:44:06.892200 2016] [core:trace3] [pid 10535:tid 140415312172800] request.c(293): [client 10.10.29.7:51656] request authorized without authentication by access_checker_ex hook: /
[Thu Aug 11 15:44:06.892309 2016] [filter:trace2] [pid 10535:tid 140415312172800] mod_filter.c(193): [client 10.10.29.7:51656] Content-Type condition for 'deflate' did not match: no Content-Type
[Thu Aug 11 15:44:06.892373 2016] [filter:trace2] [pid 10535:tid 140415312172800] mod_filter.c(193): [client 10.10.29.7:51656] Content-Type condition for 'deflate' did not match: no Content-Type
[Thu Aug 11 15:44:06.892427 2016] [filter:trace2] [pid 10535:tid 140415312172800] mod_filter.c(193): [client 10.10.29.7:51656] Content-Type condition for 'deflate' did not match: no Content-Type
[Thu Aug 11 15:44:06.892479 2016] [filter:trace2] [pid 10535:tid 140415312172800] mod_filter.c(193): [client 10.10.29.7:51656] Content-Type condition for 'deflate' did not match: no Content-Type
[Thu Aug 11 15:44:06.892530 2016] [filter:trace2] [pid 10535:tid 140415312172800] mod_filter.c(193): [client 10.10.29.7:51656] Content-Type condition for 'deflate' did not match: no Content-Type
[Thu Aug 11 15:44:06.892607 2016] [http:trace3] [pid 10535:tid 140415312172800] http_filters.c(1006): [client 10.10.29.7:51656] Response sent with status 200, headers:
[Thu Aug 11 15:44:06.892666 2016] [http:trace5] [pid 10535:tid 140415312172800] http_filters.c(1013): [client 10.10.29.7:51656] Date: Thu, 11 Aug 2016 14:44:06 GMT
[Thu Aug 11 15:44:06.892718 2016] [http:trace5] [pid 10535:tid 140415312172800] http_filters.c(1016): [client 10.10.29.7:51656] Server: Apache/2.4.18 (Ubuntu)
[Thu Aug 11 15:44:06.892770 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] Last-Modified: Thu, 11 Aug 2016 10:50:10 GMT
[Thu Aug 11 15:44:06.892822 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] ETag: \\"3d63a-539c987a0a86a\\"
[Thu Aug 11 15:44:06.892873 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] Accept-Ranges: bytes
[Thu Aug 11 15:44:06.892924 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] Content-Length: 251450
[Thu Aug 11 15:44:06.892974 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] Keep-Alive: timeout=5, max=100
[Thu Aug 11 15:44:06.893024 2016] [http:trace4] [pid 10535:tid 140415312172800] http_filters.c(835): [client 10.10.29.7:51656] Connection: Keep-Alive




And another update, using the url http://git/cgi-bin/gitweb.cgi does execute the cgi script and i get the results I want, so my site conf must be wrong?

This is the content:

<VirtualHost *:80>
ServerName git
DocumentRoot /usr/lib
SetEnv GITWEB_CONFIG /etc/gitweb.conf

# turning on mod rewrite
RewriteEngine on

# make the front page an internal rewrite to the gitweb script
RewriteRule ^/$ /cgi-bin/gitweb.cgi

# make access for "dumb clients" work
RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ \
/cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]

LogLevel trace8

<Directory /opt/git/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

</VirtualHost>




CLOSED:

Modified the re-write to the full URL, http://git/cgi-bin/gitweb.cgi
Back to top


Reply to topic   Topic: [Solved] Apache 2.4 with CGI / perl does not execute cgi View previous topic :: View next topic
Post new topic   Forum Index -> Apache