Xampp Virtual Hosts

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

Xampp Virtual Hosts

Postby Bender5 » 11. May 2009 17:29

Hi I have installed Xampp 1.7.1 on windows Vista.

Local host show up fine. I can browse and have access to the admin

However, setting up virtual hosts is not working.

Here is what I have in my windows host file.

127.0.0.1 localhost

::1 localhost

127.0.0.1 local.site.com
127.0.0.1 site.local

my httpd-vhost.conf

<VirtualHost local.site.com:80>
DocumentRoot "C:\server\htdocs\site\root"
ServerName local.site.com
ServerAdmin admin@local.site.com
<Directory "C:\server\htdocs\site\root\local.site.com">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost site.local:80>
DocumentRoot "C:\server\htdocs\sitelocal\root"
ServerName site.local
ServerAdmin admin@ site.local
<Directory "C:\server\htdocs\sitelocal\root\site.local">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


I keep getting (OS 11004)The requested name is valid, but no data of the requested type was found

How can I fix this?

Thanks in advance
Bender5
 
Posts: 3
Joined: 11. May 2009 16:45

Re: Xampp Virtual Hosts

Postby Bender5 » 11. May 2009 20:06

I have been trying to get this started for a couple days now, any ideas would be greatly appreciated.
Bender5
 
Posts: 3
Joined: 11. May 2009 16:45

Re: Xampp Virtual Hosts

Postby razvan162 » 12. May 2009 09:12

Hi there.
First off all u must set up DNS forwardings... i mean www.site1.com ; www.subdomain.site1.com ; www.subdomain2.site1.com..etc
I must modify in c:\xampp/apache/conf/extra/httpd-vhosts.conf

there is my config from httpd-vhosts.conf



NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin@xxxxx.ro
DocumentRoot C:\xampp\htdocs\www\myzone
ServerName myzone.ro
ServerAlias www.myzone.ro
ErrorLog logs/myzone.ro-error_log
CustomLog logs/myzone.ro-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@xxxxxx.ro
DocumentRoot C:\xampp\htdocs\www\onlinevideos
ServerName onlinevideos.myzone.ro
ServerAlias www.onlinevideos.myzone.ro
ErrorLog logs/onlinevideos.myzone.ro-error_log
CustomLog logs/onlinevideos.myzone.ro-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@xxxxxx.ro
DocumentRoot C:\xampp\htdocs\www\videosearch
ServerName videosearch.myzone.ro
ServerAlias www.videosearch.myzone.ro
ErrorLog logs/videosearch.myzone.ro-error_log
CustomLog logs/videosearch.myzone.ro-access_log common
</VirtualHost>

Hope it helps...cya!
razvan162
 
Posts: 6
Joined: 10. May 2009 09:45

Re: Xampp Virtual Hosts

Postby Bender5 » 12. May 2009 16:40

I added the extra line from your code and it didn't make a difference. I really have to get this thing to work. Only localhost works. I have followed countless examples and the virtual hosts still isnt working.

I keep getting this message. (OS 11004)The requested name is valid, but no data of the requested type was found vista.

I dont care i'll pay you if you can get this fixed I have to have virtual hosts on my machine, can you help?
Bender5
 
Posts: 3
Joined: 11. May 2009 16:45

Re: Xampp Virtual Hosts

Postby razvan162 » 12. May 2009 21:57

There is a problem with DNS i think....
In my case i use www.dnsexit.com ..u must declare your domain and u must make subdomains there first.
U must put their name server adress on your registrar..read http://www.dnsexit.com/Direct.sv?cmd=help

The all thing is like this:
www.domain.com points to www.dnsexit.com
then dnsexit.com points to your ip

U must have domain and subdomains in dnsexit first

If u have your ip set in registrar...the adress www.domain.com points direct to your ip....so u dont have any subdomains...
razvan162
 
Posts: 6
Joined: 10. May 2009 09:45

Re: Xampp Virtual Hosts

Postby Sharley » 15. May 2009 07:28

You have an issue in the Hosts file that may be giving you a headache. :)
Bender5 wrote:Here is what I have in my windows host file.

127.0.0.1 localhost

::1 localhost

127.0.0.1 local.site.com
127.0.0.1 site.local
Comment out this IPv6 entry as it not recognised yet in XAMPP, like so:
# ::1 localhost

Save the Hosts file and try again after making the below edits in your httpd-vhosts.conf file.

Bender5 wrote:my httpd-vhost.conf

<VirtualHost local.site.com:80>
DocumentRoot "C:\server\htdocs\site\root"
ServerName local.site.com
ServerAdmin admin@local.site.com
<Directory "C:\server\htdocs\site\root\local.site.com">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost site.local:80>
DocumentRoot "C:\server\htdocs\sitelocal\root"
ServerName site.local
ServerAdmin admin@ site.local
<Directory "C:\server\htdocs\sitelocal\root\site.local">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Try this:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs" <-- this is the default path to localhost change to your own path.
</VirtualHost>

<VirtualHost *:80>
ServerName local.site.com
DocumentRoot "C:/server/htdocs/site/root/local.site.com"
ServerAdmin admin@local.site.com
<Directory "C:/server/htdocs/site/root/local.site.com">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName site.local
DocumentRoot "C:/server/htdocs/sitelocal/root/site.local"
ServerAdmin admin@ site.local
<Directory "C:/server/htdocs/sitelocal/root/site.local">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Save the httpd-vhosts.conf file after the above edits then restart Apache.

You should now be able to access your local sites with these URI in your browser:
http://local.site.com
http://site.local

Make sure there is an index file (index.html or index.php etc.) in the above local.site.com and local.site folders.

See how that goes and hopefully no errors. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 34 guests