Virtualhost creation

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

Virtualhost creation

Postby balagod » 16. November 2008 07:46

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>
balagod
 
Posts: 2
Joined: 16. November 2008 07:41

Postby Sharley » 16. November 2008 08:01

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.
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

Postby balagod » 18. November 2008 05:54

Hi,
It works. Thank you very much.
balagod
 
Posts: 2
Joined: 16. November 2008 07:41

Postby Sharley » 18. November 2008 06:13

Your welcome. :)
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 150 guests