[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 08:10:01PM +1000, getadog wrote:
> On Wed, Jun 27, 2001 at 06:56:07PM +1000, Mike Lake wrote:
> > 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 ?
> > .........
> > Im a little confused between the server name and hostname.
 
> If you set a ServerName and UseCanonicalName On apache will redirect 
> your browser to what ever you set your ServerName to. 
> If you don't  set a ServerName and set UseCanonicalName On apache will 
> redirect your browser to `hostname -f`. 
> If you set UseCanonicalName Off (Commenting it out turned it on for me), 
> apache won't redirect you at all.
> 
> I think its easier to see whats happening with wget -S localhost/~mikel,

getadog suggested I try different combinations to see what happens - an
excellent way to learn :-)
Basically I tried all the combinations in httpd.conf with
ServerName/UseCanonical and used wget to see the what reponded. 
Put the output to a file and pretty printed and read it on the train.
Yeah Fun :-) I wont put the results here as its toooo long.

Also used ping and the browser to try to resolve localhost and b4114a while
doing a tcpdump -i lo and saved the output for each case.
Have learnt a lot about how to use tcpdump and ping and wget to see whats
being resolved to where and by whom.

> Your source address changes depending on which interface you are pinging.
Can see that sort of but still have to try and work out what I should have
for that setting. 

> What I think was happening was you were pointing your browser to
> http://localhost/~mikel, and apache was redirecting it to 
> http://mycomputername/~mikel, so when your browser tried to go to 
> http://mycomputername/~mikel, it used as its soucre ip address 
> mycomputername, which was denied.

> Clear as mud? :)
yep. I must say Im still a little confused but will have a play around more.

Just to fill you in on why I am doing this; I wrote a kinetics experiment
last year for the UTS Chemisty Dept which does a monte carlo simulation of
some reactions for the students to play with. Gets 8 students out of the lab
for 3 hours / week. It all ran from my RedHat Linux box with 32Meg RAM and
was used by 8 students, accessing it via Netscape from Windows PC's.

This year it will run again but I am changing it so it can be more easily
installed and run from any server. I had lots of hard coded server
specific stuff in it. It will now run from a Debian distro which put Apache 
things in different places to RedHat. My chnages will make it easier for
others to install it and for me to maintain it.

Mike
-- 
Do you think that when they asked George Washington for ID that he just whipped out a quarter? -- Steven Wright

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