Page 1 of 1

Vhost forwards to Xampp htdocs...

PostPosted: 03. December 2007 10:57
by fatmcgav
HI there,

I've set-up a new vhost in httpd-vhosts.conf for use by Xampp, and uncommented the include line in httpd.conf. Also added the server name to my hosts file.
However, whenever I try to access it, it always forwards to xampp htdocs...

Any ideas why i cant get it to forward to the folder i want???

Code: Select all
NameVirtualHost *:80

<VirtualHost localhost:80>
#    ServerAdmin webmaster.localhost
    DocumentRoot "C:/Program Files/Xampp/htdocs"
    ServerName localhost
#    ErrorLog @rel_logfiledir@/localhost-error_log
#    CustomLog @rel_logfiledir@/localhost-access_log common
</VirtualHost>

<VirtualHost webtest:80>
#    ServerAdmin webmaster@localhost
    DocumentRoot "D:\Websites"
    ServerName webtest
    ErrorLog logs/webtest.local-error.log
    CustomLog logs/webtest.local-access.log common
   
    <Directory "D:\Websites">
    Options Indexes FollowSymLinks
    IndexOptions +FancyIndexing NameWidth=*
    AllowOverride FileInfo
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>


Any help appreciated.

Regards
Gavin W

PostPosted: 03. December 2007 11:30
by Izzy
To test the syntax open a Command Console in
xampp\apache\bin
and type this command at the prompt
apache -S

A search in the Xampp for Windows forum, category Apache Friends in English, using the keyword vhost or virtualhost will give some clues and example solutions.

Here is just one for example:
http://community.apachefriends.org/f/viewtopic.php?t=27069

The Apache Docs. will most surely help.

http://httpd.apache.org/docs/2.3/vhosts/
http://httpd.apache.org/docs/2.3/vhosts/examples.html
http://httpd.apache.org/docs/2.3/mod/core.html

Try this and let me know back if it works and if not paste the message from the apache -S command above:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/Program Files/Xampp/htdocs"
<Directory "C:/Program Files/Xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>   
</VirtualHost>

<VirtualHost *:80>
ServerName webtest
DocumentRoot "D:/Websites"
<Directory "D:/Websites">
Options Indexes FollowSymLinks +FancyIndexing NameWidth=*
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/webtest.local-error.log
CustomLog logs/webtest.local-access.log common
</VirtualHost>



===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 03. December 2007 11:32
by fatmcgav
HI Izzy,

Cheers for the response.

In the end i changed the <VirtualHost> line to *, and changed NameVirtualHosts to * and all works ok now.

CHeers
Gavin

Izzy wrote:To test the syntax open a Command Console in
xampp\apache\bin
and type this command at the prompt
apache -S

A search in the Xampp for Windows forum, category Apache Friends in English, using the keyword vhost or virtualhost will give some clues and example solutions.

Here is just one for example:
http://community.apachefriends.org/f/viewtopic.php?t=27069

The Apache Docs. will most surely help.

http://httpd.apache.org/docs/2.3/vhosts/
http://httpd.apache.org/docs/2.3/vhosts/examples.html
http://httpd.apache.org/docs/2.3/mod/core.html

Try this and let me know back if it works and if not paste the message from the apache -S command above:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/Program Files/Xampp/htdocs"
<Directory "C:/Program Files/Xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>   
</VirtualHost>

<VirtualHost *:80>
ServerName webtest
DocumentRoot "D:/Websites"
<Directory "D:/Websites">
Options Indexes FollowSymLinks +FancyIndexing NameWidth=*
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
ErrorLog logs/webtest.local-error.log
CustomLog logs/webtest.local-access.log common
</VirtualHost>



===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================