Tag archive for: server

How to put your Raspberry Pi server on the internet with ngrok

As I had mentioned in how to host multiple websites from home, a typical network architecture looks like the following:
Home network architecture In such a case, we will need our router to hold a public IP address and perform port forwarding for our home servers.

However, there can be cases where we do not have the environment to put our server on the internet.

In such a situation, you will find ngrok useful. Since ngrok accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine, you can put your server on the internet easily.
ngrok demo diagram

Given that, let’s look at how you can put your Raspberry Pi server on the internet with ngrok.

Why Namecheap is the best domain name registrar for hosting your web server at home

Basically, a HTTP client contacts a HTTP server with an IP address. For example, when you access google.com, your web browser could be using as the IP address to contact one of Google’s web servers. Although an IP address is what HTTP clients used for contacting HTTP servers, a domain name is easier to remember.

So if you want to host a web server at home, it is recommended that you get a domain name to make accessing your web server easier. In case you are looking for a domain name registrar to purchase a domain for your home server, this post discusses why you may want to buy from Namecheap.

Configuring Nginx for PHP web applications

Nginx and PHP FastCGI Process Manager (FPM) are often used side by side for PHP applications. In such a setting, Nginx will be the first point of contact for incoming HTTP requests, acting as a reverse proxy server for the PHP FastCGI Process Manager.

The PHP FastCGI Process Manager then interprets the HTTP requests that it receives from Nginx and runs the PHP scripts for generating the corresponding HTTP responses for Nginx to return back to the HTTP client.

This post discusses a set of configurations that you can use for configuring Nginx for your PHP web applications.

Configuring Nginx to serve files for a static website

In the world of HTTP, static files are content hosted on a web server that does not change. Some examples of static files include images, CSS files, JavaScript files and HTML files.

Although it is not too hard to implement a dynamic website through a content management framework like WordPress on your own server, there are cases where it makes more sense to just host a couple of static files to realise your website.

Nginx is an excellent web server for serving static websites. If you already have Nginx running on a Raspberry Pi 3 or any other kinds of server, you may want to configure it to serve files for your static website.