RT Cunningham

WordPress Static Site Generator, Part 2 – Your Online and Offline Servers

Your WordPress static site generator requires two locations. The first, your online server. The second, your offline server – your home computer.

If you’re using anything other than Nginx as your online web server, change it to Nginx. Nginx serves static files like nobody’s business. I’ll be using example.com as the domain name in the online examples and example.local in the offline examples.

WordPress Static Site Generator Domain Names

No matter what you’re real domain name happens to be, you’ll need to assign a local domain name within the WordPress software. Before you can do that, you have to edit your computer’s host file. On Linux, it’s /etc/hosts and on Windows, it’s C:\Windows\System32\Drivers\etc\hosts. I have no idea what it is on a Mac.

You only need to add a single line: example.local www.example.local

When the WordPress static site generator script runs, it will replace the “.local” TLD with the “.com” TLD. That is, if you use a local domain name that closely mirrors your real domain name. I’ll mention it again in a later article.

The Web Server Stack for the Online Server

I won’t tell you how to set it up because there’s a good LEMP stack tutorial at DigitalOcean. You can skip the database part but you should install PHP even if you won’t be using it on your website. I’ll mention it again in a later article.

Since HTTPS (SSL/TLS) is going to be the new standard sooner than later, you should also follow the Let’s Encrypt tutorial at DigiatalOcean.

The Web Server Stack for the Offline Server

I won’t get into Linux. Most Linux users know exactly what to do. For Windows, I think WinNMP is the best development stack to use. I used an earlier version on Windows 8 years ago.

Don’t try to set it up with HTTPS. You’ll get nothing but grief from the web browser you test it with. The WordPress static site generator script will change it for you anyway.

Get WordPress installed here. You won’t need to worry it about it at the online server.

April 20, 2018
Web Development

You May Also Like: