gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

web server rpi

Tue Oct 01, 2013 2:16 am

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....

T3am5hark
Posts: 62
Joined: Wed Jul 17, 2013 5:37 pm

Re: web server rpi

Tue Oct 01, 2013 5:07 pm

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.

gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

Re: web server rpi

Tue Oct 01, 2013 7:14 pm

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.

gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

Re: web server rpi

Tue Oct 01, 2013 7:20 pm

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...

gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

Re: web server rpi

Tue Oct 01, 2013 7:25 pm

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)

klricks
Posts: 7236
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: web server rpi

Wed Oct 02, 2013 12:50 am

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.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

Re: web server rpi

Wed Oct 02, 2013 7:08 am

thanks..tonight i've tried to scan my ports and the scanner said that are filtered...

lucdig
Posts: 104
Joined: Sat Aug 24, 2013 6:45 am

Re: web server rpi

Wed Oct 02, 2013 7:41 am

Try to set not well-know ports instead of 80 and 87, e.g. ports > 1024 excluding 8080

chilinski
Posts: 16
Joined: Mon Sep 16, 2013 8:08 pm

Re: web server rpi

Wed Oct 02, 2013 7:44 pm

And remember that you might have iptables blocking all incoming traffic external to your LAN.

gingerino
Posts: 7
Joined: Tue Oct 01, 2013 2:07 am

Re: web server rpi

Wed Oct 02, 2013 10:15 pm

was really easy i had to ask to my ISP to fix a public ip for me. Thanks to all...

PIsingh
Posts: 12
Joined: Tue Dec 24, 2013 11:52 pm

Re: web server rpi

Sat Dec 28, 2013 2:05 am

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?

klricks
Posts: 7236
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: web server rpi

Sat Dec 28, 2013 6:19 am

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.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: web server rpi

Sat Dec 28, 2013 10:34 am

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.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

PIsingh
Posts: 12
Joined: Tue Dec 24, 2013 11:52 pm

Re: web server rpi

Sun Dec 29, 2013 10:26 am

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.

Return to “Networking and servers”