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, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |