Page 1 of 1

Can't access xampp default site after enabling virtual hosts

PostPosted: 15. October 2004 09:22
by insomn3ak
I was able to set up the following virtual hosts great. However when they are enabled I can no longer acess the xampp default web interface that you see when you first install and start xampp.

If I comment these lines of code out, the xampp site is acessable again.
Here's what I have:

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
DocumentRoot D:\mysites\site1
ServerName site1.local
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot D:\mysites\site2
ServerName site2.local
</VirtualHost>

Thanks for any help anyone can give!

PostPosted: 15. October 2004 09:31
by Wiedmann
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot "/xampp/htdocs"
    <Directory "/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName site1.local:80
    DocumentRoot "D:/mysites/site1"
    <Directory "D:/mysites/site1">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName site2.local:80
    DocumentRoot "D:/mysites/site2"
    <Directory "D:/mysites/site2">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>


Change "/xampp/htdocs" to your real server path (DocumentRoot).

PostPosted: 15. October 2004 16:26
by insomn3ak
Works perfect! Thanks.

PostPosted: 05. February 2005 19:57
by upgrade223
I am having a similar issue. I can access my newly hosted website (www.thisismysite.com) by using any other computer on my network and can even access it the website from school and through an anonymizer...however, I cannot seem to access www.thisismysite.com from the computer that is serving the pages other than http://localhost/htdocs/thisismysite/htdocs. Any suggestions?

Here is my VirtualHost snippet:

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost:80
    DocumentRoot "Z:/XAMPP/apachefriends/xampp/htdocs"
    <Directory "Z:/XAMPP/apachefriends/xampp/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName thisismysite.com:80
    ServerAlias thisismysite.com *.thisismysite.com
    ErrorLog Z:/XAMPP/apachefriends/xampp/htdocs/thisismysite/logs/thisismysite-error_log
    CustomLog Z:/XAMPP/apachefriends/xampp/htdocs/thisismysite/logs/thisismysite-access_log common
    DocumentRoot "Z:/XAMPP/apachefriends/xampp/htdocs/thisismysite/htdocs"
    <Directory "Z:/XAMPP/apachefriends/xampp/htdocs/thisismysite/htdocs">
        Order Allow,Deny
        Allow from all
        #Options All
        #AllowOverride All
    </Directory>
</VirtualHost>


Obviously thisismysite and thisismysite.com are just dummy references to my actual site. It's just so strange that I can view the site from any other computer...on the network or off. I am able to access http://127.0.0.1 no problem. However, if I type my IP address for the server into a browser on the server (ex. http://123.34.45.56) that doesn't even work...but the same IP address on any other computer loads the site no problem (or in this case, the root htdocs index.php (I removed the XAMPP stuff from the root htdocs). Any help would be appreciated. Thanks!

PostPosted: 06. February 2005 00:19
by Wiedmann
I cannot seem to access "www.thisismysite.com" from the computer that is serving the pages

- You have made the entrys in the HOSTS file for these two DNS names?
- Try a "ping www.thisismysite.com" from this computer. What happens?
- You can access "thisismysite.com"?

However, if I type my IP address for the server into a browser on the server (ex. http://123.34.45.56) that doesn't even work

You can not acces a named based virtual host with an ip (other then the default host).