This is a discussion on Apache Virtual Host question within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm having (maybe not) an issue with the virtual hosts section, and a second look would be fine. I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm having (maybe not) an issue with the virtual hosts section, and a
second look would be fine. I have "NameVirtualHost *" set, and I have each virtual host beginning as <VirtualHost xxxdomain.tld>. All other directives and constructs are the same for all domains. When I run httpd -S, I get five lines total around the type of "Virtualhost xxxdomain.net:0 overlaps with virtualhost xxxdomain.org: 0, the first has precedence, perhaps you need a NameVirtualHost directive". These correspond to five domains that are not yet reset in external DNS - they are currently redirected to Geocities, but I want to bring them on to my server. On these domains, the TLD is the only difference. Then I get three lines confirming the three domains (localhost and two others) and they are fine. I would assume these warnings will go away as I bring up the rest of the domains in external DNS, or do I still need to learn even more about virtual hosts? |
|
|||
|
On Jan 13, 9:16*am, Davide Bianchi <davideyeahs...@onlyforfun.net>
wrote: > On 2008-01-13, Charles <ccha...@gmail.com> wrote: > > > I have "NameVirtualHost *" set, and I have each virtual host beginning > > as <VirtualHost xxxdomain.tld>. *All other directives and constructs > > are the same for all domains. > > The 'VirtualHost' block has to be the same as the NameVirtualHost to > which he refers, so if you have a * in NameVirtualHost, the VirtualHost > block need to have a * too. > > NameVirtualHost * > > <VirtualHost *> So when I introduce NameVirtualHost domain.com:80 <----------redirected to IP xx.xx.xx.xx in DNS NameVirtualHost domain.net:80 <---------redirected to same xx.xx.xx.xx in DNS NameVirtualHost vanity_domain.net:80 <------------Redirected to IP yy.yy.yy.yy in DNS NameVirtualHost domain.org:80 <------Everthing from here on down redirected to Geocities NameVirtualHost domain.us:80 NameVirtualHost domain.biz:80 NameVirtualHost domain.info:80 And with matching entries in <Virtual Host> lines, I browse to: www.domain.net - www.domain.com web page <--------------domain mismatch is no mistake - the issue www.domain.com - www.domain.com web page vanity_domain.net - vanity_domain.net web page Other domains still redirect to Geocities And httpd -S reports NameVirtualHost domain.net 80 has no VirtualHosts NameVirtualHost domain.org 80 has no VirtualHosts NameVirtualHost domain.us 80 has no VirtualHosts NameVirtualHost domain.biz 80 has no VirtualHosts NameVirtualHost domain.info 80 has no VirtualHosts VirtualHost Configuration: yy.yy.yy.yy is a NameVirtualHost Default Server vanity_domain.net Port 80 NameVHost vanity_domain.net xx.xx.xx.xx is a NameVirtualHost Default Server www.domain.com Port 80 NameVHost www.domain.com Port 80 NameVHost www.domain.net Port 80 NameVHost www.domain.org Port 80 NameVHost www.domain info Port 80 NameVHost www.domain.biz Port 80 NameVHost www.domain.us Do I ned to remove everything in the NameVirtualHost except for the [NameVirtualHost domain.com:80] and the [NameVirtualHost vanity_domain.net:80] entries? FWIW, IP yy.yy.yy.yy is the static address provided by my ISP. It has been provided to my name registrar. IP address yy.yy.yy.yy is [apparently] internal to my ISP. |
|
|||
|
On Jan 14, 6:04*am, Charles <ccha...@gmail.com> wrote:
> On Jan 13, 9:16*am, Davide Bianchi <davideyeahs...@onlyforfun.net> > wrote: > > > On 2008-01-13, Charles <ccha...@gmail.com> wrote: > > > > I have "NameVirtualHost *" set, and I have each virtual host beginning > > > as <VirtualHost xxxdomain.tld>. *All other directives and constructs > > > are the same for all domains. > > > The 'VirtualHost' block has to be the same as the NameVirtualHost to > > which he refers, so if you have a * in NameVirtualHost, the VirtualHost > > block need to have a * too. > > > NameVirtualHost * > > > <VirtualHost *> > > So when I introduce > > NameVirtualHost domain.com:80 * <----------redirected to IP > xx.xx.xx.xx in DNS > NameVirtualHost domain.net:80 * * <---------redirected to same > xx.xx.xx.xx *in DNS > NameVirtualHost vanity_domain.net:80 * * *<------------Redirected to > IP yy.yy.yy.yy in DNS > NameVirtualHost domain.org:80 * *<------Everthing from here on down > redirected to Geocities > NameVirtualHost domain.us:80 > NameVirtualHost domain.biz:80 > NameVirtualHost domain.info:80 > > And with matching entries in <Virtual Host> lines, I browse to: > > www.domain.net-www.domain.comweb page * *<--------------domain > mismatch is no mistake - the issuewww.domain.com-www.domain.comweb page > vanity_domain.net - vanity_domain.net web page > Other domains still redirect to Geocities > > And httpd -S reports > > NameVirtualHost domain.net 80 has no VirtualHosts > NameVirtualHost domain.org 80 has no VirtualHosts > NameVirtualHost domain.us 80 has no VirtualHosts > NameVirtualHost domain.biz 80 has no VirtualHosts > NameVirtualHost domain.info 80 has no VirtualHosts > > VirtualHost Configuration: > yy.yy.yy.yy is a NameVirtualHost > Default Server vanity_domain.net > Port 80 NameVHost vanity_domain.net > > xx.xx.xx.xx is a NameVirtualHost > Default Serverwww.domain.com > > Port 80 NameVHostwww.domain.com > Port 80 NameVHostwww.domain.net > Port 80 NameVHostwww.domain.org > Port 80 NameVHostwww.domaininfo > Port 80 NameVHostwww.domain.biz > Port 80 NameVHostwww.domain.us > > Do I ned to remove everything in the NameVirtualHost except for the > [NameVirtualHost domain.com:80] and the [NameVirtualHost > vanity_domain.net:80] entries? > > FWIW, IP yy.yy.yy.yy is the static address provided by my ISP. *It has > been provided to my name registrar. *IP address yy.yy.yy.yy is > [apparently] internal to my ISP. Let me add one last detail. IP yy.yy.yy.yy has been provided to my name registrar for the IP address for both domain.net and domain.com. |
|
|||
|
"Charles" <cchamb2@gmail.com> wrote in message
news:f923ef0e-08d2-46b6-9716-c4401089a781@e6g2000prf.googlegroups.com... On Jan 14, 6:04 am, Charles <ccha...@gmail.com> wrote: > On Jan 13, 9:16 am, Davide Bianchi <davideyeahs...@onlyforfun.net> > wrote: > > > On 2008-01-13, Charles <ccha...@gmail.com> wrote: > > > > I have "NameVirtualHost *" set, and I have each virtual host beginning > > > as <VirtualHost xxxdomain.tld>. All other directives and constructs > > > are the same for all domains. > > > The 'VirtualHost' block has to be the same as the NameVirtualHost to > > which he refers, so if you have a * in NameVirtualHost, the VirtualHost > > block need to have a * too. > > > NameVirtualHost * > > > <VirtualHost *> > > So when I introduce > > NameVirtualHost domain.com:80 <----------redirected to IP > xx.xx.xx.xx in DNS > NameVirtualHost domain.net:80 <---------redirected to same > xx.xx.xx.xx in DNS > NameVirtualHost vanity_domain.net:80 <------------Redirected to > IP yy.yy.yy.yy in DNS > NameVirtualHost domain.org:80 <------Everthing from here on down > redirected to Geocities > NameVirtualHost domain.us:80 > NameVirtualHost domain.biz:80 > NameVirtualHost domain.info:80 > > And with matching entries in <Virtual Host> lines, I browse to: > > www.domain.net-www.domain.comweb page <--------------domain > mismatch is no mistake - the issuewww.domain.com-www.domain.comweb page > vanity_domain.net - vanity_domain.net web page > Other domains still redirect to Geocities > > And httpd -S reports > > NameVirtualHost domain.net 80 has no VirtualHosts > NameVirtualHost domain.org 80 has no VirtualHosts > NameVirtualHost domain.us 80 has no VirtualHosts > NameVirtualHost domain.biz 80 has no VirtualHosts > NameVirtualHost domain.info 80 has no VirtualHosts > > VirtualHost Configuration: > yy.yy.yy.yy is a NameVirtualHost > Default Server vanity_domain.net > Port 80 NameVHost vanity_domain.net > > xx.xx.xx.xx is a NameVirtualHost > Default Serverwww.domain.com > > Port 80 NameVHostwww.domain.com > Port 80 NameVHostwww.domain.net > Port 80 NameVHostwww.domain.org > Port 80 NameVHostwww.domaininfo > Port 80 NameVHostwww.domain.biz > Port 80 NameVHostwww.domain.us > > Do I ned to remove everything in the NameVirtualHost except for the > [NameVirtualHost domain.com:80] and the [NameVirtualHost > vanity_domain.net:80] entries? > > FWIW, IP yy.yy.yy.yy is the static address provided by my ISP. It has > been provided to my name registrar. IP address yy.yy.yy.yy is > [apparently] internal to my ISP. > Let me add one last detail. IP yy.yy.yy.yy has been provided to my > name registrar for the IP address for both domain.net and domain.com. If you use domain names in nameVirtualHost, they will be resolved to IP addresses first - so, essentially, you have conflicting NamevirtualHost entries. If you have static IP addresses, you should use them in the NameVirtualHost entries: NameVirtualHost yy.yy.yy.yy:80 <VirtualHost yy.yy.yy.yy:80> ServerName domain.net ... </VirtualHost> <VirtualHost yy.yy.yy.yy:80> ServerName domain.com ... </VirtualHost> |
|
|||
|
On Jan 14, 7:21*am, "phantom" <nob...@blueyonder.invalid> wrote:
> "Charles" <ccha...@gmail.com> wrote in message > > news:f923ef0e-08d2-46b6-9716-c4401089a781@e6g2000prf.googlegroups.com... > On Jan 14, 6:04 am, Charles <ccha...@gmail.com> wrote: > > > > > > > On Jan 13, 9:16 am, Davide Bianchi <davideyeahs...@onlyforfun.net> > > wrote: > > > > On 2008-01-13, Charles <ccha...@gmail.com> wrote: > > > > > I have "NameVirtualHost *" set, and I have each virtual host beginning > > > > as <VirtualHost xxxdomain.tld>. All other directives and constructs > > > > are the same for all domains. > > > > The 'VirtualHost' block has to be the same as the NameVirtualHost to > > > which he refers, so if you have a * in NameVirtualHost, the VirtualHost > > > block need to have a * too. > > > > NameVirtualHost * > > > > <VirtualHost *> > > > So when I introduce > > > NameVirtualHost domain.com:80 <----------redirected to IP > > xx.xx.xx.xx in DNS > > NameVirtualHost domain.net:80 <---------redirected to same > > xx.xx.xx.xx in DNS > > NameVirtualHost vanity_domain.net:80 <------------Redirected to > > IP yy.yy.yy.yy in DNS > > NameVirtualHost domain.org:80 <------Everthing from here on down > > redirected to Geocities > > NameVirtualHost domain.us:80 > > NameVirtualHost domain.biz:80 > > NameVirtualHost domain.info:80 > > > And with matching entries in <Virtual Host> lines, I browse to: > > >www.domain.net-www.domain.comwebpage <--------------domain > > mismatch is no mistake - the issuewww.domain.com-www.domain.comwebpage > > vanity_domain.net - vanity_domain.net web page > > Other domains still redirect to Geocities > > > And httpd -S reports > > > NameVirtualHost domain.net 80 has no VirtualHosts > > NameVirtualHost domain.org 80 has no VirtualHosts > > NameVirtualHost domain.us 80 has no VirtualHosts > > NameVirtualHost domain.biz 80 has no VirtualHosts > > NameVirtualHost domain.info 80 has no VirtualHosts > > > VirtualHost Configuration: > > yy.yy.yy.yy is a NameVirtualHost > > Default Server vanity_domain.net > > Port 80 NameVHost vanity_domain.net > > > xx.xx.xx.xx is a NameVirtualHost > > Default Serverwww.domain.com > > > Port 80 NameVHostwww.domain.com > > Port 80 NameVHostwww.domain.net > > Port 80 NameVHostwww.domain.org > > Port 80 NameVHostwww.domaininfo > > Port 80 NameVHostwww.domain.biz > > Port 80 NameVHostwww.domain.us > > > Do I ned to remove everything in the NameVirtualHost except for the > > [NameVirtualHost domain.com:80] and the [NameVirtualHost > > vanity_domain.net:80] entries? > > > FWIW, IP yy.yy.yy.yy is the static address provided by my ISP. It has > > been provided to my name registrar. IP address yy.yy.yy.yy is > > [apparently] internal to my ISP. > > Let me add one last detail. *IP yy.yy.yy.yy has been provided to my > > name registrar for the IP address for both domain.net and domain.com. > > If you use domain names in nameVirtualHost, they will be resolved to IP > addresses first - so, essentially, you have conflicting NamevirtualHost > entries. If you have static IP addresses, you should use them in the > NameVirtualHost entries: > > NameVirtualHost yy.yy.yy.yy:80 > <VirtualHost yy.yy.yy.yy:80> > * ServerName domain.net > * ... > </VirtualHost> > <VirtualHost yy.yy.yy.yy:80> > * ServerName domain.com > * ... > </VirtualHost> So I should have [NameVirtualHost xx.xx.xx.xx:80] and [NameVirtualHost [yy.yy.yy.yy:80] for the two IP involved, and I should also have an IP for each associated VirtualHost directive/block, correct? |
|
|||
|
On Mon, 14 Jan 2008 11:54:22 -0800 (PST), Charles
<cchamb2@gmail.com> wrote: >On Jan 14, 7:21*am, "phantom" <nob...@blueyonder.invalid> wrote: >> "Charles" <ccha...@gmail.com> wrote in message >> >> news:f923ef0e-08d2-46b6-9716-c4401089a781@e6g2000prf.googlegroups.com... >> On Jan 14, 6:04 am, Charles <ccha...@gmail.com> wrote: >> >> >> > On Jan 13, 9:16 am, Davide Bianchi <davideyeahs...@onlyforfun.net> >> > wrote: >> >> > > On 2008-01-13, Charles <ccha...@gmail.com> wrote: >> >> > > > I have "NameVirtualHost *" set, and I have each virtual host beginning >> > > > as <VirtualHost xxxdomain.tld>. All other directives and constructs >> > > > are the same for all domains. >> >> > > The 'VirtualHost' block has to be the same as the NameVirtualHost to >> > > which he refers, so if you have a * in NameVirtualHost, the VirtualHost >> > > block need to have a * too. >> >> > > NameVirtualHost * >> >> > > <VirtualHost *> >> >> > So when I introduce >> >> > NameVirtualHost domain.com:80 <----------redirected to IP >> > xx.xx.xx.xx in DNS >> > NameVirtualHost domain.net:80 <---------redirected to same >> > xx.xx.xx.xx in DNS >> > NameVirtualHost vanity_domain.net:80 <------------Redirected to >> > IP yy.yy.yy.yy in DNS >> > NameVirtualHost domain.org:80 <------Everthing from here on down >> > redirected to Geocities >> > NameVirtualHost domain.us:80 >> > NameVirtualHost domain.biz:80 >> > NameVirtualHost domain.info:80 >> >> > And with matching entries in <Virtual Host> lines, I browse to: >> >> >www.domain.net-www.domain.comwebpage <--------------domain >> > mismatch is no mistake - the issuewww.domain.com-www.domain.comwebpage >> > vanity_domain.net - vanity_domain.net web page >> > Other domains still redirect to Geocities >> >> > And httpd -S reports >> >> > NameVirtualHost domain.net 80 has no VirtualHosts >> > NameVirtualHost domain.org 80 has no VirtualHosts >> > NameVirtualHost domain.us 80 has no VirtualHosts >> > NameVirtualHost domain.biz 80 has no VirtualHosts >> > NameVirtualHost domain.info 80 has no VirtualHosts >> >> > VirtualHost Configuration: >> > yy.yy.yy.yy is a NameVirtualHost >> > Default Server vanity_domain.net >> > Port 80 NameVHost vanity_domain.net >> >> > xx.xx.xx.xx is a NameVirtualHost >> > Default Serverwww.domain.com >> >> > Port 80 NameVHostwww.domain.com >> > Port 80 NameVHostwww.domain.net >> > Port 80 NameVHostwww.domain.org >> > Port 80 NameVHostwww.domaininfo >> > Port 80 NameVHostwww.domain.biz >> > Port 80 NameVHostwww.domain.us >> >> > Do I ned to remove everything in the NameVirtualHost except for the >> > [NameVirtualHost domain.com:80] and the [NameVirtualHost >> > vanity_domain.net:80] entries? >> >> > FWIW, IP yy.yy.yy.yy is the static address provided by my ISP. It has >> > been provided to my name registrar. IP address yy.yy.yy.yy is >> > [apparently] internal to my ISP. >> > Let me add one last detail. *IP yy.yy.yy.yy has been provided to my >> > name registrar for the IP address for both domain.net and domain.com. >> >> If you use domain names in nameVirtualHost, they will be resolved to IP >> addresses first - so, essentially, you have conflicting NamevirtualHost >> entries. If you have static IP addresses, you should use them in the >> NameVirtualHost entries: >> >> NameVirtualHost yy.yy.yy.yy:80 >> <VirtualHost yy.yy.yy.yy:80> >> * ServerName domain.net >> * ... >> </VirtualHost> >> <VirtualHost yy.yy.yy.yy:80> >> * ServerName domain.com >> * ... >> </VirtualHost> > >So I should have [NameVirtualHost xx.xx.xx.xx:80] and [NameVirtualHost >[yy.yy.yy.yy:80] for the two IP involved, and I should also have an IP >for each associated VirtualHost directive/block, correct? You seem to need IP-based virtualhost support. http://httpd.apache.org/docs/2.2/vhosts/ip-based.html I don't think you should use <NameVirtualHost ...> at all. NameVirtualHost is only used when all virtual hosts have the same IP address, but different hostnames. HTH -- ( Kees ) c[_] Everyone is gifted. Some open the package sooner. (#110) |
|
|||
|
On Mon, 14 Jan 2008 11:54:22 -0800 (PST), Charles
<cchamb2@gmail.com> wrote: >correct? And: http://httpd.apache.org/docs/2.2/vho...amples.html#ip -- ( Kees ) c[_] Everyone is gifted. Some open the package sooner. (#110) |
|
|||
|
On Jan 14, 2:04*pm, Kees Nuyt <k.n...@nospam.demon.nl> wrote:
> On Mon, 14 Jan 2008 11:54:22 -0800 (PST), Charles > > <ccha...@gmail.com> wrote: > >correct? > > And:http://httpd.apache.org/docs/2.2/vho...amples.html#ip > -- > *( *Kees > * ) > c[_] Everyone is gifted. Some open the package sooner. *(#110) What I'm trying to do is: Static IP of my router - 209.250.30.45 Port 80 forwarded to 192.168.0.20 localhost served from/at 127.0.0.1 as configuration console vanity_domain.net domain.com domain.net domain.org domain.biz domiain.info domain.us all served from external servers pointing to 209.250.30.45 |
|
|||
|
On Jan 15, 12:44*am, Charles <ccha...@gmail.com> wrote:
> On Jan 14, 2:04*pm, Kees Nuyt <k.n...@nospam.demon.nl> wrote: > > > On Mon, 14 Jan 2008 11:54:22 -0800 (PST), Charles > > > <ccha...@gmail.com> wrote: > > >correct? > > > And:http://httpd.apache.org/docs/2.2/vho...amples.html#ip > > -- > > *( *Kees > > * ) > > c[_] Everyone is gifted. Some open the package sooner. *(#110) > > What I'm trying to do is: > > Static IP of my router - 209.250.30.45 > Port 80 forwarded to 192.168.0.20 > > localhost > served from/at 127.0.0.1 as configuration console > > vanity_domain.net > domain.com > domain.net > domain.org > domain.biz > domiain.info > domain.us > all served from external servers pointing to 209.250.30.45 Pardon me. Resolution is *provided* through external servers all pointing to 209.250.30.45 - served from machine at 192.168.0.20. |
|
|||
|
On Mon, 14 Jan 2008 23:46:31 -0800 (PST), Charles
<cchamb2@gmail.com> wrote: >On Jan 15, 12:44*am, Charles <ccha...@gmail.com> wrote: >> On Jan 14, 2:04*pm, Kees Nuyt <k.n...@nospam.demon.nl> wrote: >> >> > On Mon, 14 Jan 2008 11:54:22 -0800 (PST), Charles >> >> > <ccha...@gmail.com> wrote: >> > >correct? >> >> > And:http://httpd.apache.org/docs/2.2/vho...amples.html#ip >> > -- >> > *( *Kees >> > * ) >> > c[_] Everyone is gifted. Some open the package sooner. *(#110) >> >> What I'm trying to do is: >> >> Static IP of my router - 209.250.30.45 >> Port 80 forwarded to 192.168.0.20 >> >> localhost >> served from/at 127.0.0.1 as configuration console >> >> vanity_domain.net >> domain.com >> domain.net >> domain.org >> domain.biz >> domiain.info >> domain.us >> all served from external servers pointing to 209.250.30.45 > >Pardon me. Resolution is *provided* through external servers all >pointing to 209.250.30.45 - served >from machine at 192.168.0.20. Then this example applies. http://httpd.apache.org/docs/2.2/vho....html#purename Details: http://httpd.apache.org/docs/2.2/vhosts/name-based.html But I'm sure you read all thast already. Those examples really work. -- ( Kees ) c[_] Humans believe they are devils pretending to be angels when, in fact, the reverse is true. (#323) |