Another Virtual Domain prob. - only default domain seen

This is a discussion on Another Virtual Domain prob. - only default domain seen within the Apache Web Server forums, part of the Web Server and Related Forums category; Apache 2.x on FreeBSD box O/S 6.x BIND named 9.31 multiple domains => 1 IP # Resolves ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-11-2008
Adam Smith
 
Posts: n/a
Default Another Virtual Domain prob. - only default domain seen

Apache 2.x on FreeBSD box O/S 6.x BIND named 9.31

multiple domains => 1 IP #
Resolves ok
ping, dig, host and nslookup points to IP #

Could anyone one see a 'boo boo' here

Thanks
__________________________________


Pointing browser to any of the hosts reverts to default host

I've been to wrestling with this problem all week long, read all
postings I can find and still no solution. Must me something so obvious
that I can not see it, so I need other eyes to look at it.

#
# Use name-based virtual hosting.
#

NameVirtualHost *:8080

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#


# <VirtualHost *:8080>
# DocumentRoot "/usr/local/apache2/htdocs/"
# ServerAdmin webmaster@olaf.com
# ErrorLog /usr/local/apache2/logs/error_log
# CustomLog /usr/local/apache2/logs/access_log common
# <Directory "/usr/local/apache2/htdocs/">
# allow from all
# Options +Indexes
# </Directory>
# </VirtualHost>


<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/olaf.com/httpdocs/"
ServerName olaf.com
ServerAdmin webmaster@olaf.com
ErrorLog /usr/local/apache2/logs/error_log
CustomLog /usr/local/apache2/logs/access_log common
<Directory "/usr/local/apache2/htdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>



# <VirtualHost *:8080>
# DocumentRoot "/usr/local/apache2/htdocs/www/vhosts/olaf.com/httpdocs/"
# ServerAdmin webmaster@olaf.com
# ErrorLog /usr/local/apache2/logs/error_log
# CustomLog /usr/local/apache2/logs/access_log common
# <Directory "/usr/local/apache2/htdocs/www/vhosts/olaf.com/httpdocs/">
# allow from all
# Options +Indexes
# </Directory>
# </VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/mimic.org/httpdocs/"
ServerName mimic.org
ServerAdmin mimic.webmaster@olaf.com
ErrorLog /usr/www/vhosts/mimic.org/error_log
CustomLog /usr/www/vhosts/mimic.org/access_log common
<Directory "/usr/www/vhosts/mimic.org/httpdocs/">
allow from all
Options +Indexes

</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/xtufd.org/httpdocs/"
ServerName xtufd.org
ServerAdmin xtufd.webmaster@olaf.com
ErrorLog /usr/www/vhosts/xtufd.org/error_log
CustomLog /usr/www/vhosts/xtufd.org/access_log common
<Directory "/usr/www/vhosts/xtufd.org/httpdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/sodas4all.biz/httpdocs/"
ServerName sodas4all.biz
ServerAdmin sodas.webmaster@olaf.com
ErrorLog /usr/www/vhosts/sodas4all.biz/error_log
CustomLog /usr/www/vhosts/sodas4all.biz/access_log common
<Directory "/usr/www/vhosts/sodas4all.biz/httpdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/tango4all.biz/httpdocs/"
ServerName tango4all.biz
ServerAdmin tango.webmaster@olaf.com
ErrorLog /usr/www/vhosts/tango4all.biz/error_log
CustomLog /usr/www/vhosts/tango4all.biz/access_log common
<Directory "/usr/www/vhosts/tango4all.biz/httpdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/chachacha.com/httpdocs/"
ServerName chachacha.com
ServerAdmin mimic.webmaster@olaf.com
ErrorLog /usr/www/vhosts/chachacha.com/error_log
CustomLog /usr/www/vhosts/chachacha.com/access_log common
<Directory "/usr/www/vhosts/chachacha.com/httpdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/sodas4all.com/httpdocs/"
ServerName sodas4all.com
ServerAdmin sodas4all.webmaster@olaf.com
ErrorLog /usr/www/vhosts/sodas4all.com/error_log
CustomLog /usr/www/vhosts/sodas4all.com/access_log common
<Directory "/usr/www/vhosts/sodas4all.com/httpdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/we32.biz/httpdocs/"
ServerName we32.biz
ServerAdmin we32.webmaster@olaf.com
ErrorLog /usr/www/vhosts/we32.biz/error_log
CustomLog /usr/www/vhosts/we32.biz/access_log common
<Directory "/usr/www/vhosts/we32.biz/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/staccato.com/httpdocs/"
ServerName staccato.com
ServerAdmin allegro.webmaster@olaf.com
ErrorLog /usr/www/vhosts/staccato.com/error_log
CustomLog /usr/www/vhosts/staccato.com/access_log common
<Directory "/usr/www/vhosts/staccato.com/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/allegro.biz/httpdocs/"
ServerName allegro.biz
ServerAdmin allegro.webmaster@olaf.com
ErrorLog /usr/www/vhosts/allegro.biz/error_log
CustomLog /usr/www/vhosts/allegro.biz/access_log common
<Directory "/usr/www/vhosts/allegro.biz/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/pianos4all.biz/httpdocs/"
ServerName pianos4all.biz
ServerAdmin pianos4all.webmaster@olaf.com
ErrorLog /usr/www/vhosts/pianos4all.biz/error_log
CustomLog /usr/www/vhosts/pianos4all.biz/access_log common
<Directory "/usr/www/vhosts/pianos4all.biz/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/olaf.biz/httpdocs/"
ServerName olaf.biz
ServerAdmin biz.webmaster@olaf.com
ErrorLog /usr/www/vhosts/olaf.biz/error_log
CustomLog /usr/www/vhosts/olaf.biz/access_log common
<Directory "/usr/www/vhosts/olaf.biz/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/saywho.biz/httpdocs/"
ServerName saywho.biz
ServerAdmin saywho.webmaster@olaf.com
ErrorLog /usr/www/vhosts/saywho.biz/error_log
CustomLog /usr/www/vhosts/saywho.biz/access_log common
<Directory "/usr/www/vhosts/saywho.biz/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:8080>
DocumentRoot "/usr/www/vhosts/incredible.info/httpdocs/"
ServerName incredible.info
ServerAdmin incred.webmaster@olaf.com
ErrorLog /usr/www/vhosts/incredible.info/error_log
CustomLog /usr/www/vhosts/incredible.info/access_log common
<Directory "/usr/www/vhosts/incredible.info/httpdocs">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

____________________________________________

/usr/local/apache2/bin/httpd -S

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:8080 is a NameVirtualHost
default server olaf.com
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:40)
port 8080 namevhost olaf.com
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:40)
port 8080 namevhost mimic.org
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:65)
port 8080 namevhost xtufd.org
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:78)
port 8080 namevhost sodas4all.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:90)
port 8080 namevhost tango4all.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:102)
port 8080 namevhost chachacha.com
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:114)
port 8080 namevhost sodas4all.com
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:126)
port 8080 namevhost we32.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:138)
port 8080 namevhost staccato.com
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:150)
port 8080 namevhost allegro.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:162)
port 8080 namevhost pianos4all.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:174)
port 8080 namevhost olaf.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:186)
port 8080 namevhost saywho.biz
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:198)
port 8080 namevhost incredible.info
(/usr/local/apache2/conf/extra/httpd-vhosts.conf:210)
Syntax OK
  #2 (permalink)  
Old 07-11-2008
Mark
 
Posts: n/a
Default Re: Another Virtual Domain prob. - only default domain seen

Adam Smith <adamsmith@econ.com> wrote in news:WMydnc6dAPQGFerVnZ2dnUVZ_g-
dnZ2d@speakeasy.net:

> Apache 2.x on FreeBSD box O/S 6.x BIND named 9.31
>
> multiple domains => 1 IP #
> Resolves ok
> ping, dig, host and nslookup points to IP #
>
> Could anyone one see a 'boo boo' here
>
> Thanks
> __________________________________
>
>
> Pointing browser to any of the hosts reverts to default host
>



Do you still have a "Main" configuration? Remember that the VHOSTs are
not going to work properly with a main host configured.



--


----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.pronews.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= - Total Privacy via Encryption =---
  #3 (permalink)  
Old 07-11-2008
Adam Smith
 
Posts: n/a
Default Re: Another Virtual Domain prob. - only default domain seen

Mark wrote:
> Adam Smith <adamsmith@econ.com> wrote in news:WMydnc6dAPQGFerVnZ2dnUVZ_g-
> dnZ2d@speakeasy.net:
>
>> Apache 2.x on FreeBSD box O/S 6.x BIND named 9.31
>>
>> multiple domains => 1 IP #
>> Resolves ok
>> ping, dig, host and nslookup points to IP #
>>
>> Could anyone one see a 'boo boo' here
>>
>> Thanks
>> __________________________________
>>
>>
>> Pointing browser to any of the hosts reverts to default host
>>

>
>
> Do you still have a "Main" configuration? Remember that the VHOSTs are
> not going to work properly with a main host configured.
>
>
>

Is this new in V 2.x, my memory might be failing me, but I do not recall
having to disable or comment in main config lines v i.3x or 1.2x.
Actually, just going back in and checking in the httpd.conf file =>

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.

which seems to indicate that the values defined here are 'fallback'
default values and should not be in conflict.


or AM I MISSING SOMETHING? hope I am, because I am seeking an early
resolution to this problem, I am tired - woooooooooooooo!

Thanks Mark, plz let me know
  #4 (permalink)  
Old 07-14-2008
Adam Smith
 
Posts: n/a
Default Re: Another Virtual Domain prob. - only default domain seen

Davide Bianchi wrote:
> On 2008-07-11, Adam Smith <adamsmith@econ.com> wrote:
>> <VirtualHost *:8080>
>> ServerName olaf.com
>> <VirtualHost *:8080>
>> ServerName mimic.org

>
> I noticed that all your VHost names are "something.somethingelse", not
> one is 'www.something...' you sure your browser doesn't add a 'www' in
> there by default?
>
> Davide
>


Thanks Davide, your observation was extremely insightful, the problem
was that they needed the "www." in the ServerName.
I never would have followed that line of thinking since when I placed
any of the virtual server directives at the head (default position) of
the extra/httpd-vhosts.conf file the correct page was served, even
without the prepended "www.".

In addition, I thought the alias settings would have taken care of that,
or it probably wasn't set up properly.

Thanks again
  #5 (permalink)  
Old 08-10-2008
Norman Peelman
 
Posts: n/a
Default Re: Another Virtual Domain prob. - only default domain seen

Adam Smith wrote:
> Davide Bianchi wrote:
>> On 2008-07-11, Adam Smith <adamsmith@econ.com> wrote:
>>> <VirtualHost *:8080>
>>> ServerName olaf.com
>>> <VirtualHost *:8080>
>>> ServerName mimic.org

>>
>> I noticed that all your VHost names are "something.somethingelse", not
>> one is 'www.something...' you sure your browser doesn't add a 'www' in
>> there by default?
>>
>> Davide
>>

>
> Thanks Davide, your observation was extremely insightful, the problem
> was that they needed the "www." in the ServerName.
> I never would have followed that line of thinking since when I placed
> any of the virtual server directives at the head (default position) of
> the extra/httpd-vhosts.conf file the correct page was served, even
> without the prepended "www.".
>
> In addition, I thought the alias settings would have taken care of that,
> or it probably wasn't set up properly.
>
> Thanks again


Ok, so a bit of an old post but what the heck... the ServerAlias
directive is your friend:

ServerName olaf.com
ServerAlias www.olaf.com


--
Norman
Registered Linux user #461062
-Have you been to www.apache.org yet?-
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0