Static statictest.yydchang-test.com Site

I'm learning all about setting up my own Virtual Private Server! My VPS is hosted by Digital Ocean on what they call a droplet. My droplet's OS is Ubuntu. I've installed Nginx as my webserver, Node to be used for app development, and PostgreSQL and MongoDB for database.

This site is my static test site. Get to it by navigating to statictest.yydchang-test.com. Most browsers will automatically resolve this to https://statictest.yydchang-test.com, which works because I used certbot to request a SSL certificate and prove that this server owns the domain.

I learned that the overall process is as follows.

  1. Create local git repository
  2. Push local git repository to GitHub
  3. Create droplet SSH key specific to that repository
  4. Add public key to GitHub repository so future actions do not require signing in
  5. Configure droplet to use SSH private key when talking to this repo
    • configuration file is ~/.ssh/config (~ is the user home folder)
    • Host is github.com-static-yydchang-test which is NOT a URL, it is just the name I chose for this repository link
    • HostName github.com is the host of the repository
    • User git is the command used when interacting with git?the fixed username that GitHub's SSH service always expects for authentication
    • IdentifyFile is the private key file
    • Ensure chownchmod 600 allows only the owner to read and write
  6. Clone into a /var/www/statictest.yydchang-test.com/html folder
  7. Create a Nginx block in /etc/nginx/sites-available
    • port listens for both IPv4 and IPv6
    • root points to droplet directory with repository
    • index file default
    • server_name domain statictest.yydchang-test.com
    • 404 fallback
  8. Create a symlink from /etc/nginx/sites-enabled to the sites-available file
  9. test the Nginx config and reload Nginx
  10. Visit the site
  11. SSL with certbot
  12. Update with git add ., git commit -m "comment", git push origin main, git pull in droplet