jdmnash
Posts: 4
Joined: Wed Jun 06, 2012 11:03 pm

Web Server and GPIO

Mon Jun 11, 2012 11:41 pm

I've successfully completed this tutorial: http://www.instructables.com/id/Web-Con ... y-Pi-GPIO/ titled "Web Control of Raspberry Pi GPIO (UPDATED)"

Everything appears to be functioning correctly. I can log into the pi locally at 192.xxx.xxx.27/control.php and toggle the IO.

I don't have much web server experience beyond a yahoo domain that points to an index.html. How do I make that page accessible over the internet? I have a dyndns domain that I use for other purposes (typically in the format of xxxx.dyndns.org:4949) I don't want to loose this functionality. Is there a way to point a specific port to the .../control.php file on my Pi? What security issues should I be concerned about?

TIA for any advice.

jdmnash
Posts: 4
Joined: Wed Jun 06, 2012 11:03 pm

Re: Web Server and GPIO

Tue Jun 12, 2012 12:50 am

Found a simple solution here: http://www.raspberrypi.org/phpBB3/viewt ... 468#p94468

(forward port 80 to the LAN ip of the RasPi) public address is xxxx.dyndns.org/control.php.

what if I had more than one? How could I differentiate the two? if the IP of RasPi 1 is 192.168.0.1 and is hosting control.php with port 80 forwarded to it, could RasPi 2 at 192.168.0.2 host /control2.php? Then would I be able to access each one separately by going to xxxx.dyndns.org/control.php and xxxx.dyndns.org/control2.php respectively?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Web Server and GPIO

Tue Jun 12, 2012 7:04 am

You can forward external port 80 to Raspi 1 port 80 and external port 81 to Raspi 2 port 80

That would be the easiest way to do it.
Otherwise, you could setup a reverse proxy type setup with apache2 so that you could redirect to the correct RPi depending on which page you go to, but I've never done that sort of thing before so I have no idea how to do it...yet. :D
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

gme
Posts: 5
Joined: Fri May 18, 2012 4:29 pm

Re: Web Server and GPIO

Fri Jun 15, 2012 2:44 pm

SirLagz wrote:You can forward external port 80 to Raspi 1 port 80 and external port 81 to Raspi 2 port 80

That would be the easiest way to do it.
Otherwise, you could setup a reverse proxy type setup with apache2 so that you could redirect to the correct RPi depending on which page you go to, but I've never done that sort of thing before so I have no idea how to do it...yet. :D

I have documented reverse proxy with apache here for the pi - http://www.gavinwill.me.uk/2012/06/rasp ... rse-proxy/

Return to “Networking and servers”