Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm setting up some virtual hosts for local web dev. I'm using XAMPP and have been having a nightmare getting it working. Here's my httpd-vhosts.conf file:

NameVirtualHost *:80

<VirtualHost *>
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *>
    ServerAdmin alexandercoady@me.com
    DocumentRoot "/Users/Alex/Documents/Software Development/Web/seo-reports"
    ServerName seo-reports.local
    ServerAlias www.seo-reports.local
    <Directory "/Users/Alex/Documents/Software Development/Web/seo-reports">
    Order allow,deny
    Allow from all
    </Directory>
    ErrorLog "/Users/Alex/Documents/Software Development/Web/seo-reports/error.log"
    CustomLog "/Users/Alex/Documents/Software Development/Web/seo-reports/access.log" common
</VirtualHost>

<VirtualHost *>
    DocumentRoot "/Users/Alex/Documents/Software Development/Web/Code By Coady"
    ServerName codebycoady.local
    <Directory "/Users/Alex/Documents/Software Development/Web/Code By Coady">
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

But everytime I go to either http://seo-reports.local or http://codebycoady.local, I get forwarded to the /xampp folder, and the splash page. They all direct to the same folder, the original /Applications/XAMPP/xamppfiles/htdocs folder. Any ideas how to fix this?

share|improve this question

migrated from stackoverflow.com Sep 4 '11 at 20:41

This question came from our site for professional and enthusiast programmers.

    
same problem with vhosts. I had set up one that did work, removed it to try to get a different one to work and no way. page not found in this case. I am feeling a bug lives here. –  user94502 Sep 13 '11 at 2:06

1 Answer 1

  1. If you are a programmer, beware that #include in httpd.conf definitely does not have the same effect as #include in C! Make sure you have uncommented this line in httpd.conf by removing the # sign:
    #Include conf/extra/httpd-vhosts.conf

  2. Have you restarted Apache after changing your configuration?

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.