Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to emulate some Google Apps app installation functionality and in order to effectively debug it, I need it running on my local Windows 7 machine (using XAMPP).

I am behind a router and I've forwarded port 80 to my local IP. When I visit my real IP in the browser I can browse the XAMPP htdocs folder, but when I visit the domain I also browse the htdocs folder. Whereas I need to browse a specific subfolder when I visit the domain.

I've played a bit with httpd-vhosts.conf and here's what I got right now:

<VirtualHost mydomain.info>
    ServerAdmin contact@mydomain.info
    DocumentRoot "C:/xampp/htdocs/mydomain/subfolder"
    ServerName mydomain.info
    ServerAlias mydomain.info
    ErrorLog "logs/mydomain.info-error.log"
    CustomLog "logs/mydomain.info-access.log" combined
</VirtualHost>

<VirtualHost localhost>
    ServerAdmin postmaster@dummy-host.localhost
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>

As you can see, the first rule should have pointed all requests to mydomain.info to c:/xampp/htdocs/mydomain/subfolder, but instead it forwards them to just c:/xampp/htdocs.

Edit: I forgot to mention that I use a free DNS service, to whose nameservers I have pointed the domain. Then in that service's DNS management I've added a A record for the domain with value that looks like this (IP is an example): mydomain.info A 85.201.133.59 and TXT record, required for Google Apps verification: mydomain.info TXT google-site-verification=7rgvD...... However, I doubt this is the problematic thing, since the domain resolves to my local machine as I have mentioned. It just doesn't resolve to the correct folder.

share|improve this question
add comment

1 Answer 1

I think you'll find the problem is your VirtualHost declaration.

Replace:

<VirtualHost mydomain.info>
<VirtualHost localhost>

With:

<VirtualHost *:80>

You also don't need the ServerAlias lines unless you want to direct multiple domains to the same VirtualHost

More info: http://httpd.apache.org/docs/current/vhosts/name-based.html

share|improve this answer
add comment

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.