1 2 |
echo deb http://packages.prosody.im/debian wheezy main | tee -a /etc/apt/sources.list |
1 2 |
wget http://prosody.im/files/prosody-debian-packages.key -O- | apt-key add - |
1 2 |
apt-get update |
1 2 |
apt-get install prosody |
That’s it! Note that Prosody will be started after the installation. Stop it until we finish the configuration process.
1 2 |
service prosody stop |
Step #2 — Adding MySQL support
Prosody also works with MySQL, and that’s awesome! But it also works without it, skip this step if you don’t want to enable MySQL.
We can start by installing the MySQL server.
1 2 |
apt-get install mysql-server |
You will be asked for set root
’s user password. This password can be different to the Linux user.
Let’s install the MySQL client for managing the server.
1 2 |
apt-get install mysql-client |
Now we can use it to log in into the server. After this command you will be asked for the password entered before!
1 2 |
mysql -u root -p |
Welcome to the MySQL console! Enter the following command in order to create the Prosody database.
1 2 |
CREATE DATABASE prosody; |
The following command creates the MySQL user.
1 2 |
CREATE USER prosody@localhost; |
It’s highly recommended to add a password. Security reasons, you may know.
SET PASSWORD FOR prosody@localhost= PASSWORD(‘mypassword’);
Now we’ll give permissions to the new user.
1 2 |
GRANT ALL PRIVILEGES ON prosody.* TO prosody@localhost IDENTIFIED BY ‘mypassword’; |
Run the last command before exiting.
1 2 |
FLUSH PRIVILEGES; |
And now you can exit writing this.
1 2 |
exit |
Now that you know how to create MySQL databases, run nano
to edit Prosody’s configuration.
1 2 |
nano /etc/prosody/prosody.cfg.lua |
Scroll down. At the middle of the file you will find the MySQL configuration lines. Uncomment it and add the requested information, it should look like this.
1 2 3 |
storage = sql” — Default is internal” sql = { driver = MySQL”, database = prosody”, username = prosody”, password = mypassword”, host = localhost” } |
Remember to leave the other SQL lines commented and you’re done.
Step #3 — Configuring Prosody
Our server should be running on a hostname like xmpp.yourdomain.com
, but we want to create users using our domain, like [email protected]
. We are going to configure Prosody to work with it!
Open configuration file again, sorry if you closed it! We are going to set the administrator XMPP address.
1 2 |
admins = { yourname@yourdomain.com” } |
Scroll down to find the virtual hosts section and add one for your domain. It should look like this.
1 2 |
VirtualHost yourdomain.com” |
Now you can close the configuration file! I will not order you to open it again, I promise. You have to start your Prosody server in order for applying the changes.
1 2 |
service prosody start |
Leave a Reply