Vitual Hosts (again) Newbie question (Sorry)

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

Vitual Hosts (again) Newbie question (Sorry)

Postby mwaterhouse » 02. March 2007 11:15

Hi All,

Sorry to ask a stupid newbie question but Im trying to configure virtual hosts using apache standalone.

If I put the following into
C:\Program Files\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost *:80>
DocumentRoot C:\Program Files\xampp\htdocs\intranet
ServerName host1.gotdns.com
ServerAlias host1.gotdns.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@host2.gotdns.com
DocumentRoot C:\Program Files\xampp\htdocs\forms
ServerName host2.gotdns.com
</VirtualHost>


Ive also tried,

<VirtualHost *:80>
DocumentRoot /intranet
ServerName host1.gotdns.com
ServerAlias host1.gotdns.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@host2.gotdns.com
DocumentRoot /forms
ServerName host2.gotdns.com
</VirtualHost>


If I do this, apache wont start and doesnt seem to give errors in the logs,

Ive also tried editing the httpd.conf to

# User home directories
Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

<VirtualHost *:80>
DocumentRoot /intranet
ServerName host1.gotdns.com
ServerAlias host1.gotdns.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@host2.gotdns.com
DocumentRoot /forms
ServerName host2.gotdns.com
</VirtualHost>

# Local access to the Apache HTTP Server Manual
Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf



If I do this, apache starts but I get denied access to all websites.

It must be something stupid Ive missed, any replies would be much appreciated as Im tearing my hair out and have tried many things,

Thanks again.

(sorry forgot to mention that I also tried it without and with the site admin line.)
mwaterhouse
 
Posts: 2
Joined: 01. March 2007 17:38

Postby mwaterhouse » 02. March 2007 13:14

Sorted it thanks,

For some reason it was the order of code,

I left the httpd.conf exactly how it was and entered this,

<VirtualHost *:80>
ServerName host1.gotdns.com
ServerAlias host1.gotdns.com
DocumentRoot "C:\Program Files\xampp\htdocs\intranet"
ServerAdmin webmaster@host1.gotdns.com
</VirtualHost>
<VirtualHost *:80>
ServerName host2.gotdns.com
ServerAlias host2.gotdns.com
DocumentRoot "C:\Program Files\xampp\htdocs\forms"
ServerAdmin webmaster@host2.gotdns.com
</VirtualHost>


Seems to work fine now.

Thanks anyway
mwaterhouse
 
Posts: 2
Joined: 01. March 2007 17:38


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests