« Back to home

Fixing blog.gaku.net

Posted on

Previously I was using Ghost for blog.gaku.net. From time to time, the server process went down. It was a bit overkill to just host bunch of pages. I am moving to a static site generator this time.

Fixing

First, check /etc/nginx. blog.gaku.net’s config was /etc/nginx/site-enabled/ghost-blog.nginx.

# backend Thin servers
upstream ghost-blog {
              server 127.0.0.1:2368;
}

server {
  listen 80;
  server_name blog.gaku.net;
  location / {
    proxy_pass http://ghost-blog;
    proxy_set_header Host $host;
    proxy_set_header X-base-uri '/';
  }
}

Created a new config

server {
  listen 80;
  server_name blog.gaku.net;
  root /home/gakunet/src/blog.gaku.net/;
  location / {
  }
}

Restarted nginx.

Deploy a new static site

I am using Hugo.

$ hugo

to generate html files.

I am using rsync to deploy.

$ rsync -avz --delete public/ gakunet@zarya.gaku.net:~/src/blog.gaku.net/

rsync parameters:

  • -a archive mode.
  • -v verbose.
  • -z compress.
  • --delete delete files on the destination.

(2017-12-27)