Using SSH instead of HTTP to access GitBlit repository

832 Views Asked by At

I am setting up a new server with GitBlit. It should by default create and manage repos accesible via ssh, port 29418. For example: ssh://[email protected]:29418/repo.git

But the new GitBlit forces me to use HTTP with every repo I create (no matter of its permission policy). The only way to access it is via HTTP http://[email protected]/r/repo.git

I have GitBlit 1.7.7 war under Tomcat6 (as default webapp, under ROOT dir) behind Apache. The same setup worked for me on previous installation on local VM (both Centos6.7).

I am already lost. Cant use SSH and dont know how to get rid of that /r/ in repo´s path. Is it possible that is caused by jk_module, which I used to connect tomcat with apache instead of proxy in VM?

my .properties:

git.sshPort=29418
git.repositoriesFolder = ${baseFolder}/git
git.sshKeysManager = com.gitblit.transport.ssh.FileKeyManager
1

There are 1 best solutions below

0
On

Problem solved by moving GitBlit out of the Tomcat's ROOT directory and use rewriteRule on Apache VirtualHost

RewriteEngine on
RewriteLog logs/apache-mod_rewrite
RewriteCond %{REQUEST_URI} !^/gitblit-1.7.1.*
RewriteRule ^/(.*)$ /gitblit-1.7.1/$1 [L,PT]

JkMount /gitblit-1.7.1* worker1

Gitblit started to offer SSH afterwards.