You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by gb1071nx <gb...@globallyboundless.com> on 2007/09/27 19:52:15 UTC

[users@httpd] Altering what the internet (but not intranet) sees for a vhost

I've looked at the deny/allow but that doesn't seem really right.  I
don't want to deny access to a vhost, if you're from the internet. I
want to change what you're seeing. 

My scenario is that I'm doing maintenance on a website, and so I still
need to be able to access it from "inside the building", but everyone
else in the world should see a temporary page stating "the site is down
for maintenance".  
 
I'm just not finding the right part of the docs, I think.  Can anyone
give a hint? 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Altering what the internet (but not intranet) sees for a vhost

Posted by Joshua Slive <jo...@slive.ca>.
On 9/27/07, gb1071nx <gb...@globallyboundless.com> wrote:
> Thanks Joshua,
>
> >
> > There are lots of different ways to do this. Here's a
> > relatively simple one:
> >
> > <Location />
> > Order deny,allow
> > Deny from all
> > Allow from intranet.example.com
> > ErrorDocument 403 /underconstruction.html
> > </Location>
>
> When I try this, and via a connection to the outside world, try to
> access the site, I get:
>
>
> -| Forbidden
> -| You don't have permission to access / on this server.
> -|
> -| Additionally, a 403 Forbidden error was encountered while trying to
> -| use an ErrorDocument to handle the request.
>
>
> If I "Deny from all" the "/" Location, does that mean that I can't
> server the ErrorDocument from there either?

Yah, ok. I thought it wouldn't apply to the subrequest. There are lots
of ways to get around this too, including putting the following AFTER
the first <Location> block:
<Location /underconstruction.html>
Allow from all
</Location>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Altering what the internet (but not intranet) sees for a vhost

Posted by gb1071nx <gb...@globallyboundless.com>.
Thanks Joshua,
 
> 
> There are lots of different ways to do this. Here's a 
> relatively simple one:
> 
> <Location />
> Order deny,allow
> Deny from all
> Allow from intranet.example.com
> ErrorDocument 403 /underconstruction.html 
> </Location>

When I try this, and via a connection to the outside world, try to
access the site, I get: 


-| Forbidden
-| You don't have permission to access / on this server.
-| 
-| Additionally, a 403 Forbidden error was encountered while trying to 
-| use an ErrorDocument to handle the request.


If I "Deny from all" the "/" Location, does that mean that I can't
server the ErrorDocument from there either? 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Altering what the internet (but not intranet) sees for a vhost

Posted by Joshua Slive <jo...@slive.ca>.
On 9/27/07, gb1071nx <gb...@globallyboundless.com> wrote:
>
> I've looked at the deny/allow but that doesn't seem really right.  I
> don't want to deny access to a vhost, if you're from the internet. I
> want to change what you're seeing.
>
> My scenario is that I'm doing maintenance on a website, and so I still
> need to be able to access it from "inside the building", but everyone
> else in the world should see a temporary page stating "the site is down
> for maintenance".
>
> I'm just not finding the right part of the docs, I think.  Can anyone
> give a hint?

There are lots of different ways to do this. Here's a relatively simple one:

<Location />
Order deny,allow
Deny from all
Allow from intranet.example.com
ErrorDocument 403 /underconstruction.html
</Location>

Alternatively, you could use mod_rewrite, or, if you dedicate a
different IP address to the server for intranet and internet
connections, you could put each in a different <VirtualHost>.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org