Author |
|
dec913
Joined: 17 Oct 2006 Posts: 5 Location: York
|
Posted: Tue 17 Oct '06 9:53 Post subject: Virtual Host's |
|
|
I am currently attempting to setup virtual hostings for a number of sites held on a single server. But with no success.
The server currently has one primary domain, and currently the others are accessed via webforwarding with the limitations that this brings. Having recently setup a mailserver which one of the sites is currently using, and to do so having moved the dns records to our own dns server, the site does not work!
Name based virtual hosts looks to be the ideal solution to this, but would also remove the untiedness of the IP address appearing in the address bar.
Any one any ideas?
Thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 19 Oct '06 9:36 Post subject: Re: Virtual Host's |
|
|
dec913 wrote: | The server currently has one primary domain, and currently the others are accessed via webforwarding with the limitations that this brings. Having recently setup a mailserver which one of the sites is currently using, and to do so having moved the dns records to our own dns server, the site does not work!
|
Can't you create subdomains? like something.yourdomain.com
Quote: |
Name based virtual hosts looks to be the ideal solution to this, but would also remove the untiedness of the IP address appearing in the address bar.
|
Is there a need to see the IP in the adressbar? Or what do you mean? |
|
Back to top |
|
dec913
Joined: 17 Oct 2006 Posts: 5 Location: York
|
Posted: Thu 19 Oct '06 10:06 Post subject: |
|
|
All of the domains are completly different and unrelated so subdomains don't really help.
As for the IP address, what I meant to say was currently the IP is shown due to the use of redirection, with virtual hosts the correct address would be displayed, which is what I am attempting to acheive.
Thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 19 Oct '06 10:21 Post subject: |
|
|
What do you don't understand? There are good docs for namebased vhosts
If you use webforwarding for redirection you have to set that name in you DNS server or your provider has to set that names on his DNS server, depending on your internet connection. |
|
Back to top |
|
dec913
Joined: 17 Oct 2006 Posts: 5 Location: York
|
Posted: Thu 19 Oct '06 14:19 Post subject: |
|
|
Still confused, the code below appears to be correct, Apache starts up and runs. The DNS record points to the site in question www.redshoesdance.co.uk (www.dayfieldgraphics.co.uk being the parent website on the server). But still this does not appear to work!
We host the DNS so can make any of the changes immediately, but as we appear to be unable to see any of the sites internaly using the normal www address (we have to use the IP, and directory if one of the sub websites) to view, so testing is a little problematic!
NameVirtualHost 84.12.101.221
<VirtualHost 84.12.101.221>
ServerAdmin webmaster@dayfieldgraphics.co.uk
DocumentRoot "c:\foxserv\www"
ServerName 192.168.0.23:80
ErrorLog logs/dayfieldgraphics-error_log.txt
CustomLog logs/dayfieldgraphics-access_log.txt common
</VirtualHost>
<VirtualHost www.redshoesdance.co.uk>
ServerAdmin webmaster@dayfieldgraphics.co.uk
DocumentRoot "c:\foxserv\www\redshoesdance"
ServerName redshoesdance.co.uk
ErrorLog logs/redshoesdance-error_log.txt
CustomLog logs/redshoesdance-access_log.txt common
</VirtualHost>
<VirtualHost www.petzoncanvas.co.uk>
ServerAdmin webmaster@petsoncanvas.co.uk
DocumentRoot "c:\foxserv\www\petzoncanvas"
ServerName petzoncanvas.co.uk
ErrorLog logs/petzoncanvas-error_log.txt
CustomLog logs/petzoncanvas-access_log.txt common
</VirtualHost> |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
dec913
Joined: 17 Oct 2006 Posts: 5 Location: York
|
Posted: Fri 20 Oct '06 11:00 Post subject: |
|
|
Sorry for been thick, but as I read the docs, I though that they had been followed.
The instruction say to make the first virtual host entry relate to the main website, and to complete the documentroot and servername to be the same as in the main configuration, which is what I've done.
The following virtualhosts then follow the instructions (I believe!)
I understand that I'm missing the point somewhere, but I just don't get where! Virtual Hosts look so simple.
We are able to configure the DNS to as required, but as we are new to this we are try to learn as we go, at the moment with no success. Any help would be greatly appreciated. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 20 Oct '06 13:56 Post subject: |
|
|
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dayfieldgraphics.co.uk
DocumentRoot "c:\foxserv\www"
ServerName dayfieldgraphics.co.uk
ServerAlias www.dayfieldgraphics.co.uk
ErrorLog logs/dayfieldgraphics-error_log.txt
CustomLog logs/dayfieldgraphics-access_log.txt common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dayfieldgraphics.co.uk
DocumentRoot "c:\foxserv\www\redshoesdance"
ServerName redshoesdance.co.uk
ServerAlias www.redshoesdance.co.uk
ErrorLog logs/redshoesdance-error_log.txt
CustomLog logs/redshoesdance-access_log.txt common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@petsoncanvas.co.uk
DocumentRoot "c:\foxserv\www\petzoncanvas"
ServerName petzoncanvas.co.uk
ServerAlias www.petzoncanvas.co.uk
ErrorLog logs/petzoncanvas-error_log.txt
CustomLog logs/petzoncanvas-access_log.txt common
</VirtualHost>
|
hope that helps. |
|
Back to top |
|
dec913
Joined: 17 Oct 2006 Posts: 5 Location: York
|
Posted: Fri 20 Oct '06 15:09 Post subject: |
|
|
That's brilliant, works a treat.
Having read through the amend section, I can see where we went wrong.
Thanks for your help. |
|
Back to top |
|