Installing Prosody like a wizardly Linux man

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Code:
apt update
apt upgrade -y
apt install prosody -y
apt install certbot -y
ps aux | grep "pro"
#You should see prosody running up above with roughly lua5.2, if not email the result of "uname -a" to [email protected] and he will help you.
cd /etc/prosody
ls -l
#You have two main configurations to get running now!
#1. Firstly, use nano or vim to edit VirtualHost to your domain in prosody.cfg.lua e.g. --- nano prosody.cfg.lua
#We will go back there later to edit in the .crt file like noted: certificate = "/path/to/example.crt"
#2. https://prosody.im/doc/dns - set your SRV records to point to your new server.
#3. Use certbot to get certificates in place, two options are: certbot certonly -d jabber-gw.fmarier.org,fmarier.org --standalone
#and if you use the same domain just the wildcard is okay: certbot -d *.r4p3.net --manual --preferred-challenges dns certonly
#run: certbot renew --deploy-hook "prosodyctl --root cert import /etc/letsencrypt/live"
#prosodyctl status
#Go inside of nano prosody.cfg.lua
#Find pidfile line and change to: pidfile = "prosody.pid";
#RUN THIS!!! prosodyctl --root cert import /etc/letsencrypt/live/

2075



WHAAAAAAAAAAAATTTTTTTTTTTTTTHEEEEUUUUUUUUFFFFFFFFFFFUUUUUUUUUUUCKKKKKKKKKKKK


been working on this shit 5 hours (okay actually 1, but feels like 5) OH MY GOD

STOP

BREAKING
YOU

PIECE
OF
SHIIIIITTT


WTF
IS
WRONG
WTHIHH
THESE
DEVS?!?!!

ffffkkkkyyyuuuu
















Wildcard does not work on the domain itself?
What
Who
Why
WHO THE ACTUAL FUCK THOUGHT THIS IS OKAY?!

OH MY GOD

STOP

STOP

Okay, I am going to drink a beer tonight --- just one.



*ducks and looks both ways*

Does a barrel roll through 10th floor window.


so mad

These people even made Lavabit go whatthefuck.. me too! ME FUCKING TOO why no wildcard work? fuckers

</rant> sorry guys

Much rage, I had to type this or I would need.. ice cream IMMEDIATELY!!

Okay so then actually we will run:
Code:
certbot -d r4p3.net --manual --preferred-challenges dns certonly

Apparently since we already have the wildcard, that is just going to be like "Yeah, sure go ahead.. Congratulations! Your certificate and chain have been saved at"

So now let's run that import again!

Code:
prosodyctl --root cert import /etc/letsencrypt/live/
systemctl stop prosody
systemctl status prosody
systemctl start prosody
systemctl status prosody

Important folders:
Processing triggers for man-db (2.8.5-2) ...
root@goose:/var/log/prosody# tree
.
├── prosody.err
└── prosody.log

---

root@goose:/var/log/prosody# cd /etc/prosody/
root@goose:/etc/prosody# ls
certs conf.avail conf.d migrator.cfg.lua prosody.cfg.lua README
root@goose:/etc/prosody# tree
.
├── certs
│ ├── localhost.crt -> ../../ssl/certs/ssl-cert-snakeoil.pem
│ ├── localhost.key -> ../../ssl/private/ssl-cert-snakeoil.key
│ ├── r4p3.net.crt
│ ├── r4p3.net.crt.bkp~2019-06-11T15:01:18
│ ├── r4p3.net.crt.bkp~2019-06-11T15:10:29
│ ├── r4p3.net.key
│ ├── r4p3.net.key.bkp~2019-06-11T15:01:49
│ └── r4p3.net.key.bkp~2019-06-11T15:10:29
├── conf.avail
│ ├── example.com.cfg.lua
│ └── localhost.cfg.lua
├── conf.d
│ └── localhost.cfg.lua -> ../conf.avail/localhost.cfg.lua
├── migrator.cfg.lua
├── prosody.cfg.lua
└── README

---

edit: actually pissed off again, thinking less of ice cream

Code:
cd /etc/letsencrypt/live
#not responsible if your whole system gets deleted lol
rm -rf *
certbot -d r4p3.net --manual --preferred-challenges dns certonly
cd /etc/prosody/certs/
rm -rf *

Now after you do that, things go weird and you have to use * now!

Code:
prosodyctl --root cert import /etc/letsencrypt/live/*

2076

and it was at that moment I knew FUCK THIS

leaving dys shyt heeeer for comedy. Getting food then brb and will make this work...... promise. <3
 
Last edited:

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Take 2:
SSH connect to your server as root.
Code:
nano /etc/ssh/sshd_config

Now Ctrl+W "Port", tap Enter.

Remove the "#" character and pick a new port number e.g. 6662.

2077

Ctrl+O, Enter

Ctrl+X

service sshd restart or systemctl restart sshd learn the difference between service and systemctl.

Now reconnect to your server's SSH on port 6662, this is done so you do not use a default port for SSH - pick your own to mitigate attackers and bots from trying logins.

Now your lastb command should be less flooded!

Time to really get Prosody installed, the actual guide because the rest kinda suck for the latest version of Ubuntu.

Code:
apt update
apt upgrade -y
apt install prosody certbot -y

ps aux | grep "pro"
Should return: prosody 9805 0.1 0.9 18732 9772 ? Ss 17:24 0:00 lua5.2 /usr/bin/prosody

nano /etc/prosody/prosody.cfg.lua find VirtualHost via Ctrl+W t ", swap localhost with r4p3.net for example.
Now save Ctrl+O, Enter --- Ctrl+X.

certbot -d r4p3.net --manual --preferred-challenges dns certonly
We now need to use Cloudflare or some DNS provider to set a TXT record. If you have questions, just commend on this thread and I will help!

# https://prosody.im/doc/dns - set your SRV records to point to your new server.

prosodyctl --root cert import /etc/letsencrypt/live

prosodyctl adduser [email protected] will add a user account and prompt for password.

Now to make sure all configuration changes have applied, we will give a restart!

Code:
systemctl restart prosody

Now you should be set... prosody should be running as prosody, not root.
 
Top