📜 ⬆️ ⬇️

Installing jubber server prosody 0.9.7 in the OS family of Windows

Prosody is a lightweight, cross-platform XMPP server written in the Lua programming language. On Habré there are several articles on setting up prosody in the standard version - in linux. Setting in windows contains several pitfalls, which I will try to tell.



First I will talk about the pros and cons of this decision. Pros: extreme lightness.


')
The screenshot shows a typical resource consumption of prosody + srvany utility, which I used to create the service. Another advantage can be attributed to the modularity and support for many XEP.
And cons: the lack of a GUI (for someone it is not a minus), for setting up under windows you need to work with a file. Setting up under windows is more difficult than setting up under linux.

The first pitfall awaits us already at the stage of downloading the distribution . For windows, you can download both the installer and the archive with prosody. The fact is that every single bat-file contains a line

if exist Uninstall.exe set datastore=%APPDATA%\Prosody 

This means that if an uninstaller is found, then all server data will be stored in% APPDATA% of the user running the server. This is not what we need, therefore, in order to store data in the same place where everything else is stored, you must either use the distribution kit with the archive instead of the installer, or rename the uninstall.exe file after installation, for example, to uninstall.bkp.exe . Download and install the necessary distribution.

The second pitfall - prosody under windows has no service. We will assume that you are not satisfied every time to start prosody to log in as a user and run the prosody.bat bat file. To create a prosody service, I suggest using the srvany utility, included with the Windows Server 2003 Resource Kit Tools . Even if the OS on your server is different from server 2003, srvany should help us.


The service has been created, you can set it to start automatically . Attention! You cannot stop the service created in this way, to stop the srvany and lua processes. Until all settings are made, the service should not be started.

Set up prosody. To do this, run the batch file editconfig.bat . All options are documented, I will not describe the entire configuration thoroughly. Documentation on the modules can be found on the official website .

It is recommended to use tls to encrypt sessions. There are several tls configuration options:

If you are setting up a corporate server, then you need to enable the groups module for a common roster.
It is necessary to uncomment the corresponding line in the config in order to load the groups module when starting the server, prepare a text file with the description of groups and specify the path to the file:

 modules_enabled = { -- Other modules "groups"; -- Enable mod_groups } groups_file = "groups.txt" 

Create groups.txt in the data subdirectory. If you plan to use Cyrillic, then edit the file using notepad ++ or any other advanced text editor in UTF-8 mode. The following sample file is taken from the official documentation:

  [Support Team] support@example.com john.doe@example.com [Development Team] hardworkingdeveloper@example.net=Joe Coder other.dev@example.com=Mel 

There is one nuance here. Members of each group see only those who are in the same group. On other cases, the official documentation is silent. Looking at the source code of the module, you can see that if you put + in front of the group name, then it becomes common - everyone sees this group.

  [+Support Team] support@example.com john.doe@example.com [+Development Team] hardworkingdeveloper@example.net=Joe Coder other.dev@example.com=Mel 

You can even add non-existing users to the group.

During configuration, you can run prosody from the prosody.bat startup script to check the result. Run the script from the administrator to avoid problems. After final configuration, start the previously created prosody service. You can manage prosody on the go using the admin_adhoc and admin_telnet modules .

Source: https://habr.com/ru/post/203202/


All Articles