Several of the issues which have come up in the above are addressed in the pages I've been creating and refining for some time now at...
Besides the "how to" stuff there, there is complte downloadable sourcecode. The Arduserver3 code is the one to "go for", probably.
Getting everything working can be "a little" daunting.
The following starts with some BASIC basics... skim them, if you don't need them. There's more, later.
Start with a "simple" set up: An LED to stand for whatever you want to turn on and off over the web. Control it with a subroutine called TurnItOnOff. For now, in your loop() routine, read a push button. Button down, LED on. Up, off.
You probably, eventually, want to be able to see the temperature in the controlled space. Connect a temperature sensor, and read it with a subroutine called ReadTture which returns the temperature in a form you have the software skills to cope with. I often use an integer-type datum filled with tenths of degrees centigrade. In other words, if the temperarture were 23.8 deg C, I'd be working with 238. If negative temperatures are going to be involved, just "slide" the scale down 1000 degrees, making 23.8 C 1238 in my scheme. (-15.0 deg C would be 850)
Now, without messing much with your subroutines, just by adding a few bits to the loop() code, you should be able to get your growing system to report the current tture, even if only in my weird scale, to the serial monitor whenever you press the button. (Not met the serial monitor? Go meet it! Very useful for debugging. Therefore, leave pins D0 and D1 out of YOUR designs, so that they remain available for the serial monitor. Intro at...
Time to tackle using your ethernet module.
First: IP addresses...
There are two sorts (at least).
In a simple home, you may well have a wire from outside carrying "the internet" into your house.
It will connect to a modem/router (Called "router" from here). That router will have an "outside world" internet address, assigned to you by your ISP. (And it can change from day to day.)
It would look something like 184.108.40.206
IF I knew your outside world IP address, I could put it into my browser, and "the system" would send a request from me to you, asking, do you have a web server connected to the outside world? If you do, please send whatever it is set up to send."
We'll come back to all of that.
Your router is in two parts. One faces the outside world, passes "stuff" back and forth with outsiders. The other part faces inwards, to you and whatever you've attached to the router. That part of the router takes stuff from the attached devices, and sends stuff to them.
And it also sometimes passes stuff from "outside" to "inside", or vice versa, OR passes stuff BETWEEN devices on the "inside", assuming you have more than one.... which you will do if you have a "normal" internet terminal (e.g. a PC with a browswer... e.g. the thing you are reading this on!)
All of the "stuff" "inside" is your Local Area Network, your LAN.
Each device on the LAN has a unique-to-your-LAN "IP address", too. And they usually start with...
My PC might be on 192.168.0.5, and my Arduino web server on 192.168.0.250
Those are their LAN addresses. Both can be "seen" in the outside world... but they are "seen", from outside, as being "at" the "outside world" IP address my ISP has assigned (today) to my router.
If my router's "outside" IP address happens, today, to be 220.127.116.11, then if you point your browswer at that, the message will arrive at my router, and then be passed so ONE of the devices on the LAN.
If you JUST use 18.104.22.168, your browser will add ":80" to that, to tell my router what sort of reqest for service is arriving. And I've told my router which of my devices to use for requests for those services.
If you use 22.214.171.124:81, your browser will send it out unchanged, and my router will send the request to a different device on my LAN... the one I've designated to service those requests.
** BUT I've gotten ahead of myself!....
START with the REALLY SIMPLE stuff I set out at the top.
THEN work on getting your Arduino to work as a Web Server JUST on your LAN....
Start by telling your router to set aside some of the local IP addresses (192.168.0....) to be UNUSED by the DCHP service that it almost certainly provides.
Lets' say you've told your router "Don't use 192.168.0.220-192.168.0.254 for your DCHP purposes" (That's as good a range as any other to reserve).
THEN tell your Arduino to "put" itself on your LAN at 192.168.0.220. (And start careful notes of what you have put where! There's no reason to give your big stuff (laptop and so on) "static IP addresses" (That's what we're doing with the Arduino) (A LOCAL static address. a Static "outside" address is very expensive, and, for us hobbyists, not needed)...
There can't be more than one device on the LAN with the same local IP address. "The system" will take care of things like your laptop's connection (and smartphones, tablets, etc) AS LONG AS you have reserverd some addresses, as described above for .220-.254. And you only assign static (local) addresses within that range.
So. Do all the above. Tweak the web server demo code you are trying to use in your Arduino, so that it will "attach" to the LAN at the right IP address. (If you notice the "port" thing too, use ":80" for now. Be careful not to end up with two colons. You may only need to put "80" into the software.
Ah. "Web server demo code you are trying to use". I would suggest the one that comes with the standard Arduino software development environment. At 12/14, on my setup, that would be "WebServer" in Examples/Ethernet. It will, once all is taken care of, tell you the voltage on one of the analog inputs.
Once that's done, you should be able to sit at a computer on the LAN, fire up a web browser (e.g. Firefox) and put the local IP address into the browser's address bar, and get some kind of answer from the Arduino. (Address bar: Where you SHOULD put the "www." things we use to access "stuff" "on the web". NOT the Google search window, which so many people use all the time, even though that is going 'round the houses, if you know the www thingie. Sigh.)
*** BY STARTING LIKE THIS, we are leaving a whole bunch of problems out of the picture... for now. I'll put the rest in a "Part 2" post.