Sorting out some oddities to do with using the cairo library
The luarocks package oocairo is stated as needing a lua version between 5.1 and 5.4 but we need lua version >= 5.3 for utf8 stuff e.g. drawing fractions.
This is how it should work.
Install lua (sudo apt-get install ...) and get lua-matrix from github.
sudo apt install lua5.3
sudo apt-get update
sudo apt install luarocks
sudo apt install libcairo2-dev
luarocks install oocairo
Big problem: lua5.3 can't see oocairo because luarocks (installed as above) puts it in lua5.1.
Hence, the above does not work because of a versioning issue.
The following does work.
sudo apt-get install liblua5.3-dev
sudo apt install lua5.3
In /root say:
wget https://luarocks.org/releases/luarocks-3.11.1.tar.gz
tar zxpf luarocks-3.11.1.tar.gz
cd luarocks-3.11.1
./configure && make && sudo make install
sudo apt install libcairo2-dev
sudo luarocks install oocairo
Might well need to use this, but not abso sure:
sudo update-alternatives --install /etc/alternatives/lua-interpreter lua /usr/bin/lua5.3 6
**The last 6 is the subversion number for the lua that was installed (i.e. 5.3.6) with a space in front of it.
Remember to have matrix.lua in cgi-bin after installing lighttpd.