Lichen CMS Tutorial
This is a tutorial on how to set up Lichen, a minimal CMS/static site server that uses Gemtext for the user to create pages, on Nearly Free Speech[4]. To run it locally, follow the instructions on the Lichen site[1].
Getting Started
Make sure you have these things downloaded before getting started:
- NearlyFreeSpeech account (using all recommended defaults should be fine)
- Some kind of terminal (OSX's "Terminal" or iTerm2)
- Any web browser
NearlyFreeSpeech
- Create a new account and make a new site.
- Get your SSH login details from the site under the "Sites" tab (enable SSH if not yet enabled).
- Using your terminal, SSH into your site. Follow the recommendations from NFS on how to log in (correct username, domain, etc.).
- Clone the Lichen repo[3] in your
public
folder:git clone <repo.url>
(you should automatically be in thepublic
folder, but to check, tryecho $PWD
). If you typels -l
, you should see a folder calledlichen
. - Move all the files from the new
lichen
folder into thepublic
folder:mv ./lichen/* ./
. If you typels -l
, you should see a lot more files and folders.
Lichen
- Go into the
cgi-bin
directory:cd cgi-bin
. - Verify that all
.cgi
files in thecgi-bin
folder have execute permissions enabled. If you typels -l *.cgi
, all entries should have a series of letters and hyphens and the start of the line; these should all contain threex
's. - Go back to the
public
folder:cd ..
- Ensure that the public files can be written and modified by your web server; this may require changing file or directory permissions:
chgrp -R web /home/public
.
At this point, if you go to the URL for your site (make sure you turn off maintenance mode[6]), you should see the stock Lichen homepage!
Creating Users
Now that we have the software installed, we are going to add edit functionality. We need to make a password file[2] for Lichen to read so we can edit pages. htpasswd
is a way for Apache to create an encrypted password file on the server.
- Create a new "AuthUserFile" and user using
htpasswd
. From thepublic
folder:htpasswd -c ../protected/.htpasswd newUserName
. Enter in the password for your new user; this is what you will use for editing pages in Lichen. - Find the "Apache Document Root" for your site on Nearly Free Speech under the "Sites" tab and the current site.
- Edit the
.htaccess
file:nano cgi-bin/.htaccess
- Change the
AuthUserFile
line, replacing the filepath with what you copied off of NFS followed by the path to the newhtpasswd
file. e.g. If your Apache Document Root is/fabc/test_domain/
, you would change the line toAuthUserFile /fabc/test_domain/protected/.htpasswd
.
Now we should be able to navigate to the URL for our site followed by /cgi-bin/edit.cgi
and enter in our username and password, resulting in access to the CMS backend!
References
- https://lichen.sensorstation.co/
- https://httpd.apache.org/docs/current/programs/htpasswd.html
- https://git.sensorstation.co/lichen.git
- https://www.nearlyfreespeech.net/
- https://faq.nearlyfreespeech.net/full/maintenancemode#maintenancemode
Incoming Links
Last modified: 202401040446