-2

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?

Skyhawk
  • 14,149
  • 3
  • 52
  • 95
Alex coady
  • 93
  • 1
  • 3
  • 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. –  Sep 13 '11 at 02:06

1 Answers1

0
  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?

Skyhawk
  • 14,149
  • 3
  • 52
  • 95
  • The `#Include conf/extra/httpd-vhosts.conf` is now installed without the `#`. Just in case you thought you were going crazy. – BeNice Jun 10 '18 at 16:48