Showing posts with label virtual host prosody. Show all posts
Showing posts with label virtual host prosody. Show all posts

Friday, December 23, 2016

Configure Prosody Server

The configuration file for Prosody is located in /etc/prosody/prosody.cfg.lua, and is written in Lua syntax.


Note that in the Lua programing language, comments (lines that are ignored by the interpreter) are preceded by two hyphen characters (e.g. --). The default config has some basic instructions in Lua syntax, which can be helpful if you’re unfamiliar with the language.

To allow Prosody to provide XMPP/jabber services for more than one domain, insert a line in the following form into the configuration file. This example defines three virtual hosts.

/etc/prosody/prosody.cfg.lua

VirtualHost "example.com"
VirtaulHost "example.com"
VirtualHost "staff.example.com"
VirtualHost "192.153.36.78"

Following a VirtualHost line there are generally a series of host-specific configuration options. If you want to set options for all hosts, add these options before the first VirtualHost declaration in your configuration file. For instance, to ensure that Prosody behaves like a proper Linux server daemon make sure that the posix; option is included in the modules_enabled = { } table.

/etc/prosody/prosody.cfg.lua

modules_enabled = {
                  -- [...]
                  "posix";
                  -- [...]
                  }
Note that there should be a number of global modules included in this table to provide basic functionality.

To disable a virtual host without removing it from your configuration file, add the following line to its section of the file:

/etc/prosody/prosody.cfg.lua
enabled = false

To specify administrators for your server, add a line in the following format to your prosody.cfg.lua file.

/etc/prosody/prosody.cfg.lua

admins = { "admin1@example.com"}
To add server-wide administrators, add entries to the admins section, as above, in the global section of the configuration file. To grant specific users more granular control to administer particular hosts, you can add an admins line, or more properly tables in Lua, to specific hosts.

If you need to enable the legacy SSL/TLS support, ensure that the following entry in the modules_enabled is enabled:

/etc/prosody/prosody.cfg.lua
modules_enabled = {
                  -- [...]
                  "legacyauth";
                  -- [...]
                  }

legacy_ssl_ports = { 5223 }
Do not forget to reload the configuration for the Prosody server after making any changes to your /etc/prosody/prosody.cfg.lua file, by issuing the following command:


/etc/init.d/prosody restart