Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Name-based Virtual Hosts

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  mod_ssl LoadModule Order  
Author Message
personal1

External


Since: Oct 26, 2003
Posts: 4



(Msg. 1) Posted: Sun Oct 26, 2003 4:40 pm
Post subject: Name-based Virtual Hosts
Archived from groups: alt>apache>configuration (more info?)

Hi there

I was wondering if anyone could tell me how to set up name-based virtual hosts? I
have two domain names that resolve to the same IP and should essentially show
different pages. However both domains show the same page when loaded and it isn't
what I want.

I'm not necessarily new to Apache but don't have all that much experience. If it
helps I'm running Apache 1.3.27 on Windows.

TIA,

--
Khyle Westmoreland
http : / / www(.) khyle(.) org(.) uk

 >> Stay informed about: Name-based Virtual Hosts 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Sun Oct 26, 2003 4:47 pm
Post subject: Re: Name-based Virtual Hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Khyle Westmoreland <personal@\removemy/khyle.org.ukspam> wrote:
 > I was wondering if anyone could tell me how to set up name-based
 > virtual hosts? I have two domain names that resolve to the same IP and
 > should essentially show different pages.


In the Apache documentation is clearly written. In a nutshell:

NameVirtualHost *

<VirtualHost *>
  ServerName your.domain.here
  DocumentRoot /where/is/your/docroot
  ..other configuration...
</VirtualHost>

<VirtualHost *>
  ServerName your.otherdomain.here
  DocumentRoot /where/is/your/otherdocroot
  ..other configuration...
</VirtualHost>

Davide<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Name-based Virtual Hosts 
Back to top
Login to vote
personal1

External


Since: Oct 26, 2003
Posts: 4



(Msg. 3) Posted: Sun Oct 26, 2003 11:53 pm
Post subject: Re: Name-based Virtual Hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In news:bngj8m$11057a$2@ID-18487.news.uni-berlin.de,
Davide Bianchi <davideyeahsure DeleteThis @onlyforfun.net> word-farted:
<snip>

OK, Thanks for that Davide although there seems to be a couple of problems.

I have specified in the virtualhosts the following:

NameVirtualHost *

<VirtualHost *>
ServerName www.kerryrichardsonMUNGE.co.unitedkingdom
DocumentRoot C:/progra~1/apache~1/apache/krdocs/
ServerAdmin webmaster DeleteThis @kerryrichardsonMUNGE.co.unitedkingdom
ErrorLog mumlogs/error.log
CustomLog mumlogs/common.log common
</VirtualHost>

<VirtualHost *>
ServerName www.khyleMUNGE.org.unitedkingdom
DocumentRoot C:/progra~1/apache~1/apache/htdocs/
ServerAdmin webmaster DeleteThis @khyleMUNGE.org.unitedkingdom
ErrorLog khylogs/error.log
CustomLog khylogs/common.log common

</VirtualHost>

(I have changed the addresses for spam reasons, but you can get the idea).

I have made sure all the appropriate directories exist and that I've put everything
in OK. However, the top domain (which should go to /krdocs) comes up with an apache
test page whenever it is visited. The bottom domain (which should access /htdocs)
seems to prefer accessing /krdocs, which should only be available to the top domain.

Am I doing something horribly wrong? Should I be uncommenting the LoadModule
vhost_alias_module modules/mod_vhost_alias.so line seeing as it has something to do
with virtual hosts?

Thanks,

--
Khyle Westmoreland
http : / / www(.) khyle(.) org(.) uk
 >> Stay informed about: Name-based Virtual Hosts 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 4) Posted: Mon Oct 27, 2003 11:38 am
Post subject: Re: Name-based Virtual Hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Khyle Westmoreland <personal@\removemy/khyle.org.ukspam> wrote:
 > I have specified in the virtualhosts the following:
 > NameVirtualHost *
 > <VirtualHost *>
<font color=purple> > ServerName <a style='text-decoration: underline;' href="http://www.kerryrichardsonMUNGE.co.unitedkingdom</font" target="_blank">www.kerryrichardsonMUNGE.co.unitedkingdom</font</a>>
 > DocumentRoot C:/progra~1/apache~1/apache/krdocs/
 > ServerAdmin webmaster RemoveThis @kerryrichardsonMUNGE.co.unitedkingdom
 > ErrorLog mumlogs/error.log
 > CustomLog mumlogs/common.log common
 > </VirtualHost>

 > <VirtualHost *>
<font color=purple> > ServerName <a style='text-decoration: underline;' href="http://www.khyleMUNGE.org.unitedkingdom</font" target="_blank">www.khyleMUNGE.org.unitedkingdom</font</a>>
 > DocumentRoot C:/progra~1/apache~1/apache/htdocs/
 > ServerAdmin webmaster RemoveThis @khyleMUNGE.org.unitedkingdom
 > ErrorLog khylogs/error.log
 > CustomLog khylogs/common.log common
 > </VirtualHost>

 > I have made sure all the appropriate directories exist and that I've
 > put everything

I think you also need to specify a <Directory ..whereyourdocrootis>
in the <VirtualHost> block to assign the required rights to the
documentroot. Just copy the default one and change the Path.

Davide<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Name-based Virtual Hosts 
Back to top
Login to vote
personal1

External


Since: Oct 26, 2003
Posts: 4



(Msg. 5) Posted: Tue Oct 28, 2003 11:13 am
Post subject: Re: Name-based Virtual Hosts [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In news:bniliq$118fag$1@ID-18487.news.uni-berlin.de,
Davide Bianchi <davideyeahsure.DeleteThis@onlyforfun.net> word-farted:

 > I think you also need to specify a <Directory ..whereyourdocrootis>
 > in the <VirtualHost> block to assign the required rights to the
 > documentroot. Just copy the default one and change the Path.
 >
 > Davide

Thanks very much for that Davide, all works well now Smile

--
Khyle Westmoreland
http : / / www(.) khyle(.) org(.) uk<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Name-based Virtual Hosts 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
very strange... multiple name based virtual hosts seem to .. - Hi there, It is said overall that multiple name based virtual hosts can't work with ssl (see for example http://httpd.apache.org/docs-2.0/ssl/ssl_faq.html#vhosts), but surprisingly I got it work with apache 2... From conf.d/ssl.conf: ..

Virtual Hosts - Hi everyone, I am new to apache, so if my question is answered in the groups faq, or on the apache web site, feel free to tell me to f**k off and read there. However I have looked through the manual, and cant find any reference to the issues im having...

Virtual hosts and SSL? - Hello I'm trying to setup this apache 1.3 server for virtual hosts, with ssl. I've got the normal port 80 working, but the SSL is a bit of a mess. If I have the SSL pages in the real part of the server, ie, https://www.example.com/fred/index.htm then....

Virtual Hosts? - I'm wanting to use one IP address to host multiple domains, ie web hosting. I assume that "virtual hosts" are the thin I need to focus on here and is this basically a similar concept to Host Headers in IIS 5.0? I'm running Windows 2000 with Apa...

Apache Name-based Virtual Host SSL - i want to set Virtual Host SSL now i can set Basic Virtual Host not SSL like www.123.com and www.456.com but i want to set https://www.123.com and https://www.456.com too . How can i do sir ? note : i has 1 ip address on 1 server computer . thank u...
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]