-- Leo's gemini proxy

-- Connecting to gemini.bunburya.eu:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Comment by AntiAmericanismBrit on 17/09/2023 at 21:37 UTC

2 upvotes, 0 direct replies (showing 0)

View submission: Isn't there an easy way to self-host a Gemini server?


Not one click but here is a step by step guide tested on Ubuntu 22.04 LTS:


sudo apt install molly-brown


First things first that version of Molly Brown has a bug: if you are on both ipv4 and IPv6, it listens on IPv6 only. So if you want to listen on ipv4 you might want to disable IPv6 on your box for now:


sudo sed -i /etc/default/grub -e 's/quiet splash/quiet splash ipv6.disable=1/' -e 's/LINUX=""/LINUX="ipv6.disable=1"/'


sudo update-grub


Next we need to create directories for the Gemini files and certificates, and we need to create your server certificates, and also create a user for the service because for some reason this isn't yet done by default by the deb scripts:


sudo mkdir -p /etc/molly-brown/certs /var/gemini


sudo chown -R $(whoami) /var/gemini


echo "Hello World from Gemini" > /var/gemini/index.gmi


openssl genrsa 2048 > access.key


openssl req -new -x509 -days 36500 -nodes -sha256 -key access.key -out access.crt


sudo mv access.crt access.key /etc/molly-brown/certs/


sudo useradd molly-brown


You will need to edit the config file in /etc/molly-brown it is just a simple set of directives.


If you want AccessLog to work, you will also need to edit the service file to allow write access to the log directory you set. As the service file could be easily overwritten by package updates, I suggest taking a copy and editing that:


sudo systemctl disable molly-brown@.service


awk '//{print} /ProtectSystem=strict/ {print "ReadWritePaths=/var/log/molly-brown"}' < /lib/systemd/system/molly-brown@.service > gemini.service


sudo mkdir /var/log/molly-brown


sudo chown molly-brown:molly-brown /var/log/molly-brown


sudo systemctl enable $(pwd)/gemini.service


Now you can try pointing a Gemini client at your box and see if you can get the hello world message.


Yes I do agree it would be nice if there were fewer steps :) at least a nice thing about command line is we can write notes like this that you can just follow hopefully...


(I actually keep a "do all the things to set up my box" script in a private Git repo, so if something horrible happens to my box and I have to set it up again from scratch, I can just run that. It also makes it easier to read off what I did later.)



Replies


There's nothing here!

-- Response ended

-- Page fetched on Fri May 17 09:35:44 2024