Vhosts configuration

This is a discussion on Vhosts configuration within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, I am having problems configuring vhosts for apache 2.0.54 on gentoo linux. I use 2 network interfaces, ...


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 02-08-2006
Christian Pontesegger
 
Posts: n/a
Default Vhosts configuration

Hi,

I am having problems configuring vhosts for apache 2.0.54 on gentoo linux.

I use 2 network interfaces, one for the home network, one for internet
access. Both should use the same default vhost. For the internal network
I want to add some additional vhosts which should not be accessible from
outside.

I added some configuration files in the vhosts.d configuration folder.

My default vhost looks like this:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /data/web/default/wwwroot
...

Then I added another host in a new config file:

NameVirtualHost 192.168.0.1:80
<VirtualHost 192.168.0.1:80>
ServerName admin.uhura
DocumentRoot /data/web/admin/wwwroot
...

What happens is that an external visitor will always see the default
vhost. An internal visitor looking for the default vhost is always sent
to the "admin vhost".

This is what "apache2ctl -S" returns:

[Wed Feb 08 19:35:17 2006] [warn] NameVirtualHost 192.168.0.1:80 has no
VirtualHosts
[Wed Feb 08 19:35:17 2006] [warn] NameVirtualHost 192.168.0.1:80 has no
VirtualHosts
VirtualHost configuration:
192.168.0.1:80 is a NameVirtualHost
default server admin.uhura
(/etc/apache2/vhosts.d/12_administration.conf:3)
port 80 namevhost admin.uhura
(/etc/apache2/vhosts.d/12_administration.conf:3)

wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server uhura
(/etc/apache2/vhosts.d/00_default_vhost.conf:42)
port 80 namevhost uhura
(/etc/apache2/vhosts.d/00_default_vhost.conf:42)
Syntax OK


Does anyone know how to configure this right?

regards
Christian Pontesegger
  #2 (permalink)  
Old 02-09-2006
Steve
 
Posts: n/a
Default Re: Vhosts configuration

On Wed, 08 Feb 2006 19:38:40 +0100, Christian Pontesegger wrote:

> Hi,
>
> I am having problems configuring vhosts for apache 2.0.54 on gentoo linux.
>
> I use 2 network interfaces, one for the home network, one for internet
> access. Both should use the same default vhost. For the internal network
> I want to add some additional vhosts which should not be accessible from
> outside.
>
> I added some configuration files in the vhosts.d configuration folder.
>
> My default vhost looks like this:
>
> NameVirtualHost *:80

Then don't use a * for the name! Use separate NameVirtualHost blocks for
each IP address.
> <VirtualHost *:80>
> DocumentRoot /data/web/default/wwwroot
> ...
>
> Then I added another host in a new config file:
>
> NameVirtualHost 192.168.0.1:80
> <VirtualHost 192.168.0.1:80>
> ServerName admin.uhura
> DocumentRoot /data/web/admin/wwwroot
> ...
>
> What happens is that an external visitor will always see the default
> vhost. An internal visitor looking for the default vhost is always sent
> to the "admin vhost".
>
> This is what "apache2ctl -S" returns:
>
> [Wed Feb 08 19:35:17 2006] [warn] NameVirtualHost 192.168.0.1:80 has no
> VirtualHosts
> [Wed Feb 08 19:35:17 2006] [warn] NameVirtualHost 192.168.0.1:80 has no
> VirtualHosts
> VirtualHost configuration:
> 192.168.0.1:80 is a NameVirtualHost
> default server admin.uhura
> (/etc/apache2/vhosts.d/12_administration.conf:3)
> port 80 namevhost admin.uhura
> (/etc/apache2/vhosts.d/12_administration.conf:3)
>
> wildcard NameVirtualHosts and _default_ servers: *:80
> is a NameVirtualHost
> default server uhura
> (/etc/apache2/vhosts.d/00_default_vhost.conf:42)
> port 80 namevhost uhura
> (/etc/apache2/vhosts.d/00_default_vhost.conf:42) Syntax OK
>
>
> Does anyone know how to configure this right?
>
> regards
> Christian Pontesegger


  #3 (permalink)  
Old 02-14-2006
Christian Pontesegger
 
Posts: n/a
Default Re: Vhosts configuration

Steve schrieb:

>> My default vhost looks like this:
>>
>> NameVirtualHost *:80

> Then don't use a * for the name! Use separate NameVirtualHost blocks for
> each IP address.


Hm, so which name should I use instead? This is my private litte home
server with 2 NICs. The external one gets a dynamic IP, the internal is
192.168.01. My local machines resolve my server by the name of 'master'.

For internal machines I added some virtual hosts (which already work
with my previously posted config) resolved as 'admin.master',
'develop.master' and so on.

Now I want any access to 'master' or any access to the dynamic or static
IP address to use a default configuration holding an 'official webpage'.

I still don't get it...

regards
Christian
 
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 06:29 AM.


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