I have a server running Apache2 to serve git repositories.
The actual location of the repos is on a domain drive (which is backed up, etc.) - not a folder on the actual web server.
I can mount the domain drive on the web server and set owner/group, etc: if I put the mountpoint inside the webroot (like /var/www/html/domain_mount/) then I can refer to the repos by URL without issue.
However, because there is a lot of other things on the domain drive not related to the code, I'd like to just configure aliases (or symlinks) to the location of the git repos.
Ideally, I'd also like to have the domain drive mounted in the usual location for some uniformity (/media/username/domain_mount).
- Apache (or is it git?) doesn't serve the aliased git repos - how do I achieve this?
The Apache config has:
Alias /git/fa.git /var/www/html/git/domain_drive/path/to/repository.git
The error.log shows:
Not a git repository: '/var/www/html/git/fa.git'
- Once I have this working, I think it will be more obvious how to configure Apache to serve from outside the webroot ( directive?) - are there any gotchas to do with (1) I should take into account?
N.B. I've otherwise followed the general steps from here in configuring Apache: