Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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:

    DocumentRoot C:\xampp\htdocs

    # ...SNIP... #

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


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .