Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Git in C:\Users\MyUser\repository. I would like test the app with an Apache server although I have a server running right now and I need a virtual host. How would I configure a virtual host which points to the git repository?

My Apache DocumentRoot directory is C:\xampp\htdocs.

share|improve this question

1 Answer 1

If I understand your question correctly, you can use Apache's alias directive inside of the VirtualHost block to map your repository folder into your document root. For example:

<VirtualHost...whatever...>
    DocumentRoot C:\xampp\htdocs

    # ...SNIP... #

    Alias /testrepo/  C:\Users\MyUser\repository\

</VirtualHost>

Then you can go to http://yourdomain/testrepo/ to access the repository directory

The only caveat is that the user under which Apache runs must have permissions to access (i.e. change directory into) not only your repository directory but also all enclosing ancestor directories up to the root. In Unix terms, that requires the repo directory to be readable and executable, but all ancestor directories only need an execute bit which allows Apache to change directories into them. I'm not sure how that translates in the Windows world but I'm sure Google will provide...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.