Ulf Samuelsson
New Pleskian
I have a git server running on a LInux VPS (Ubuntu 14.04) with Plesk 12.5.30.
To access the git repos I do
This requires an SSH public key to the server. I would like to install gitweb
so I can clone using the http protocol.
I have studing a lot of webpages, but have not gotten it to work.
My first problem was authentication, but I think I am past this,
and when I access the server using a web browser I end up with "FIle not found" or similar.
I added the following to the Apache Settings:
======================================
TraceEnable On
Alias /gitweb /usr/share/gitweb
<Directory /usr/share/gitweb>
AuthType Basic
AuthName "Restricted GitWeb"
AuthBasicProvider file
AuthUserFile /home/git/gitolite-http-authuserfile
AllowOverride None
# Require valid-user
Require all granted
Options +FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Directory>
SetEnv GIT_PROJECT_ROOT /home/git/repositories
SetEnv GITOLITE_HTTP_HOME /home/git
ScriptAlias /git/ $GITOLITE_HTTP_HOME/gitolite/src/gitolite-shell/
ScriptAlias /gitmob/ $GITOLITE_HTTP_HOME/gitolite/src/gitolite-shell/
SetEnv GIT_HTTP_EXPORT_ALL
<Location /git>
AuthType Basic
AuthName "Private Git Access"
#Require group committers
AuthBasicProvider file
Require valid-user
# AuthUserFile $GITOLITE_HTTP_HOME/gitolite-http-authuserfile
AuthUserFile /home/git/gitolite-http-authuserfile
Options +FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Location>
<Directory "/home/ulf/public_html">
Options +ExecCGI
AddHandler cgi-script .cgi .cgix .pl
</Directory>
ScriptAlias /ulf/ /home/ulf/public_html/
======================================
The last "Directory" was for testing only.
Studying the error_logs show that there is rewriting in progress.
I put a test file as "/home/ulf/public_html/scripts.cgi".
It is a simple shell script that writes a text/html.
When I try to access http://<website>/ulf/script.cgi I gett the following in my error_log.
(Heavily cleanup'ed to reduce line length)
===============
[www.emagii.com/SID][RID/initial] init rewrite engine with requested uri /ulf/script.cgi
[www.emagii.com/SID][RID/initial] applying pattern '^(.*)$' to uri '/ulf/script.cgi'
[www.emagii.com/SID][RID/initial] pass through /ulf/script.cgi
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
request.c(293): request authorized without authentication by access_checker_ex hook: /ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] add path info postfix: HTTPDOCS/ulf -> HTTPDOCS/ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/ulf/script.cgi -> ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] applying pattern '^index\\.php$' to uri 'ulf/script.cgi'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] add path info postfix: HTTPDOCS/ulf -> HTTPDOCS/ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/ulf/script.cgi -> ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] applying pattern '.' to uri 'ulf/script.cgi'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] rewrite 'ulf/script.cgi' -> '/index.php'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] trying to replace prefix HTTPDOCS/ with /
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] internal redirect with /index.php [INTERNAL REDIRECT]
[www.emagii.com/SID][RID/initial/redir#1] init rewrite engine with requested uri /index.php
[www.emagii.com/SID][RID/initial/redir#1] applying pattern '^(.*)$' to uri '/index.php'
[www.emagii.com/SID][RID/initial/redir#1] pass through /index.php
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
request.c(293): request authorized without authentication by access_checker_ex hook: /index.php
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/index.php -> index.php
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] applying pattern '^index\\.php$' to uri 'index.php'
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] pass through HTTPDOCS/index.php
util_script.c(601): Status line from script 'index.php': 404 Not Found
AH01502: headers: ap_headers_output_filter()
http_filters.c(979): Response sent with status 404
============
So apparently, the Plesk inner magic does not want to run the script.cgi.
It wants to run "index.php", which does not exist.
Why is this?
How do I get rid of this behaviour?
BR
Ulf
To access the git repos I do
git clone git@<server>:/myrepo.git
This requires an SSH public key to the server. I would like to install gitweb
so I can clone using the http protocol.
git clone http://server/myrepo.git
I have studing a lot of webpages, but have not gotten it to work.
My first problem was authentication, but I think I am past this,
and when I access the server using a web browser I end up with "FIle not found" or similar.
I added the following to the Apache Settings:
======================================
TraceEnable On
Alias /gitweb /usr/share/gitweb
<Directory /usr/share/gitweb>
AuthType Basic
AuthName "Restricted GitWeb"
AuthBasicProvider file
AuthUserFile /home/git/gitolite-http-authuserfile
AllowOverride None
# Require valid-user
Require all granted
Options +FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Directory>
SetEnv GIT_PROJECT_ROOT /home/git/repositories
SetEnv GITOLITE_HTTP_HOME /home/git
ScriptAlias /git/ $GITOLITE_HTTP_HOME/gitolite/src/gitolite-shell/
ScriptAlias /gitmob/ $GITOLITE_HTTP_HOME/gitolite/src/gitolite-shell/
SetEnv GIT_HTTP_EXPORT_ALL
<Location /git>
AuthType Basic
AuthName "Private Git Access"
#Require group committers
AuthBasicProvider file
Require valid-user
# AuthUserFile $GITOLITE_HTTP_HOME/gitolite-http-authuserfile
AuthUserFile /home/git/gitolite-http-authuserfile
Options +FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
</Location>
<Directory "/home/ulf/public_html">
Options +ExecCGI
AddHandler cgi-script .cgi .cgix .pl
</Directory>
ScriptAlias /ulf/ /home/ulf/public_html/
======================================
The last "Directory" was for testing only.
Studying the error_logs show that there is rewriting in progress.
I put a test file as "/home/ulf/public_html/scripts.cgi".
It is a simple shell script that writes a text/html.
When I try to access http://<website>/ulf/script.cgi I gett the following in my error_log.
(Heavily cleanup'ed to reduce line length)
===============
[www.emagii.com/SID][RID/initial] init rewrite engine with requested uri /ulf/script.cgi
[www.emagii.com/SID][RID/initial] applying pattern '^(.*)$' to uri '/ulf/script.cgi'
[www.emagii.com/SID][RID/initial] pass through /ulf/script.cgi
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
request.c(293): request authorized without authentication by access_checker_ex hook: /ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] add path info postfix: HTTPDOCS/ulf -> HTTPDOCS/ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/ulf/script.cgi -> ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] applying pattern '^index\\.php$' to uri 'ulf/script.cgi'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] add path info postfix: HTTPDOCS/ulf -> HTTPDOCS/ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/ulf/script.cgi -> ulf/script.cgi
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] applying pattern '.' to uri 'ulf/script.cgi'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] rewrite 'ulf/script.cgi' -> '/index.php'
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] trying to replace prefix HTTPDOCS/ with /
[www.emagii.com/SID][RID/initial] [perdir HTTPDOCS/] internal redirect with /index.php [INTERNAL REDIRECT]
[www.emagii.com/SID][RID/initial/redir#1] init rewrite engine with requested uri /index.php
[www.emagii.com/SID][RID/initial/redir#1] applying pattern '^(.*)$' to uri '/index.php'
[www.emagii.com/SID][RID/initial/redir#1] pass through /index.php
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
request.c(293): request authorized without authentication by access_checker_ex hook: /index.php
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] strip per-dir prefix: HTTPDOCS/index.php -> index.php
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] applying pattern '^index\\.php$' to uri 'index.php'
[www.emagii.com/SID][RID/initial/redir#1] [perdir HTTPDOCS/] pass through HTTPDOCS/index.php
util_script.c(601): Status line from script 'index.php': 404 Not Found
AH01502: headers: ap_headers_output_filter()
http_filters.c(979): Response sent with status 404
============
So apparently, the Plesk inner magic does not want to run the script.cgi.
It wants to run "index.php", which does not exist.
Why is this?
How do I get rid of this behaviour?
BR
Ulf