Page 1 of 1

Xampplite Virtual Hosts

PostPosted: 09. August 2009 21:15
by Satyr
Can't launch virtual hosts.
We made exactly like in documentation:
In apache\conf\extra\httpd-vhosts:

Listen 80

NameVirtualHost *:80

<VirtualHost *:80>
ServerName http://www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName http://www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>

In C:\WINDOWS\system32\drivers\etc added:

127.0.0.1 localhost
127.0.0.1 http://www.domain.tld
127.0.0.1 http://www.otherdomain.tld

At http://www.domain.tld or http://www.otherdomain.tld — url/xampp/splash.php (standart Xampp splash). But directories are empty.

We searched at the forum and found viewtopic.php?f=16&t=31565&p=146915&hilit=virtual+hosts#p146915 (we have XP, not Vista but we hoped will work).

NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:\xampplite\htdocs"
</VirtualHost>


<VirtualHost *:80>
ServerName read.local
DocumentRoot "E:\projects"
ServerAdmin webmaster@dummy-host2.example.com
<Directory "E:\projects\lyrics">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

and in hosts:
127.0.0.1 localhost
::1 localhost
127.0.0.1 read.local

And standart splashes again! Please, help, what we are doing wrong?

Re: Xampplite Virtual Hosts

PostPosted: 09. August 2009 23:02
by Izzy
Satyr wrote:NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:\xampplite\htdocs"
</VirtualHost>


<VirtualHost *:80>
ServerName read.local
DocumentRoot "E:\projects"
ServerAdmin webmaster@dummy-host2.example.com
<Directory "E:\projects\lyrics">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

and in hosts:
127.0.0.1 localhost
::1 localhost
127.0.0.1 read.local
The DocumentRoot and the <Directory> directive should both be the same.

In XP you should perhaps use / slashes as it seems that only some people are experiencing difficulties in Vista with / slashes and so find that \ slashes correct an issue for them but in XP this is not usually the case.

Also comment out the IPv6 entry in the hosts file (unless running XAMPP 1.7.2) like so # ::1 localhost

So your vhost may now look like this:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampplite/htdocs"
</VirtualHost>


<VirtualHost *:80>
ServerName read.local
DocumentRoot "E:/projects/lyrics"
ServerAdmin webmaster@read.local
<Directory "E:/projects/lyrics" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


and in hosts file:
Code: Select all
127.0.0.1 localhost
127.0.0.1 read.local

# ::1 localhost
Access from the browser should now work like so:

http://localhost = XAMPP Welcome Page.
http://read.local = your web site.