Interim blog setup, rough notes being dumped here at the moment - I'll tidy once I get to a milestone. And sorry about the layout, that'll probably take even longer to get around to... #TODO

Lemmy

Published on 2023-08-29 by @danja

https://github.com/LemmyNet

recommends Ansible

I opted for the full version -

ew, initial bits painful, found the docs confusing, maybe assume more prior knowledge than I have (only used Docker a bit, have never used Ansible). More worrying, I haven't a clue what it's stuck on my server.

2023-08-30

The Ansible thing did look like it'd mostly run ok, but things definitely fell apart around nginx. Very likely cause being host:port clash, as I already have an Apache server in front on hyperdata.it/127.0.0.1 :80 and :443

https://www.geeksforgeeks.org/changing-nginx-port-in-linux/

I changed the default config yesterday, but just looked again, there's actually :

/etc/nginx/sites-available/default
/etc/nginx/sites-available/hyperdata.it.conf
/etc/nginx/sites-enabled/default
/etc/nginx/sites-enabled/hyperdata.it.conf

So I've deleted the /etc/nginx/sites-enabled/default symlink and changed hyperdata.it.conf to use port 8421

I'm pretty sure I don't need https/443 on nginx, I've got Apache doing that, is proxying to Fuseki etc on plain http on different ports. So I've deleted that section from hyperdata.it.conf

Active: active (running) since Wed 2023-08-30 09:27:02 UTC; 12s ago

Yay!

Hmm. http://hyperdata.it:8421 just redirects to https://hyperdata.it/

On server,

Currently reorganising the server. I'll put my FOAF/Solid here soon, for now my contact details should be at : https://hyperdata.it/ note to self : this is /opt/lampp/htdocs/profile/index.html

Aha! That's my placeholder for https://danny.ayers.name/, configured in Apache.

Where are my notes on Apache setup..?

~/HKMS/server-setup/ apparently - TODO make that easier to find

distraction danbri mentioned XMPP (for ChatGPT) yesterday, it appears I have ejabberd installed. Is it running? see ejabberd Notes

https://lemmy.hyperdata.it

http://lemmy.hyperdata.it http://lemmy.hyperdata.it:8421 https://lemmy.hyperdata.it:8421 http://hyperdata.it:8421 https://hyperdata.it:8421

lynx http://127.0.0.1:8421

root@localhost:~/temp# wget http://127.0.0.1:8421
--2023-09-01 11:19:35--  http://127.0.0.1:8421/
Connecting to 127.0.0.1:8421... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://127.0.0.1/ [following]
--2023-09-01 11:19:35--  https://127.0.0.1/
Connecting to 127.0.0.1:443... connected.
    ERROR: certificate common name ‘danny.ayers.name’ doesn't match requested host name ‘127.0.0.1’.
To connect to 127.0.0.1 insecurely, use `--no-check-certificate'.

The only 301 that looked relevant was in :

nano /etc/nginx/sites-available/hyperdata.it.conf

so I removed that block

systemctl restart nginx.service

https://lemmy.hyperdata.it/ seems to redirect to http://lemmy.hyperdata.it/, nginx starter page.

That redirect was needed!

put it back, random longshot, removed (shouldn't be needed after Apache..?):

    location /.well-known/acme-challenge/ {
        root /var/www/certbot;
    }

in /var/log/nginx/access.log

127.0.0.1 - - [01/Sep/2023:11:31:41 +0000] "GET / HTTP/1.1" 301 162 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"

It looks like it's getting that far, but the lemmy bit isn't doing anything

https://join-lemmy.org/docs/administration/troubleshooting.html

root@localhost:/home/hmks-apps/lemmy/hyperdata.it# docker-compose logs -f lemmy

...
lemmy_1     | 	Is the server running on host "postgres" (172.18.0.3) and accepting
lemmy_1     | 	TCP/IP connections on port 5432?
...

I was in the middle of typing a message to ask for help on r/lemmy, when something occurred to me. Maybe Ansible doesn't do the external services. It's plausible that I'd already installed nginx, Ansible just added a config. But postgres, pictrs (?), the smpt service..?

sudo apt install postgresql

The postgresql service is an "umbrella" service whose purpose is to start or stop the services named postgresql@version-instance which are the actual services that you are interested in. To get the statuses of these, run sudo systemctl status 'postgresql*'

a PostgreSQL Cluster is running...

https://www3.ntu.edu.sg/home/ehchua/programming/sql/PostgreSQL_GetStarted.html

initial client access :

there is a DB postgres, owner postgres

wait, https://github.com/LemmyNet/lemmy/issues/1847

postgres was already running under docker :

making sure it's using the same password as in lemmy.hjson

VkNyXOFMCgb0sGjraJUz

root@localhost:/home/hmks-apps/lemmy/hyperdata.it# docker ps -a
CONTAINER ID   IMAGE                        COMMAND                  CREATED      STATUS      PORTS                                                 NAMES
e519719e228e   nginx:1-alpine               "/docker-entrypoint.…"   2 days ago   Up 2 days   80/tcp, 0.0.0.0:20140->8536/tcp, :::20140->8536/tcp   hyperdatait_proxy_1
58f4af628105   dessalines/lemmy-ui:0.18.4   "docker-entrypoint.s…"   2 days ago   Up 2 days   1234/tcp                                              hyperdatait_lemmy-ui_1
9da7a413d90b   dessalines/lemmy:0.18.4      "/app/lemmy"             2 days ago   Up 2 days                                                         hyperdatait_lemmy_1
3394683cf319   postgres:15-alpine           "docker-entrypoint.s…"   2 days ago   Up 2 days   5432/tcp                                              hyperdatait_postgres_1
3792edf55801   asonix/pictrs:0.4.0          "/sbin/tini -- /usr/…"   2 days ago   Up 2 days   6669/tcp, 8080/tcp                                    hyperdatait_pictrs_1
157491f6495f   mwader/postfix-relay         "/root/run"              2 days ago   Up 2 days   25/tcp

ew, nginx & posgres

docker stop e519719e228e (nginx) docker restart 3394683cf319 docker restart 3792edf55801 docker restart 157491f6495f docker restart 9da7a413d90b docker restart 58f4af628105

no change

systemctl stop nginx docker start e519719e228e

slight change

https://lemmy.hyperdata.it/ -> http://lemmy.hyperdata.it/

503 Service Unavailable

that's a change. Next need to check the logs. But enough for today.