DBY
Who's Online
0 registered (), 4 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Latest Photo Gallery
light pole in the water
Eastern State Penitentiary - Philadelphia
Top Posters (30 Days)
Doorslammer 12
Anartist 10
HarryB 7
Dough 4
m2h 4
Goofy 4
DirtDart 3
firebane 3
Nightowl 3
ProdigalSon 2
Topic Options
#171541 - 12/09/09 06:11 PM testing remote redirects from local network?
Mr_Blog Offline
human

Registered: 06/06/01
Posts: 13759
Loc: ${PWD}
I've been working on a web server on my home machine that splits the root directory to be in one place if you connect from the local network and another if you're connecting remotely.

What would be the easiest way to connect to the server locally but appear to be a remote connection? I'm trying to run some security tests and validate the html/css as if I were a remote visitor, but it always comes up as a local connection.

Do I need to set up a proxy for this?

I'm running lighttpd, which has configuration very similar to apache.

I'm using the Firefox web developer extension to validate, and I've found I can fail the initial connection and then manually replace the local root with my external IP address in the generated URL to run those tests, but that's annoying.

I can also temporarily change the server root in the lighty config, of course, but that is also annoying.
_________________________
( o_
/ >) My 84-year-old non-techy mom uses Debian Linux. It ain't that hard.

Top
#171542 - 12/09/09 11:57 PM Re: testing remote redirects from local network? [Re: Mr_Blog]
m2h Offline
Mister Troller

Registered: 06/12/01
Posts: 10638
Loc: Toronto, Canada
Generally what I do when I need to test something like in your situation. I go use a free proxy, or setup a proxy.
_________________________
Rollergettes
Edit: my ignorance is my downfall.

Top
#171891 - 12/30/09 01:46 PM Re: testing remote redirects from local network? [Re: Mr_Blog]
HarryB Offline
ghast hacker

Registered: 06/10/01
Posts: 18803
Loc: $$
you could just go out through your router and back in.
that means you have to forward ports in your router to your webserver.
other option get a second router on your lan and put the server behind it.
_________________________
I got your salvation b*tch I learned a valuable lesson that night. If you're going to try to fly a bicycle, you'd better make sure E.T is sittin' in your basket instead of a twelve pack of beer

Top
#171894 - 12/30/09 06:17 PM Re: testing remote redirects from local network? [Re: HarryB]
Mr_Blog Offline
human

Registered: 06/06/01
Posts: 13759
Loc: ${PWD}
Again I forgot to come back to a post I started =op

I ended up temporarily changing the server config to redirect local access to the remote site, so w3c would see it as the router's IP instead of 192.168...

I just got back onto a dynDNS service, though, so I don't think it's ideal to change the server config every time I want to verify the code =op

Quote:
you could just go out through your router and back in.
that means you have to forward ports in your router to your webserver.
I think that's what I'm already doing...I've got port 80 being forwarded to the server. However, My current server is also localhost. Everything I've tried from this machine has resolved to the local server, except when I change the server's config to move the root according to IP. If I use the dynDNS address to access the server I'm seen as 192.168.1.101, and if I use localhost I'm seen as 127.0.0.1.
If I use the dynDNS address from another machine on the network (192.168.1.100), it sees the same as if it were pointed to the local server (192.168.1.101)
_________________________
( o_
/ >) My 84-year-old non-techy mom uses Debian Linux. It ain't that hard.

Top
#172039 - 01/07/10 10:11 AM Re: testing remote redirects from local network? [Re: Mr_Blog]
Mr_Blog Offline
human

Registered: 06/06/01
Posts: 13759
Loc: ${PWD}
It turns out to have been a very simple fix: /etc/hosts

I accidentally stumbled on something I didn't know before, when I used my computer's hostname to access the site rather than localhost or 192.168.1.101 and was redirected to the external website.

I always assumed 127.0.0.1 was the one and only localhost IP, and since the server's config checks for 127.0.0.? it was weird to see it redirect. Then I looked in the hosts file and saw that Debian had assigned my hostname to 127.0.1.1 (keeping the traditional 127.0.0.1 localhost).

All I had to do was add a line linking my dynDNS name to 127.0.1.2. Now I can access the LAN server through localhost, and the external server through the dynDNS name, and when I validate the code for the external site from within firefox the domain that w3c sees is no longer bungle or localhost or 192.168.1.101
_________________________
( o_
/ >) My 84-year-old non-techy mom uses Debian Linux. It ain't that hard.

Top



Moderator:  Doorslammer, Nightowl, NightShade, Rez 
Shout Box

Today's Birthdays
No Birthdays
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29