You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "David Jarrell - @home" <dj...@home.com> on 2002/02/13 02:16:02 UTC

Virtual hosts problem

Hello all,
This is my first post to this list so please bear with me.

I've been an apache user for months now and I must say that it is an
excellent program. What I've come to now, however, leaves me scratching my
head without a clue. I run a website for my Boy Scout troop which is hosted
on a FreeBSD 4.5 box. I have run a standard install of the server 1.3.22 for
a while now, and have just installed 1.3.23 recently as I reinstalled my OS
on some new drives. I run mod_php4 as well.

My problem is, I would like to set up another site on my server where I
could have a web page for my friends and family that would be totally
separate from the troop's site. I have attempted to do this with apache's
virtual host feature. However, I have run into problems.

I attached part of my httpd.conf file below. The configuration below gives
odd results. The ideal results would be that http://bishop.troop85.org would
get the viewer to the bishop site, and http://troop85.org or
http://www.troop85.org would get the user to the usual troop site.

But, what's happening is that ANY address OTHER than bishop or www takes the
user to the bishop page, http://bishop.troop85.org/ doesn't work at all, and
the only one that gets to the boy scout site is http://www.troop85.org.

I've read some web pages and searched a bit in the archives to try to find a
similar situation, but cannot. I would very much appreciate any light anyone
can shed on this. Should there be some setting in my /etc/hosts file that
I'm missing? What about my DNS? I'm using register.com, so should I change
my domain alias setup? I already have one configured for pointing
bishop.troop85.org to bishop.troop85.org. I hope I've provided enough info
to get this ball rolling.

Regards,
David Jarrell
djarrell2@home.com

#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *>
DocumentRoot /usr/local/www/data/bishop/html
ServerName bishop.troop85.org
</VirtualHost>
<VirtualHost *>
DocumentRoot /usr/local/www/data/PHP-nuke/html
ServerName www.troop85.org
</VirtualHost>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem

Posted by waldo kitty <wk...@alltel.net>.
i'm unable to get any of those domains to resolve in the DNS (at this
time)... might be something on my end, i dunno... in any case, i thought
i would toss that in as other have asked you about that aspect...

"David Jarrell - @home" wrote:
> 
> Hello all,
> This is my first post to this list so please bear with me.
> 
> I've been an apache user for months now and I must say that it is an
> excellent program. What I've come to now, however, leaves me scratching my
> head without a clue. I run a website for my Boy Scout troop which is hosted
> on a FreeBSD 4.5 box. I have run a standard install of the server 1.3.22 for
> a while now, and have just installed 1.3.23 recently as I reinstalled my OS
> on some new drives. I run mod_php4 as well.
> 
> My problem is, I would like to set up another site on my server where I
> could have a web page for my friends and family that would be totally
> separate from the troop's site. I have attempted to do this with apache's
> virtual host feature. However, I have run into problems.
> 
> I attached part of my httpd.conf file below. The configuration below gives
> odd results. The ideal results would be that http://bishop.troop85.org would
> get the viewer to the bishop site, and http://troop85.org or
> http://www.troop85.org would get the user to the usual troop site.
> 
> But, what's happening is that ANY address OTHER than bishop or www takes the
> user to the bishop page, http://bishop.troop85.org/ doesn't work at all, and
> the only one that gets to the boy scout site is http://www.troop85.org.
> 
> I've read some web pages and searched a bit in the archives to try to find a
> similar situation, but cannot. I would very much appreciate any light anyone
> can shed on this. Should there be some setting in my /etc/hosts file that
> I'm missing? What about my DNS? I'm using register.com, so should I change
> my domain alias setup? I already have one configured for pointing
> bishop.troop85.org to bishop.troop85.org. I hope I've provided enough info
> to get this ball rolling.
> 
> Regards,
> David Jarrell
> djarrell2@home.com
> 
> #
> # Use name-based virtual hosting.
> #
> NameVirtualHost *
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a known
> # server name.
> #
> <VirtualHost *>
> DocumentRoot /usr/local/www/data/bishop/html
> ServerName bishop.troop85.org
> </VirtualHost>
> <VirtualHost *>
> DocumentRoot /usr/local/www/data/PHP-nuke/html
> ServerName www.troop85.org
> </VirtualHost>
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
       _\/
      (@@)                      Waldo Kitty, Waldo's Place USA
__ooO_( )_Ooo_____________________ telnet://bbs.wpusa.dynip.com
_|_____|_____|_____|_____|_____|_____ http://www.wpusa.dynip.com
____|_____|_____|_____|_____|_____|_____ ftp://ftp.wpusa.dynip.com
_|_Eat_SPAM_to_email_me!_YUM!__|_____|_____ wkitty42 (at) alltel.net

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem

Posted by RuneImp <ru...@imptech.net>.
Try this

<VirtualHost *>
    DocumentRoot /usr/local/www/data/PHP-nuke/html
    ServerName www.troop85.org
    ServerAlias troop85.org
</VirtualHost>
<VirtualHost *>
    DocumentRoot /usr/local/www/data/bishop/html
    ServerName bishop.troop85.org
</VirtualHost>

Also do you have CNAME records in your ZONE file (DNS)
for www.troop85.org & bishop.troop85.org? This is very
important as your virtual hosting will not work until
you add the DNS for those subdomains


-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech
http://imptech.net
rune@imptech.net


----- Original Message ----- 
From: "David Jarrell - @home" <dj...@home.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 5:16 PM
Subject: Virtual hosts problem


Hello all,
This is my first post to this list so please bear with me.

I've been an apache user for months now and I must say that it is an
excellent program. What I've come to now, however, leaves me scratching my
head without a clue. I run a website for my Boy Scout troop which is hosted
on a FreeBSD 4.5 box. I have run a standard install of the server 1.3.22 for
a while now, and have just installed 1.3.23 recently as I reinstalled my OS
on some new drives. I run mod_php4 as well.

My problem is, I would like to set up another site on my server where I
could have a web page for my friends and family that would be totally
separate from the troop's site. I have attempted to do this with apache's
virtual host feature. However, I have run into problems.

I attached part of my httpd.conf file below. The configuration below gives
odd results. The ideal results would be that http://bishop.troop85.org would
get the viewer to the bishop site, and http://troop85.org or
http://www.troop85.org would get the user to the usual troop site.

But, what's happening is that ANY address OTHER than bishop or www takes the
user to the bishop page, http://bishop.troop85.org/ doesn't work at all, and
the only one that gets to the boy scout site is http://www.troop85.org.

I've read some web pages and searched a bit in the archives to try to find a
similar situation, but cannot. I would very much appreciate any light anyone
can shed on this. Should there be some setting in my /etc/hosts file that
I'm missing? What about my DNS? I'm using register.com, so should I change
my domain alias setup? I already have one configured for pointing
bishop.troop85.org to bishop.troop85.org. I hope I've provided enough info
to get this ball rolling.

Regards,
David Jarrell
djarrell2@home.com

#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *>
DocumentRoot /usr/local/www/data/bishop/html
ServerName bishop.troop85.org
</VirtualHost>
<VirtualHost *>
DocumentRoot /usr/local/www/data/PHP-nuke/html
ServerName www.troop85.org
</VirtualHost>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem

Posted by Raquel Rice <ra...@thericehouse.net>.
On Tue, 12 Feb 2002 19:16:02 -0600
David Jarrell - @home "David Jarrell - @home" <dj...@home.com>
wrote:

> My problem is, I would like to set up another site on my server
> where I
> could have a web page for my friends and family that would be
> totally
> separate from the troop's site. I have attempted to do this with
> apache's
> virtual host feature. However, I have run into problems.
> 
> I attached part of my httpd.conf file below. The configuration
> below gives
> odd results. The ideal results would be that
> http://bishop.troop85.org would
> get the viewer to the bishop site, and http://troop85.org or
> http://www.troop85.org would get the user to the usual troop site.
> 
> But, what's happening is that ANY address OTHER than bishop or www
> takes the
> user to the bishop page, http://bishop.troop85.org/ doesn't work
> at all, and
> the only one that gets to the boy scout site is
> http://www.troop85.org.
> 
> I've read some web pages and searched a bit in the archives to try
> to find a
> similar situation, but cannot. I would very much appreciate any
> light anyone
> can shed on this. Should there be some setting in my /etc/hosts
> file that
> I'm missing? What about my DNS? I'm using register.com, so should
> I change
> my domain alias setup? I already have one configured for pointing
> bishop.troop85.org to bishop.troop85.org. I hope I've provided
> enough info
> to get this ball rolling.
> 
> Regards,
> David Jarrell
> djarrell2@home.com
> 
> #
> # Use name-based virtual hosting.
> #
> NameVirtualHost *
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a
> known
> # server name.
> #
> <VirtualHost *>
> DocumentRoot /usr/local/www/data/bishop/html
> ServerName bishop.troop85.org
> </VirtualHost>
> <VirtualHost *>
> DocumentRoot /usr/local/www/data/PHP-nuke/html
> ServerName www.troop85.org
> </VirtualHost>

Does DNS point to each domain?

-- 
Raquel
============================================================
What do we live for, if it is not to make life less difficult for
each other?
  --George Eliot

                              
                              

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)

Posted by RuneImp <ru...@imptech.net>.
Put your VirtualHost directives as I wrote earlier and
you should be set as soon as the DNS propagates...  :)


-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech
http://imptech.net
rune@imptech.net


----- Original Message ----- 
From: "David Jarrell - @home" <dj...@home.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 7:04 PM
Subject: Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)


RuneImp,
So apache knows how to do that? Ok, I removed the
    bishop.troop85.org --->  bishop.troop85.org

...and only left the entries
    bishop.troop85.org ---> troop85.org
    ftp.troop85.org ---> troop85.org

...in the domain alias configuration. I suppose I'll wait for that to
propagate and see what turns up. So in my configuration file should I put
the entry for bishop.troop85.org first? And my /etc/hosts file....that
remains untouched?

Thanks again,
David
djarrell2@home.com
ICQ 775579
AIM JarrellD

----- Original Message -----
From: "RuneImp" <ru...@imptech.net>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 8:44 PM
Subject: Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)


> You will need to setup the "bishop" subdomain at register.com
> if they handle the DNS for your domain. Just have it point to
> your base host name or IP address. Then the Apache VirtualHost
> directives can do the rest.
>
>
> -=- RuneImp
> ImpTech - Web Design, Hosting & Computer Tech
> http://imptech.net
> rune@imptech.net


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)

Posted by "David Jarrell - @home" <dj...@home.com>.
RuneImp,
So apache knows how to do that? Ok, I removed the
    bishop.troop85.org --->  bishop.troop85.org

...and only left the entries
    bishop.troop85.org ---> troop85.org
    ftp.troop85.org ---> troop85.org

...in the domain alias configuration. I suppose I'll wait for that to
propagate and see what turns up. So in my configuration file should I put
the entry for bishop.troop85.org first? And my /etc/hosts file....that
remains untouched?

Thanks again,
David
djarrell2@home.com
ICQ 775579
AIM JarrellD

----- Original Message -----
From: "RuneImp" <ru...@imptech.net>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 8:44 PM
Subject: Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)


> You will need to setup the "bishop" subdomain at register.com
> if they handle the DNS for your domain. Just have it point to
> your base host name or IP address. Then the Apache VirtualHost
> directives can do the rest.
>
>
> -=- RuneImp
> ImpTech - Web Design, Hosting & Computer Tech
> http://imptech.net
> rune@imptech.net
>
>
> ----- Original Message -----
> From: "David Jarrell - @home" <dj...@home.com>
> To: <us...@httpd.apache.org>
> Sent: Tuesday, February 12, 2002 5:44 PM
> Subject: Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)
>
>
> Joshua (and Raquel):
> I use register.com for my registrant; they have a "domain alias" section
> where you can configure various aliases for the domain name. I believe by
> default www. and ftp. both resolve to the basic hostname (and I have no
> problems with either of the two).
>
> As I mentioned in the previous email, I configured bishop.troop85.org to
> point to bishop.troop85.org. That sounds odd to me and I wonder if that is
a
> problem. Both of you mentioned DNS configuration; since www.troop85.org
> works I assumed that the DNS works fine and anything else would be left up
> to the "domain aliases" and my server. Is this incorrect?
>
> I am starting to believe that I need to do something else on my server
here.
> What should my /etc/hosts file look like for such a configuration?
>
> ------------------
>
> To RuneImp,
> How do I see what my CNAME entries are? Where do I look? Are you talking
> about my local setup on my server? Keep in mind that I don't do my own
DNS.
> This is just a small FreeBSD box serving through my cable modem.
>
> Thanks to all of you for the extremely fast replies,
> David Jarrell
> djarrell2@home.com
> ICQ 775579
> AIM JarrellD
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)

Posted by RuneImp <ru...@imptech.net>.
You will need to setup the "bishop" subdomain at register.com
if they handle the DNS for your domain. Just have it point to
your base host name or IP address. Then the Apache VirtualHost
directives can do the rest.


-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech
http://imptech.net
rune@imptech.net


----- Original Message ----- 
From: "David Jarrell - @home" <dj...@home.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 5:44 PM
Subject: Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)


Joshua (and Raquel):
I use register.com for my registrant; they have a "domain alias" section
where you can configure various aliases for the domain name. I believe by
default www. and ftp. both resolve to the basic hostname (and I have no
problems with either of the two).

As I mentioned in the previous email, I configured bishop.troop85.org to
point to bishop.troop85.org. That sounds odd to me and I wonder if that is a
problem. Both of you mentioned DNS configuration; since www.troop85.org
works I assumed that the DNS works fine and anything else would be left up
to the "domain aliases" and my server. Is this incorrect?

I am starting to believe that I need to do something else on my server here.
What should my /etc/hosts file look like for such a configuration?

------------------

To RuneImp,
How do I see what my CNAME entries are? Where do I look? Are you talking
about my local setup on my server? Keep in mind that I don't do my own DNS.
This is just a small FreeBSD box serving through my cable modem.

Thanks to all of you for the extremely fast replies,
David Jarrell
djarrell2@home.com
ICQ 775579
AIM JarrellD


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)

Posted by Matthew Daubenspeck <ma...@oddprocess.org>.
At 08:44 PM 2/12/2002, you wrote:
>Joshua (and Raquel):
>I use register.com for my registrant; they have a "domain alias" section
>where you can configure various aliases for the domain name. I believe by
>default www. and ftp. both resolve to the basic hostname (and I have no
>problems with either of the two).
>
>As I mentioned in the previous email, I configured bishop.troop85.org to
>point to bishop.troop85.org. That sounds odd to me and I wonder if that is a
>problem. Both of you mentioned DNS configuration; since www.troop85.org
>works I assumed that the DNS works fine and anything else would be left up
>to the "domain aliases" and my server. Is this incorrect?
>
>I am starting to believe that I need to do something else on my server here.
>What should my /etc/hosts file look like for such a configuration?

Where does bishop.troop85.org point to? Itself? Do you control the aliases 
from your server, or does register.com? You either have to forward all 
hostnames (*.troop85.org) to your server IP, or individually forward names 
(whatever1.troop85.org, whatever2.troop85.org, etc etc.) to the same IP.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual hosts problem (to Joshua, Raquel, and RuneImp)

Posted by "David Jarrell - @home" <dj...@home.com>.
Joshua (and Raquel):
I use register.com for my registrant; they have a "domain alias" section
where you can configure various aliases for the domain name. I believe by
default www. and ftp. both resolve to the basic hostname (and I have no
problems with either of the two).

As I mentioned in the previous email, I configured bishop.troop85.org to
point to bishop.troop85.org. That sounds odd to me and I wonder if that is a
problem. Both of you mentioned DNS configuration; since www.troop85.org
works I assumed that the DNS works fine and anything else would be left up
to the "domain aliases" and my server. Is this incorrect?

I am starting to believe that I need to do something else on my server here.
What should my /etc/hosts file look like for such a configuration?

------------------

To RuneImp,
How do I see what my CNAME entries are? Where do I look? Are you talking
about my local setup on my server? Keep in mind that I don't do my own DNS.
This is just a small FreeBSD box serving through my cable modem.

Thanks to all of you for the extremely fast replies,
David Jarrell
djarrell2@home.com
ICQ 775579
AIM JarrellD



----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Tuesday, February 12, 2002 7:24 PM
Subject: RE: Virtual hosts problem


>
> > From: David Jarrell - @home [mailto:djarrell2@home.com]
> >
> > I attached part of my httpd.conf file below. The configuration below
gives
> > odd results. The ideal results would be that
> > http://bishop.troop85.org would
> > get the viewer to the bishop site, and http://troop85.org or
> > http://www.troop85.org would get the user to the usual troop site.
> >
> > But, what's happening is that ANY address OTHER than bishop or
> > www takes the
> > user to the bishop page, http://bishop.troop85.org/ doesn't work
> > at all, and
> > the only one that gets to the boy scout site is http://www.troop85.org.
>
> First, just reverse the order of the virtual hosts in the config file.
The
> first listed virtual host catches all requests that don't exactly match
one
> of the listed ServerName's.  (Alternatively, use a ServerAlias in the
second
> vhost and list all the aliases that you want.)
>
> Second, bishop.troop85.org does not resolve correctly from where I'm
> sitting.  I susepct you need to talk to your DNS provider about that.  If
> the DNS doesn't work, the Apache configuration doesn't matter at all.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: Virtual hosts problem

Posted by Joshua Slive <jo...@slive.ca>.
> From: David Jarrell - @home [mailto:djarrell2@home.com]
>
> I attached part of my httpd.conf file below. The configuration below gives
> odd results. The ideal results would be that
> http://bishop.troop85.org would
> get the viewer to the bishop site, and http://troop85.org or
> http://www.troop85.org would get the user to the usual troop site.
>
> But, what's happening is that ANY address OTHER than bishop or
> www takes the
> user to the bishop page, http://bishop.troop85.org/ doesn't work
> at all, and
> the only one that gets to the boy scout site is http://www.troop85.org.

First, just reverse the order of the virtual hosts in the config file.  The
first listed virtual host catches all requests that don't exactly match one
of the listed ServerName's.  (Alternatively, use a ServerAlias in the second
vhost and list all the aliases that you want.)

Second, bishop.troop85.org does not resolve correctly from where I'm
sitting.  I susepct you need to talk to your DNS provider about that.  If
the DNS doesn't work, the Apache configuration doesn't matter at all.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org