diff options
Diffstat (limited to 'content/posts/how-this-blog-works')
| -rw-r--r-- | content/posts/how-this-blog-works/index.org | 60 | 
1 files changed, 57 insertions, 3 deletions
| diff --git a/content/posts/how-this-blog-works/index.org b/content/posts/how-this-blog-works/index.org index 5b83c9c..fa1acb2 100644 --- a/content/posts/how-this-blog-works/index.org +++ b/content/posts/how-this-blog-works/index.org @@ -57,6 +57,12 @@ through how I run by blog.    it's pretty easy to figure out.  * Prerequisites + +  This can be hosted on a very cheap VPS since it only has to serve +  static pages. For OpenBSD hosting I would recommend either [[https://www.vultr.com/][Vultr]] or +  [[https://openbsd.amsterdam/][OpenBSD Amsterdam]]. + +** Server    The only thing that's required on the host server is =git=, although    you could even get away without that if you chose to host your git    repository elsewhere, like on github. @@ -65,9 +71,22 @@ through how I run by blog.    pkg_add git    #+END_SRC -  On the client you'll need both =git= and =rsync=. Both might already -  be installed depending on the system you're on. If not, check your -  package manager for details on how to install them. +** Local machine +  On the local machine you'll need both =git= and =rsync=. Both might +  already be installed depending on the system you're on. If not, +  check your package manager for details on how to install them. In +  the case of Ubuntu or Debian it would be + +  #+BEGIN_SRC shell +  sudo apt install git rsync +  #+END_SRC + +  or for Fedora + +  #+BEGIN_SRC shell +  sudo dnf install git rsync +  #+END_SRC +  * Version Control @@ -118,7 +137,42 @@ through how I run by blog.    Since this blog is going to be hosted on OpenBSD, we don't need to    install a web server, as it already comes with one built in. +  Setting up =httpd= couldn't be easier, the configuration syntax is +  very straight forward. If you would like to see a full breakdown of +  the options available, check out the man page with =man +  httpd.conf=. The example configuration in =/etc/examples/httpd.conf= +  is also a good starting point. + +  In this case the simplest configuration would be as follows + +  # js chosen for prism.js syntax highlighting +  #+BEGIN_SRC js +  server "blog.lambda.cx" { +      listen on * port 80 +      root "/htdocs/blog.lambda.cx" +  } +  #+END_SRC + +  Despite how it looks, the =htdocs= folder doesn't reside in the +  system root (=/=) directory. It actually lives in =/var/www/htocs=, +  and only appears that way because =httpd= gets automatically +  =chroot='ed in =/var/www/= for security reasons. + +  For more information about how to set up SSL with Let's Encrypt, +  check out [[{{< ref "posts/letsencrypt-on-openbsd" >}}][this post]]. +  * Deployment    The system used to deploy this blog is incredibly simple, involving    only =rsync=, =hugo=, and a small shell script. + +** Server +  First you have to allow the =blog= user to write to the website +  root. We'll do this by making it the owner of +  =/var/www/htdocs/blog.lambda.cx=. + +  #+BEGIN_SRC shell +  chown -R blog /var/www/htdocs/blog.lambda.cx +  #+END_SRC + +** Local machine | 
