You are not logged in.

#1 2003-12-19 04:37:56

red_over_blue
Member
Registered: 2003-07-19
Posts: 152

Connection refused to my own server :(

I have had this problem ever since I started serving up my own web pages using apache, even when I wasn't using Arch Linux.

First, some background info.

1.  I am behind a router.  The router gets my WAN IP addy from my ISP via DCHP.

2.  My LAN IP addy is 192.168.0.2

3.  There is a mac on the LAN, IP 192.168.0.3

4.  The URL to my web-server is http://26rca.zapto.org

5.  I use a re-direct service from noip.com to forward requests for http://26rca.zapto.org to whatever my WAN IP addy happens to be (updated with a client I run locally).


Now, the problem.  If I open a web-browser and type 192.168.0.2 for a url, then I get my web page served.  If I type http://26rca.zapto.org, I get "could not connect to remote server".  The same occurs on the mac.

My workaround to this point has been to add the following to /etc/hosts:

192.168.0.2    26rca.zapto.org         limbo

However, I am now trying to use virtual hosts with apache, and things are starting to get ugly.  I can't trouble shoot very well because I can't even narrow down where the problems are.  So, why does this happen?  What can I do to resolve this issue?

Thanks for taking the time to read this.  I am by no means an apache guru, and only do it for fun.


Don't forget to post your PKGBUILD in your thread when you announce a new package in incoming.
see HERE for details

Offline

#2 2003-12-19 05:54:12

tsykoduk
Member
From: A Chair
Registered: 2003-10-31
Posts: 48
Website

Re: Connection refused to my own server :(

Here are some things that I would try...

Dig the URL from an inside machine. Try and ping the address that dig comes up with. I think that you might be seeing issues with the firewall - blocking requests that are starting inside and coming back inside.

Lemme know what comes of the test, and I will put my thinking cap on. smile

(Not an apache guru, but a LAN/WAN guy)

Offline

#3 2003-12-19 06:05:53

red_over_blue
Member
Registered: 2003-07-19
Posts: 152

Re: Connection refused to my own server :(

Thank you very much for your reply.

I executed dig, and then a bash script I have which resolved the WAN IP addy of my router.  I then pinged that IP addy, and everything seems ok in that regard.

[root@limbo john]# dig 26rca.zapto.org

; <<>> DiG 9.2.2-P3 <<>> 26rca.zapto.org
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27983
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;26rca.zapto.org.               IN      A

;; ANSWER SECTION:
26rca.zapto.org.        37      IN      A       207.161.57.155

;; Query time: 3 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Fri Dec 19 00:10:57 2003
;; MSG SIZE  rcvd: 49

[root@limbo john]# whatismyip
207.161.57.155
[root@limbo john]# ping 207.161.57.155
PING 207.161.57.155 (207.161.57.155) 56(84) bytes of data.
64 bytes from 207.161.57.155: icmp_seq=1 ttl=250 time=1.64 ms
64 bytes from 207.161.57.155: icmp_seq=2 ttl=250 time=0.689 ms
64 bytes from 207.161.57.155: icmp_seq=3 ttl=250 time=0.695 ms

--- 207.161.57.155 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.689/1.009/1.643/0.448 ms
[root@limbo john]# 

Don't forget to post your PKGBUILD in your thread when you announce a new package in incoming.
see HERE for details

Offline

#4 2003-12-19 06:21:50

tsykoduk
Member
From: A Chair
Registered: 2003-10-31
Posts: 48
Website

Re: Connection refused to my own server :(

Hmmmmm....

Ok.. so you can ping the WAN port on your router/firewall.. I would try a verbose telnet session to that IP addy on port 80 next. (late, and I canna think - G/F is saying bed.. who am I to argue?)  :twisted:

I will check back in the AM.

Offline

#5 2003-12-19 06:23:30

tsykoduk
Member
From: A Chair
Registered: 2003-10-31
Posts: 48
Website

Re: Connection refused to my own server :(

try

telnet -n<tracefilename> <ip>:80

smile

Offline

#6 2003-12-19 06:43:10

red_over_blue
Member
Registered: 2003-07-19
Posts: 152

Re: Connection refused to my own server :(

Thanks again... I like how you snuck that last post in after admitting you should go to bed... sounds like me and my g/f smile

I hope this info is useful for you:

[john@limbo temp]$ whatismyip
207.161.57.155
[john@limbo temp]$ telnet -n log 207.161.57.155 80
Trying 207.161.57.155...
telnet: Unable to connect to remote host: Connection refused
[john@limbo temp]$ file log 
log: empty
[john@limbo temp]$ telnet 192.168.0.2 80
Trying 192.168.0.2...
Connected to 192.168.0.2.
Escape character is '^]'.

Don't forget to post your PKGBUILD in your thread when you announce a new package in incoming.
see HERE for details

Offline

#7 2003-12-19 07:04:00

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Connection refused to my own server :(

NAT doesn't work from an internal machine trying to access a forwarded port from the outside.  At that point it's trying to masq the packets that are coming to itself... I'm confused just thinking about it.

You gotta connect from outside the network.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#8 2003-12-19 10:53:34

Gyroplast
Member
From: Germany
Registered: 2002-09-03
Posts: 166
Website

Re: Connection refused to my own server :(

Xentac named the problem, and you already employed the (nearly) cleanest solution. You cannot fiddle with static routes due to your dynamic WAN IP, so all you can really do is making sure you are connecting to your local Apache, well, locally, but still using the "Internet" address. It'd be a tad nicer if you were using a DNS server in your LAN, but since we're talking about 2 machines here, it's hardly a problem to set the hosts file on each.

Either way, you should not have problems with your virtual host setup because of that. It's entirely transparent to Apache, _unless_ you unknowledgably tinker with access controls or IP restrictions, which is in itself kinda pointless unless you know what you're doing.

So, maybe you should just experiment a bit more and make sure you understand Apache's docs on this topic, and much will get clearer over time. I'm sure we can help you with concrete problems here as well. smile

Dennis


"That's the problem with good advice. Nobody wants to hear it."
-- Dogbert

Offline

#9 2003-12-19 14:38:44

red_over_blue
Member
Registered: 2003-07-19
Posts: 152

Re: Connection refused to my own server :(

Ok,


Thanks everyong for all your help.  I tried describing this problem on #apache when I first started tinkering with web-serving, and they talked to me like I had a toaster for a head.

As long as it is not a "problem", I am happy.  Networking is not my forte smile


Don't forget to post your PKGBUILD in your thread when you announce a new package in incoming.
see HERE for details

Offline

Board footer

Powered by FluxBB