Page 1 of 1

web server rpi

Posted: Tue Oct 01, 2013 2:16 am
by gingerino
Hi...I've just installed apache server on my pi...i've signup in two ddns service (noip and dtdns) for an external static ip...I've configured my technicolor tg852n (fastweb) router for port forwarding (80 87).In locale access from any computer is ok, I reach the IT WORKS page of the server, but from external access the page doesn't charge....
HELP....

Re: web server rpi

Posted: Tue Oct 01, 2013 5:07 pm
by T3am5hark
Not sure what your port forwarding setup is, but many ISPs block external access to port 80 for several reasons. I would recommend starting with another non-standard port (like 8181 or something) and have your router forward that to your pi's LAN IP. So if your pi is on 192.168.1.100 (just for example), set up the router to forward port 8181 to 192.168.1.100:80 (you could use a different port for the web server to listen on as well if you have a reason to do so).

I usually recommend that people first try setting this up without ddns services to start with. In the 8 months since I've had my pi hosting a web server and SSH via port forwarding, my ISP (cable provider) has not changed my IP address once (of course YMMV). In any case, I suggest getting it working without a ddns service first before shelling out $$ and adding another potential failure point.

Re: web server rpi

Posted: Tue Oct 01, 2013 7:14 pm
by gingerino
ok sorry i wrote in a incorrect mode about my port forwarding.I wanted to say that i've tried to setup router forwarding in port 80before and in an unusual port after 87.The situation doesn't change, in local net it's all ok, but from outside i can't reach pi server.
thank you for the answer.

Re: web server rpi

Posted: Tue Oct 01, 2013 7:20 pm
by gingerino
just now i've tried to look i my ip isn't change since the last one router reboot (tonight)....yes it's changed....so the service for ddns it's mandatory...

Re: web server rpi

Posted: Tue Oct 01, 2013 7:25 pm
by gingerino
furthermore there's an option in my configuration router page that allow to bypass firewall and NAT rules by inserting local address of a particular device(pi server)

Re: web server rpi

Posted: Wed Oct 02, 2013 12:50 am
by klricks
Try an online port scan tool like this to see if your port is really open.
http://www.t1shopper.com/tools/port-scan/
If your router is configured properly AND your ISP is not blocking then the problem may be in your Apache config.
Also check that a firewall is not blocking port access.

Re: web server rpi

Posted: Wed Oct 02, 2013 7:08 am
by gingerino
thanks..tonight i've tried to scan my ports and the scanner said that are filtered...

Re: web server rpi

Posted: Wed Oct 02, 2013 7:41 am
by lucdig
Try to set not well-know ports instead of 80 and 87, e.g. ports > 1024 excluding 8080

Re: web server rpi

Posted: Wed Oct 02, 2013 7:44 pm
by chilinski
And remember that you might have iptables blocking all incoming traffic external to your LAN.

Re: web server rpi

Posted: Wed Oct 02, 2013 10:15 pm
by gingerino
was really easy i had to ask to my ISP to fix a public ip for me. Thanks to all...

Re: web server rpi

Posted: Sat Dec 28, 2013 2:05 am
by PIsingh
gingerino wrote:was really easy i had to ask to my ISP to fix a public ip for me. Thanks to all...
Could you explain that what you mean by that? I am having the same problem you were having. I put my raspberry pi IP over my network in a browser every thing works fine, but when i to access it out of my network, i can connect to the server.
BTW i went to that site http://www.t1shopper.com/tools/port-scan/
this is what the result i get
<<<<Scanning ports on 10.0.0.20
The host name or IP address you entered "10.0.0.20" is not publicly routable on the Internet.
Please enter either a hostname that resolves to a publicly routable IP address or an IPv4 publicly routable IP address.>>>>>
I have also went into my router and port forwaded the port 80, I have comcast xfinity router.
What should i do?

Re: web server rpi

Posted: Sat Dec 28, 2013 6:19 am
by klricks
PIsingh wrote:
gingerino wrote:was really easy i had to ask to my ISP to fix a public ip for me. Thanks to all...
Could you explain that what you mean by that? I am having the same problem you were having. I put my raspberry pi IP over my network in a browser every thing works fine, but when i to access it out of my network, i can connect to the server.
BTW i went to that site http://www.t1shopper.com/tools/port-scan/
this is what the result i get
<<<<Scanning ports on 10.0.0.20
The host name or IP address you entered "10.0.0.20" is not publicly routable on the Internet.
Please enter either a hostname that resolves to a publicly routable IP address or an IPv4 publicly routable IP address.>>>>>
I have also went into my router and port forwaded the port 80, I have comcast xfinity router.
What should i do?
Is the address 10.0.0.20 what you typed in or was it what the web site found?

If the Internet IP is in the private IP ranges shown below then you can't have a web server (external). Nobody on the outside will be able to find your web server even if you attempt to port forward:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255

Some ISP's especially 'broadband' 4G etc, do not give you a public IP. You can go to your ISP and ask for a public IP... some will and some won't /can't. If they do, you probably will have to pay an extra fee.

Re: web server rpi

Posted: Sat Dec 28, 2013 10:34 am
by Richard-TX
It sounds like you have a firewall/router and a NAT to access the internet from your internal 10.n.n.n network. What you need to do is to advertise the external IP address of your firewall via DNS and then reverse proxy to your raspberry pi using squid.

Re: web server rpi

Posted: Sun Dec 29, 2013 10:26 am
by PIsingh
So i got it to work, it was quite silly BTW, i was typing my IP address on my phone, but what i should have been doing, is typing the ip address of my router. As i have used port forward by logging into my router, and added the server service with the pi IP address, with opening the port 8080 on the router. And finally had everything working.