LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   cannot access server over internet after successful installation of apache2 (http://www.linuxquestions.org/questions/linux-server-73/cannot-access-server-over-internet-after-successful-installation-of-apache2-622988/)

karazy-k 02-22-2008 05:00 AM

cannot access server over internet after successful installation of apache2
 
I am newb to the home server, so please bear with me.

I am running Fedora 8 and installed apache2 manually. I know it installed correctly and is running, because I see the "It Works!" html page on my server's own browser when at the url "localhost". I am also pointed towards the "It Works!" page if I enter my server's IP address from another computer on my network, so it works on my LAN, too.

I have also configured my router to forward port 80 to my server. I should note that my router has assigned a static IP address based on my server's MAC address to my server.

Furthermore, I have also checked to see whether or not my ISP has port 80 opened by a test done at .canyouseeme.org

I have checked my server's firewall and confirmed that port 80 is not being blocked there either.

I have checked the access.log and error.log, but there isn't an obvious answer there. The error log is empty and the access log documents the times I connected through my network.

Whenever I enter my server's IP as a url, my browser times out.

In summary, apache2 is working on my LAN, but not on the internet.

Does anyone know how to fix this problem?

Thank you,
Kyle

acid_kewpie 02-22-2008 05:15 AM

well do you have any dns set up? what url are you using? can you resolve / ping the box by hostname remotely at all?

karazy-k 02-22-2008 05:43 AM

Dear Chris,

I don't quite understand everything you are asking, but I will answer to the best of my abilities.

I do not have a DNS setup. I was planning on only using the IP my ISP gave me, so I guess my url is my IP address.

I do not know how to remotely ping my box by hostname. Could you please explain this process and also what this method would tell us about my problem.

Thanks,
Kyle

acid_kewpie 02-22-2008 06:21 AM

ahh, i thought you said you *could* reach it by ip. my mistake.

on the server, run "tcpdump -n port 80" and then try again from the remote location. if you see anything coming in from the connection attempt then there's somethign on the linux side, if you see nothing then it's on your router.

karazy-k 02-22-2008 06:55 AM

Dear Chris,

Thank you for your advice. I have done as your said and ran "tcpdump -n port 80". While running I attempted to connect to the server through my browser and I did get some information on my terminal.

Periodically a couple of lines of numbers the contained the IP address of my ISP and the IP address my router assigned my computer appeared. I got results like this when I tried to access my server from my server's browser and another computer's browser.

I believe I understand why I can access my server's homepage from my LAN too. When I ran the tcpdump and then connected through my LAN I instantly pulled up my server's homepage, but nothing appeared on the terminal. Does that mean computers on the same network don't need to use port 80?

You mentioned that this would mean the problem is on the Linux side. I agree. I don't know where to go from here. Do you have any more advice? Would it help if I sent the text from my terminal after I run tcpdump?

Thanks,
Kyle

acid_kewpie 02-22-2008 06:58 AM

well can you show us the info? quite possible you have a software firewall on the linux box maybe. and port 80 will *always* be used, nothign special about a lan connection as far as the server is concerned.

karazy-k 02-22-2008 01:49 PM

Dear Chris,

Here what tcpdump gathers.

[root@localhost ~]# tcpdump -n port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
10:46:30.725817 IP 192.168.1.6.55761 > 209.132.176.122.http: S 3583241640:3583241640(0) win 5840 <mss 1460,sackOK,timestamp 72617256 0,nop,wscale 5>
10:46:30.772824 IP 209.132.176.122.http > 192.168.1.6.55761: S 3052579816:3052579816(0) ack 3583241641 win 5792 <mss 1380,sackOK,timestamp 647780817 72617256>
10:46:30.772904 IP 192.168.1.6.55761 > 209.132.176.122.http: . ack 1 win 5840 <nop,nop,timestamp 72617303 647780817>
10:46:30.772986 IP 192.168.1.6.55761 > 209.132.176.122.http: P 1:526(525) ack 1 win 5840 <nop,nop,timestamp 72617303 647780817>

karazy-k 02-22-2008 09:08 PM

Dear Chris,

I have an update. I believe the problem is actually with the router and port forwarding. It turns out that whenever look my IP address up in a browser using the internet from some outside location apache is working. Therefore, there really isn't a problem anymore.

However, I am curious as to what is really going on.

To recap. I can apache works from my server at localhost, at any other computer on my network using the IP designated by my router, and any computer outside of my network with an internet connection.

I cannot however use the IP my ISP gave me from within my network to connect to my server. I'm not sure why, but this definitely makes me think it is a router issue. If you can explain this I'd love to know what is going on.

Thanks,
Kyle

acid_kewpie 02-23-2008 03:22 AM

right, you can't use your public IP from inside your network as it's the IP of the router, not your server. ip forwards only work on the outside, not the inside, as normally if you were to have it working inside, then you'd not be able to reach the web interface on the adsl router etc..

midisite 08-18-2008 07:17 AM

I just joined this forum cause the last post p!55ed me off.

Why do people come on to these things and talk rubbish about things they know nothing about?

Of course a router can port forward from an inside host. I run several large websites, and I can access each and every one of them from inside my network using my domain name (which resolves to my outside IP address). I can also access using IP address but using Name Based Virtual Hosting, I would only see the default site this way.

You were definitely right Kyle. This will be an issue with your router settings. I you still have the problem, let us know what router you are using.

Paul.


All times are GMT -5. The time now is 04:47 PM.