Git-repositories are not found
Added by Elvys Melo Duarte Almeida almost 10 years ago
Hello everybody,
like written in the subject I'm trying to clone existing repositories from the server (debian) to client (win7).
My aim is to update our ticket system - at the moment redmine 1.0 - to a more modern one.
Unfortunately the person who installed the first version left the company and I have very little experience in apache2 and in ruby, so if you write an answer it could take longer until I answer because I have to understand what you are talking about - I also use this thread to get more experience with the topic.
- Using various wikis I installed redmine2.0 on a debian8 server.
- I used Apache2 as server and passenger as rack
- I migrate the content of the mysql database of redmine1.0 to redmine 2.0 using
bundle exec rake db:migrate RAILS_ENV=production
- I installed redmine3.3 parallelly to redmine2.0 and migrate the content of the mysql database of redmine2 to the newer one
- I did some short tests and I confirmed that
- there were no problem to login in redmine via ldap
- the content of the wikis are shown well
- the tickets are related to the right project and the right version
- I installed the plug-in redmine-scm
- To make it work the ruby-gem rails-observers was installed
- I copied the all repository from the 'old' server to /data/git/repos/ using scp
- The owner of the /data/ were changed recursively to www-data:www-data
- I copied the file scm.yml to [redmine dir]/config
View details of scm.ymlView details of scm.yml
production: deny_delete: false auto_create: false force_repository: false pre_create: /data/git/.redmine-scripts/pre-create.sh post_create: /data/git/.redmine-scripts/post-create.sh pre_delete: /data/git/.redmine-scripts/pre-delete.sh post_delete: /data/git/.redmine-scripts/post-delete.sh max_repos: 0 only_creator: false allow_add_local: true allow_pickup: false svn: path: /data/svn/repos svnadmin: /usr/bin/svnadmin url: svn git: path: /data/git/repos git: /usr/bin/git options: --bare url: http://10.12.1.110/git update_server_info: true git_ext: true append: mercurial: path: /data/mercurial hg: /usr/bin/hg bazaar: path: /data/bazaar bzr: /usr/bin/bzr init: init-repository log_encoding: UTF-8 - I copied the original pre- and post- scripts to /data/git/.redmine-scripts
- I edited the apache2.conf to give apache the access to the target folder
Inserted linesInserted lines
<Directory /data/git/repos/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> - I inserted a new configuration file in apache named git.conf
Content of git.confContent of git.conf
PerlLoadModule Apache2::Redmine SetEnv GIT_PROJECT_ROOT /data/git/repos SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ <Location "/git/"> AuthType Basic Require valid-user AuthName "Redmine git repositories" # PassengerEnabled off PerlAccessHandler Apache::Authn::Redmine::access_handler PerlAuthenHandler Apache::Authn::Redmine::authen_handler RedmineDSN "DBI:mysql:database=redmine_prod;host=localhost" RedmineDbUser "redmine" RedmineDbPass "redmine" # RedmineGitSmartHttp yes #Cache the last 50 auth entries # RedmineCacheCredsMax 0 </Location> - I enabled the configuration using a2enconf
I created a sandbox project and I created successfully a dummy project.
But when I try to clone a repo from a client I have to authenticate myself and then I get the message
fatal: repository 'http://10.12.1.110/git/sandbox.git/' not found
Because I have to authenticate myself I suppose the config-file works well but I just can't figure out why the repository is not found.
I tried to understand the several logs (e.g. apache-error.log, production.log) but I don't get point.
- I cloned from the server to a test-directory in home giving the absolute path to the repository and it worked.
- I cloned from the client and I gave wrong longin data and an error 500 was returned.
Now I spend more than 7 hours trying to fix the problem, but I think I reached the point where my good friend 'google' doesn't help anymore (or I don't know the right terms for solving the problem) -
If you have any ideas, I'd appreciate any help.
Thanks
Elvys
Replies (1)
RE: Git-repositories are not found
-
Added by Elvys Melo Duarte Almeida over 9 years ago
Hello everybody,
I found the solution for the problem described above in https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP
Using the line
a2enmod cgi alias env rewrite
I discovered the the mod alias was not enabled, so the ScriptAlias didn't work.
I hope this information may be useful.
Best regards
Elvys