This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
From: "fnord" <fnord@no.spam.dammit.lastfoot.com> Subject: hostsallow or hostsdeny on name-based virtual hosts with Apache? Date: Tue, 12 Sep 2000 21:11:01 GMT I'm trying to allow only certain IP addresses to access one of the name-based virtual hosts on some of our servers, and the Apache docs only list these directives in the docs: a.. <VirtualHost> a.. NameVirtualHost a.. ServerName a.. ServerAlias a.. ServerPath Is there a HostsAllow or HostsDeny directive for each virtual host? thanks, fnord Path: nntp.stanford.edu!newsfeed.stanford.edu!arclight.uoregon.edu!vixen.cso.uiuc.edu!news.indiana.edu!not-for-mail From: adam <amcfarre@indiana.edu> Newsgroups: comp.infosystems.www.servers.unix Subject: Re: hostsallow or hostsdeny on name-based virtual hosts with Apache? Date: Tue, 12 Sep 2000 16:21:37 -0500 Organization: Indiana University, Bloomington Lines: 31 Message-ID: <39BE9E61.B190EDB0@indiana.edu> References: <FZwv5.6301$zC.291582@newsread2.prod.itd.earthlink.net> NNTP-Posting-Host: scrambler.ucs.indiana.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en Xref: nntp.stanford.edu comp.infosystems.www.servers.unix:87554 Go to: http://www.apache.org/docs/misc/tutorials.html and look through some of the security tutorials. Look especially for information on .htaccess files, or the options you can put in the <Directory> blocks. Also look under: http://www.apache.org/docs/mod/directives.html especially at the Allow and Deny directives. There's lots of ways to do what you want. -adam fnord wrote: > > I'm trying to allow only certain IP addresses to access one of the > name-based virtual hosts on some of our servers, and the Apache docs only > list these directives in the docs: > > a.. <VirtualHost> > a.. NameVirtualHost > a.. ServerName > a.. ServerAlias > a.. ServerPath > > Is there a HostsAllow or HostsDeny directive for each virtual host? > > thanks, > fnord Path: nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: themishamargolis@my-deja.com Newsgroups: comp.infosystems.www.servers.unix Subject: Apache: blocking virtual hosts Date: Wed, 20 Sep 2000 13:26:11 GMT Organization: Deja.com - Before you buy. Lines: 32 Message-ID: <8qadsr$i75$1@nnrp1.deja.com> NNTP-Posting-Host: 194.2.0.22 X-Article-Creation-Date: Wed Sep 20 13:26:11 2000 GMT X-Http-User-Agent: Mozilla/4.7 [en] (X11; I; Linux 2.2.14-15mdk i686) X-Http-Proxy: 1.0 proxy.oleane.net:8080 (Squid/2.2.STABLE4), 1.0 x57.deja.com:80 (Squid/1.1.22) for client 194.2.154.34, 194.2.0.22 X-MyDeja-Info: XMYDJUIDthemishamargolis Xref: nntp.stanford.edu comp.infosystems.www.servers.unix:87905 Hello, I can't figure out one thing about apache. I have a host with one IP address. It has 3 name aliases: regular.gnc.com service.gnc.com secure.gnc.com I want to serve only when referenced by regular.gnc.com and service.gnc.com So I created two virtual hosts. One for regular and one for service. Yet, when I type http://secure.gnc.com, which is not listed anywhere, I get served, as if I requested regular.gnc.com. So, is there anyway to prevent that. Or, even better to redirect all requests to http://secure.gnc.com to https://secure.gnc.com (without mod_rewrite hopefully). Thank you, Misha Sent via Deja.com http://www.deja.com/ Before you buy. Path: nntp.stanford.edu!newsfeed.stanford.edu!uchinews!vixen.cso.uiuc.edu!news.indiana.edu!not-for-mail From: adam <amcfarre@indiana.edu> Newsgroups: comp.infosystems.www.servers.unix Subject: Re: Apache: blocking virtual hosts Date: Wed, 20 Sep 2000 08:54:48 -0500 Organization: Indiana University, Bloomington Lines: 42 Message-ID: <39C8C1A8.2303738F@indiana.edu> References: <8qadsr$i75$1@nnrp1.deja.com> NNTP-Posting-Host: scrambler.ucs.indiana.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en Xref: nntp.stanford.edu comp.infosystems.www.servers.unix:87910 Probably lots of ways, One would be to create another Namebased VirtualHost for secure.gnc.com and put a RedirectMatch rule in: RedirectMatch (.*) https://secure.gnc.com/$1 (only requires mod_alias, which you probably already have) -adam themishamargolis@my-deja.com wrote: > > Hello, > > I can't figure out one thing about apache. > I have a host with one IP address. > It has 3 name aliases: > > regular.gnc.com > service.gnc.com > secure.gnc.com > > I want to serve only when referenced by > regular.gnc.com and service.gnc.com > > So I created two virtual hosts. One for regular > and one for service. > > Yet, when I type http://secure.gnc.com, which > is not listed anywhere, I get served, as if > I requested regular.gnc.com. > > So, is there anyway to prevent that. Or, even > better to redirect all requests to > http://secure.gnc.com to https://secure.gnc.com > (without mod_rewrite hopefully). > > Thank you, Misha > > Sent via Deja.com http://www.deja.com/ > Before you buy. Path: nntp.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!news-out.uswest.net!news.uswest.net.POSTED!not-for-mail From: "Michael Josephson" <mjosephson@navicare.com> Newsgroups: comp.infosystems.www.servers.unix References: <8qadsr$i75$1@nnrp1.deja.com> Subject: Re: Apache: blocking virtual hosts Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <qC7y5.579$zo2.185025@news.uswest.net> Date: Wed, 20 Sep 2000 13:47:33 -0500 NNTP-Posting-Host: 63.226.180.94 X-Trace: news.uswest.net 969475606 63.226.180.94 (Wed, 20 Sep 2000 13:46:46 CDT) NNTP-Posting-Date: Wed, 20 Sep 2000 13:46:46 CDT Xref: nntp.stanford.edu comp.infosystems.www.servers.unix:87925 This should work, too: <VirtualHost 12.34.56.78> ServerName gnc.com ServerAlias regular.gnc.com service.gnc.com ... </VirtualHost> hth, Michael <themishamargolis@my-deja.com> wrote in message news:8qadsr$i75$1@nnrp1.deja.com... > Hello, > > I can't figure out one thing about apache. > I have a host with one IP address. > It has 3 name aliases: > > regular.gnc.com > service.gnc.com > secure.gnc.com > > I want to serve only when referenced by > regular.gnc.com and service.gnc.com > > So I created two virtual hosts. One for regular > and one for service. > > Yet, when I type http://secure.gnc.com, which > is not listed anywhere, I get served, as if > I requested regular.gnc.com. > > So, is there anyway to prevent that. Or, even > better to redirect all requests to > http://secure.gnc.com to https://secure.gnc.com > (without mod_rewrite hopefully). > > Thank you, Misha > > > > > Sent via Deja.com http://www.deja.com/ > Before you buy.