I have one website (bizvetter.com) successfully under development on my computer (local, not live) based on a tutorial I did and have started another development website. I didn't know how to set up more than one virtual host site when I started the second so I have just been working under a subdirectory of the original website. This was fine until the second website became more complex and so I have been trying to determine how to add it separately and move the files.
My problem (I think) is that my brother-in-law did the original XAMPP install on my computer and he modified the:
c:\programfiles\xampp\apache\conf\httpd.conf file by adding
<VirtualHost *:80>
ServerName http://www.bizvetter.com
ServerAlias bizvetter.com
DocumentRoot C:/Progra~1/xampp/htdocs/elgg1.2
# ErrorLog c:/temp/bv-error.log
# CustomLog c:/temp/bv-access common
# CustomLog c:/temp/bv-referer referer
</VirtualHost>
He also modified the:
C:\windows\system32\drivers\etc\hosts file to include
127.0.0.1 localhost http://www.bizvetter.com bizvetter.com
He never modified the
c:\programfiles\xampp\apache\conf\conf\extra\httpd-vhosts.conf file
This all worked great!
To add the second virtual host site, I have tried several combinations of steps including
1)adding another line for the drivers
127.0.0.1 localhost http://www.bizvetter.com bizvetter.com
while adding to the c:\programfiles\xampp\apache\conf\httpd.conf file
<VirtualHost *:80>
ServerName http://www.recipe.com
ServerAlias recipe.com
DocumentRoot C:/Progra~1/xampp/htdocs/
# ErrorLog c:/temp/recipe-error.log
# CustomLog c:/temp/recipe-access common
# CustomLog c:/temp/recipe-referer referer
</VirtualHost>
and 2) adding the driver as above and modifying the c:\programfiles\xampp\apache\conf\conf\extra\httpd-vhosts.conf file by uncommenting the line NameVirtualHost *:80
and adding these
<VirtualHost *:80>
ServerName http://www.bizvetter.com
ServerAlias bizvetter.com
DocumentRoot C:/Progra~1/xampp/htdocs/elgg1.2
# ErrorLog c:/temp/bv-error.log
# CustomLog c:/temp/bv-access common
# CustomLog c:/temp/bv-referer referer
</VirtualHost>
<VirtualHost *:80>
ServerName http://www.recipe.com
ServerAlias recipe.com
DocumentRoot C:/Progra~1/xampp/htdocs/
# ErrorLog c:/temp/recipe-error.log
# CustomLog c:/temp/recipe-access common
# CustomLog c:/temp/recipe-referer referer
</VirtualHost>
Each time I do this, I restart Apache. And each time it pushes me to the real website for recipe.com (not my local). It also has been asking me to verify authorization for XAMPP under the original bizvetter.com url and won't let me open the index. (That I forgot the admin and password is hopefully a non-issue if I can get the second virtual host working, I won't need to worry about forgetting it for the first which was just a tutorial website anyway).
Any suggestions on what combination of efforts I should/should not be doing? I can post my files but it would seem to take up a whole lot of space. Thanks.