Can't access xampp default site after enabling virtual hosts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can't access xampp default site after enabling virtual hosts

Postby insomn3ak » 15. October 2004 09:22

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!
insomn3ak
 
Posts: 13
Joined: 15. October 2004 09:05

Postby Wiedmann » 15. October 2004 09:31

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).
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby insomn3ak » 15. October 2004 16:26

Works perfect! Thanks.
insomn3ak
 
Posts: 13
Joined: 15. October 2004 09:05

Postby upgrade223 » 05. February 2005 19:57

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!
upgrade223
 
Posts: 3
Joined: 05. February 2005 02:51

Postby Wiedmann » 06. February 2005 00:19

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).
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 43 guests