2019-10-01-website

     thttpd: tiny/turbo/throttling web server. thttpd is a simple, small, portable, fast, and secure HTTP server. My first test of thttpd Ver. 2.25b back in 2005 was on an old x86 computer that had been given to the museum archives, to which I installed a small version of linux. When I called our ISP to ask about our connection, I was told that it was a semi-static connection which might change every three or four months. For my experiment I thought that this would be great and continued making a test web page. Most of our information was just scans of photos and papers. From the logs, I saw that GoogleBot was visiting my site usually within two weeks. In less than a month of putting up my site addressed by only an IP address, I received a call from a guy in Ohio who had just typed in, “missile base” and the first site that popped up was my website! I had not done anything to get my site located! I also noticed I was getting hits from all over the world, with some sites trying many things to get access to my site. My site was bullet proof! The funny thing was that all the data on that computer was listed on my web page: http://162.250.19.7/ac0xl/www/2005-museumarchives/.
     This is running on a Raspberry Pi 3B, using thttpd 2.29, a 1TB USB-3 hard disk drive, and no microSD card, connected with an internal static IP address to a router with a cat-5 ethernet cable. On my D-Link router: under Setup tab:
     Local Network:
          LAN Interface Setup; IP Address: 192.168.x.1 (x=0-255, and must match in all the same spots), Subnet Mask: 255.255.255.0 , the “255” mask means that the number in this field must match for the address to be able to connect. This gives 256 different networks. If you change this number, your router will reset and use the new number as its IP address (http://192.168.x.1).
          DHCP Server Settings: IP Pool Range: 192.168.x.10 - 192.168.x.254, (This will leave 192.168.x.2 - 192.168.x.9 available for static Internal addresses.); DNS Server 1: 192.168.x.1 which is the address of the router.
     External Internet Setup: Since this will be a static external IP address these numbers will come from your ISP. For testing, a dynamic IP address will work fine. The web search "spiders" will find it and show it as a website that is directly connected to the Internet.
     Under the Status tab, Device Info, WAN Configuration, this should give you information on your external connection to the internet. Even if you have a dynamic address you should be able to use this number to test access to your web server.
     On my Raspberry Pi 3B, to set the IP address to static, I went to “/etc/dhcpcd.conf” and added to the end of the file, (with x=0 - 255) the same number as above: 
          interface eth0
          static ip_address=192.168.x.2/24
          static routers=192.168.x.1
     Save the file, and restart the computer. The computer should now show that your computer is on your static internal network (192.168.x.2/24). In a terminal, type “ifconfig” which should show eth0: inet 192.168.x.2 and below we need the MAC address which follows ether xx:xx:xx:xx:xx:xx, these x’s are in hexadecimal and we will need them to finish setting up the router.
     Connect again to your router (http://192.168.x.1). Under Setup, Local Network, on DHCP Static IP Connection: type in your static IP address (192.168.x.2) and enter your MAC address, which came from above, and press “add,” if add rejects because your IP address is outside the DHCP pool, press “Update,” and you should have a line in “DHCP Static IP Table” with your IP and MAC addresses. WARNING: Without an IP address in your router’s DHCP Static IP Table, your website might not show up if your router loses power or resets! Been there, done that.
     First test using the internal static IP address to make sure that much works. If thttpd doesn’t find an “index.html” type page, it generates its own index, which is a green screen with the files listed much like a directory page, or an ftp site. All one has to do is click on the file or directory name and it will open!

     If you have an older computer that you can load Linux on, (Raspberry Pi Desktop (for PC and Mac) suggested), you can have your own web server! Http://Acme.com, think of the “Wile E. Coyote and Road Runner Cartoons.” “thttpd” - tiny/turbo/throttling web server - is a simple, small, portable, fast, and secure HTTP server and is available for free! Some major sites that are running or have run thttpd: 
     The Drudge Report, https://www.drudgereport.com
     bluelight.com, K-Mart’s website, not found
     garfield.com, the comic strip, https://garfield.com 
     several other sites are listed mid-page thttpd.

     thttpd/benchmark.html, Last updated: 12 jul98. -- The benchmark test system is a 297 MHz Ultra Sparc (64 bit) with 256 MB RAM / 512 MB swap running Solaris 2.6, otherwise totally quiescent. -- Don’t get too excited over the performance figures. Most of these servers have enough oomph to keep a T1 (1.544 Mbps less overhead = 1.536 Mbps or about 192,000 Bytes/Sec.) saturated, running on a lowly 100 MHz Pentium or maybe even a 486. Very, very few web applications need more power than that. So, the fact that Apache is not that fast shouldn't be of concern to most people.
     It would be very interesting to see how different models of Raspberry Pi’s would score using the same set of benchmarks!

     “https://news.netcraft.com -- September 2019 Web Server Survey. In the September 2019 survey we received responses from 1,291,178,101 sites across 241,131,705 unique domain names and 9,068,313 web-facing computers. This reflects a gain of 19 million sites, 1.69 million domains and 119,000 computers.” As one can see, the number of web-facing computers is the smallest number of websites, the rest are controlled by someone else! All one needs is an IP address, which one gets from their ISP, usually these are dynamic numbers and will change on every connection, which will work for a test, but one really needs a static IP address that won’t change.

     My internet connection is $29.99 / month for unlimited service but limited to 2 Mbps (2,097,152 bps (bits/sec)) = 262,144 Bps (Bytes/sec)) download speed, and 1 Mbps (1,048,576 bps) = 131,072 Bps upload speed, which limits my site to a max of 131 KBps. A static IP address is an extra $5.00 / month. I am using my internet connection for e-mail, surfing the web, for my MagicJack phone, and now for my web server, for $35 a month! Check with your ISP to see if you have unlimited or measured service and how much more a static IP address costs.
     I live off the grid with a wireless ISP connection running off batteries and an inverter charged with a small solar panel and generator. All of my computers pulled too much power so I decided to use one of my Raspberry Pi’s for my web server, connected to a 1TB USB 3.0 hard disk drive and connected to my router with a CAT-5 ethernet cable. I was surprised to find that the Wi-Fi connection on the Pi worked even with the board inside an aluminum case. I ended up using a Raspberry Pi 3 Model B Rev 1.2 which was made in China because the demand was so great that the British plant couldn’t meet the demand.
     With only 1GB of RAM, while running the thttpd web server, I noticed the Chromium web browser was trying to lock up with a message of “waiting for cache.” Since I am running off the 1TB hard drive, in “/etc/dphys-swapfile” I set CONF_SWAPFACTOR=2 by removing the # on the line, and solved the problem.


     From https://www.canakit.com/raspberry-pi/ I ordered:
     1  Raspberry Pi 4 Starter MAX Kit, SKU: PI4-4GB-MAX64EWF-C4-WHT        $114.95
     1  Official Raspberry Pi 4 Power Supply (USB-C) - White
     SKU: DCAR-RSP-PT-C-WHT                                                 $  8.00
          Sub Total                                                         $122.95
          Shipping                                                          $  9.95
     Total                                                                  $132.90
     This has everything one would need to make a web server. The extra power supply is just for a back-up. I wanted a white case and 2 HDMI 6 ft. cables. This package also includes a 64 GB pre-loaded microSD card and a power supply switch. With the Raspberry Pi 4 one definitely needs a case with a fan since it tends to run hot.
     The Pi 4 4GB Starter Kit 32 GB, SKU: PI4-4GB-STR32F-C4-BLK, $99.95, would also make a good choice. The only difference is the case is black, only one HDMI 6 ft. cable, only a 32 GB pre-loaded microSD card and no power supply switch, which isn’t needed for a web server. That would save $15.00. The case base plate has a couple of counter-sunk screw holes so the case can be mounted.


     https://www.raspberrypi.org/magpi/issues/ A comparison chart of different Pi’s is in:
MagPi 83 (Jul 2019):
     Pg 26, Introducing Raspberry Pi 4
     Pg 28, Getting to Know Raspberry Pi 4
     Pg 30, Eben Upton on Raspberry Pi 4
     Pg 32, Benchmarking Raspberry Pi 4
     Pg 36, Simon Long on Raspbian ‘Buster’
     Pg 38, Raspberry Pi Quick Start Guide
     Pg 40, Set up Raspberry Pi
     Pg 48, Make a self-healing Raspberry Pi
MagPi 84 (Aug 2019):
     Pg 24, Raspberry Pi 4 Starter Guide
     Pg 24, Raspberry Pi Manual
     Pg 40, Use SSH with Raspberry Pi
MagPi 85 (Sep 2019):
     Pg, 22 Raspberry Pi Desktop test
     Pg 48, Build your own NAS
     Pg 80, 10 Best: Raspberry Pi Media Players
     Pg 82, Learn web design with Raspberry Pi
Beginners_Guide_v2.pdf, 240pgs. 37.16MB.

     Looking through the magazines, books, and site, one will see that you don’t have to know a lot to be able to use a Raspberry Pi. There is something for the beginner as well as the professional! The price on the Raspberry Pi’s was $35.00 for the board on most of them, with new releases still holding to that price, for ones having 1GB RAM memory.

     ZDNet.com had an article, “How can I get help with the Raspberry Pi 4?” -- With more than 27 million boards sold since the first Pi launched in 2012, the board now boasts a strong community, which helps other users via the official Raspberry Pi site: https://www.raspberrypi.org/community/, and forums: https://www.raspberrypi.org/forums/, with the note: Best selling British computer.


     Links:
http://acme.com/, site with thttpd - tiny/turbo/throttling web server.
https://www.raspberrypi.org/ Main page for information on Raspberry Pi computers.
     Pi search: web server
Tutorials - Step by Step- 2 years ago
     Apache Web Server: Build a local HTML Server with a Raspberry Pi.
     1 year ago: Set Up Piserver
     2 years ago: Samba: Set up a Raspberry Pi as a file Server for your local network.
https://www.raspberrypi.org/magpi/issues/, All of the MagPi magazines and documentation in pdf’s.
http://tldp.org, The Linux Documentation Project, A great source of general documentation about Linux. Here you will find a collection of documents known as the “Linux HowTOs” as well as other useful guides.
https://www.linuxlookup.com/howto/build_linux_home_web_server_under_250.
https://www.w3.org, The World Wide Web Consortium (W3C). Guides for HTML4, HTML5, XHTML.

     These links are the easiest and best I have found for sharing the “Good News” I found around my seventh birthday, the Fall of 1955. Frank Anderson, ac0xl.
http://4laws.com/laws/languages.html, 4 Spiritual Laws.
https://www.cru.org/us/en/train-and-grow/spiritual-growth/the-spirit-filled-life.html, The Spirit Filled Life.
https://www.cru.org, Exploring Your Life’s Purpose - Let’s journey together.
https://godtoolsapp.com, GodTools - Helping You Share Your Faith.
#
