[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SLUG] Apache: why doesn't "allow from localhost work" ?



On Wed, Jun 27, 2001 at 06:25:30PM +1000, getadog wrote:
> On Wed, Jun 27, 2001 at 06:16:07PM +1000, Mike Lake wrote:
> > When I point it at http://localhost/~mikel I get 
> > "Forbidden You don't have permission to access /~mikel on this server."
> > AND the URL in the browser changes to:
> >         http://mycomputername.mydomain.edu.au/~mikel/
 
> In your apache configuration search for UseCanonicalName 
> and set it to off. Comments in the file explain what it means.

AH! thats it.  http://localhost/~mikel now access my public_html directory
with "allow from localhost". I can now convert all iinstances of my own 
static addr in the access file to localhost.

# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a url that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGIs.
#UseCanonicalName on

So if I was using 'localhost' which is refering to a URL that the request
comes from then it would use ServerName:Port ie b4114:80 ?
(Real names here now.)
With it off (ie just now I commented it out) what would it use as
hostname for me gives b4114
Im a little confused between the server name and hostname.

This machine here has name b4114 but its not listed in the Unis DNS.
I have 
#ServerName new.host.name
of course commented out.

> > Dont really follow about the binding.
> > I understand about mapping to an address if it can loo up an addr from a
> > name but not the bit about the "from" bit. 
> 
> try tcpdump -i lo then point your browser to http://localhost/
> and then http://mycomputername. Look at how your source
> address changes depending on which address you point your browser
> to.

Thats excellent. Yep run as root I can see it shows all the packets on the
local interface and dumps lots when you use the browser at http://localhost
etc. I'll have a play and see the diff with b4114. 

Mike
-- 
The future is a myth created by insurance salesmen and high school counselors.

Michael Lake, University of Technology, Sydney
Work: Mike.Lake@nospam.uts.edu.au Ph: 02 9514 1724 Fx: 02 9514 1628 
Home: http://www.speleonics.com.au
Linux enthusiast, active caver and interested in anything technical.
               ***************************************



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug