Page 1 of 1

Virtualhost creation

PostPosted: 16. November 2008 07:46
by balagod
Hi,
I tried virtualhost option in xampp apache . i am getting following errors .
Please help me to solve this.

Error Details
No such host is known :could not resolve host name test.bala.com
[warn] NameVirtualHost 127.0.0.1;80 has no virtualhosts

vhost.conf details

Code: Select all
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
  DocumentRoot C:/xampp/htdocs/
  ServerName localhost
</VirtualHost>

NameVirtualHost 127.0.0.1:80
<VirtualHost test.bala.com>
  DocumentRoot "C:\sites\test"
  ServerName test.bala.com
    CustomLog "C:\xampp\apache\logs\test.bala.com_access.txt" combined
   ErrorLog "C:\xampp\apache\logs\test.bala.com_error.txt"
  <Directory "C:\sites\test">
     Options Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
  </Directory>
</VirtualHost>

PostPosted: 16. November 2008 08:01
by Sharley
balagod wrote:...I tried virtualhost option in xampp apache . i am getting following errors .
Please help me to solve this...

Try this:
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName test.bala.com
DocumentRoot "C:/sites/test"
<Directory "C:/sites/test" >
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog "C:/xampp/apache/logs/test.bala.com_access.txt" combined
ErrorLog "C:/xampp/apache/logs/test.bala.com_error.txt"
</VirtualHost>
Save the httpd-vhosts.conf file after editing and restart Apache.

In your browser go to:
http://test.bala.com

Also make an entry in your C:\Windows\system32\driver\etc\HOSTS file by dragging into your text editor:
127.0.0.1 test.bala.com
Save the file after editing.

PostPosted: 18. November 2008 05:54
by balagod
Hi,
It works. Thank you very much.

PostPosted: 18. November 2008 06:13
by Sharley
Your welcome. :)