Hugo, Apache HTTPD and Basic Auth
This website is completely static; it does not use an application server, CMS or any server side rendering like PHP.
However, I want the family blog to require some means of authentication in order to access it. HTTP Basic Authentication
with an .htaccess file should suffice to achieve this.
Also, I wanted to be able to completely override the published files. Therefore, Hugo has to create the .htaccess
file.
I solved that by putting the target .htaccess files into my Hugo site’s
/static/the-family-blog/ folder like so:
|
|
This configuration requires a /var/www/virtual/mikeherzog_de/.htuser file (line 12) that contains my valid
users. This file should lie outside the document root folder, to be in-accessible from the web.