What’s A WordPress Web Server?
The Internet is a large collection of computers that communicate with each other.
Every website you’ve ever visited is a collection of files that are stored on one or more computers somewhere in the world.
These computers are known as web servers, they are on 24/7 and they respond to requests for information by processing and uploading the files to the client.
When you visit a website, your web browser is the client. Your web browser sends out the initial request for information and then receives the website files from the server, it then interprets these files and displays them for you to view.
WordPress is the web’s most popular Content Management System powering more than 30% of all websites, It provides an easy interface for users to create and manage these website files without ever having to learn how to code. The WordPress community provides thousands of different themes and plugins to choose from so that you can find exactly what you’re looking for. There are hundreds of tutorial’s available on the web for any questions you might have.
How Does The Internet Work ?
Who knows, its mystery.
Just kidding, but come on, we live in the information age and if we are active users of the internet we should at least have a decent understanding of how it works.
Computers on the web talk to each other using the Hyper Text Transfer Protocol over the Internet Protocol Suite which consists of the Transmission Control Protocol and the Internet Protocol.
Also known as HTTP over TCP/IP.
Did I lose you yet? If so don’t worry about it.
Lets give an analogy to letters in the mail.
HTTP is like the contents and format of the letter, the browser and server both know how to read it. Web browsers automatically send this through TCP port 80.
HTTPS is like an encrypted letter where only the sender and receiver know the pass key to interpret it. Web browsers automatically send this through TCP port 443.
TCP is like certified mail service through the post office, it makes sure the data gets delivered, it also chops your letter into tiny pieces and sends them across the internet, deals with congestion and then reassembles them at their destination.
IP is the address and zip code system the post office uses to get the letter delivered to you.
Now Lets run through a practical example that you actually need to understand.
When someone types a web address into a browser say, http://www.HostYourOwnWebsite.com the web browser sends an HTTP request out through TCP port 80.
This request travels through your home internet router to a library often at your Internet service provider called a Domain Name Server.
The DNS translates the easy to remember domain name HostYourOwnWebsite.com into an actual IP address say 220.127.116.11.
This is the IP address of the cable modem that the web server is connected to but not necessarily the local IP address of the web server.
The DNS routes the request from the browser to the cable modem which forwards the request to the web server’s local router.
The router is set up to forward all traffic on port 80 to the local IP address of the web server, otherwise it doesn’t know which computer on the network to send it to. The local IP address often looks like 192.168.1.2.
The web server’s server program, i.e. NGINX, is configured to listen on port 80 for the domain www.HostYourOwnSite.com, it then responds with the appropriate information which makes its way back to the client and alas, a webpage is loaded.
When you register for a domain such as HostYourOwnWebsite.com, say through a paid domain registrar like NameCheap or a free domain registrar like Freenom, you have to specify what your web server’s IP address is. The registrar then propagates your IP address to all the DNSs around the world. If your web server has a residential internet service, its likely that your have a dynamic IP address that changes from time to time, even after a cable modem reset. The solution is to use a Dynamic DNS service that keeps track of your IP address and updates it. Dynu.com offers a free DDNS service and it can be used by signing up for a free account at Dynu and pointing your domain name to use Dynu’s DNS servers which is an option under the domain registrar’s control panel. A periodic script then runs on the server and keeps the IP address updated.
Blocked Ports and Intranet
Some residential internet service providers block incoming traffic on port 80 and 443 or severely limit upload speeds as a way to prevent the use of home web servers as its against their Terms of Service, so please call your ISP and double check before trying to do so. Note that there’s nothing different about port 80 or port 443 except that its the convention that web browsers use.
You can actually use a different port but you’ll have to specify it in the URL like www.HostYourOwnWebsite.com:81 and that’s annoying.
If your ISP doesn’t allow web servers and you don’t want to risk being scolded for trying, you can still set up a web server that only serves your local home network.
This is useful in developing test websites and projects before going live with them on another hosting solution or setting up a business intranet.
Simple Guided Setup With The MicroWebPi
It all seems a little overwhelming but with the MicroWebPi, all server side configuration is automatically done for you. All you need to do to make your site live is register for a domain, point it to your MicroWebPi or to Dynu, set up your router to forward traffic to your MicroWebPi’s IP address and run the automatic installer.
How Do Web Servers Work And What Is Caching?
Some parts of the website change every time you visit it or change depending on who is visiting it, this is known as dynamic content. It is generated on the server from web page building instructions right before being sent to the client. These instructions are known as server side scripts and in WordPress’s case, they are written in the PHP language. Every time a request for dynamic content is made to the web server, the web server processes the script which uses the servers computational power and therefore takes more time. If too many of these request are made at the same time, the server can become overloaded which will result in a slow or unresponsive website. Some hackers intentionally bombard websites with 100’s of thousands of requests per second to take down websites they don’t like or run up their monthly hosting fees.
Some files are the same for all users and never change, this is known as static content. Static content doesn’t need to be processed by the web server before uploading so its pretty fast.
Sometimes static content that rarely changes is generated by a server side script on every request, this is a waste of resources and makes your website slower than it needs to be. We can save this generated content for later in a special folder called a cache so that additional requests can be server faster. Server- side caching can greatly improve your website’s performance and the MicroWebPi is automatically configured to do so.
If you visit a website many times a day or week it doesn’t make sense to keep downloading the same static content again and again from the server, that is why there is client-side caching also known as browser caching. Your web browser will save the website’s static content right on your own computer so that those requests don’t have to travel across the internet and spend time uploading and downloading. This greatly speeds up the website performance but only after the first visit.
Note that if you update your web page’s static content, users may not see it until you refresh your server side cache and their browser side cache expires.