logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Virtual Host's
Author
dec913



Joined: 17 Oct 2006
Posts: 5
Location: York

PostPosted: Tue 17 Oct '06 9:53    Post subject: Virtual Host's Reply with quote

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! Rolling Eyes

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

PostPosted: Thu 19 Oct '06 9:36    Post subject: Re: Virtual Host's Reply with quote

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! Rolling Eyes


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

PostPosted: Thu 19 Oct '06 10:06    Post subject: Reply with quote

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

PostPosted: Thu 19 Oct '06 10:21    Post subject: Reply with quote

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

PostPosted: Thu 19 Oct '06 14:19    Post subject: Reply with quote

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

PostPosted: Thu 19 Oct '06 16:05    Post subject: Reply with quote

You did not follow the sematics! You mixed name based and IP based vhosts!
If you can redirect the requests with your own DNS. Please see the docs!

http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Back to top
dec913



Joined: 17 Oct 2006
Posts: 5
Location: York

PostPosted: Fri 20 Oct '06 11:00    Post subject: Reply with quote

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

PostPosted: Fri 20 Oct '06 13:56    Post subject: Reply with quote

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

PostPosted: Fri 20 Oct '06 15:09    Post subject: Reply with quote

That's brilliant, works a treat.

Having read through the amend section, I can see where we went wrong.

Thanks for your help. Very Happy
Back to top


Reply to topic   Topic: Virtual Host's View previous topic :: View next topic
Post new topic   Forum Index -> Apache