jabber
Розбіжності
Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
| Наступна ревізія | Попередня ревізія | ||
| jabber [2013/10/22 10:27] – створено wombat | jabber [2016/02/28 10:15] (поточний) – [Модули] wombat | ||
|---|---|---|---|
| Рядок 1: | Рядок 1: | ||
| + | ====== Сервер ====== | ||
| + | ===== Выбор ===== | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | ===== Установка ===== | ||
| + | |||
| + | Рассмотрим процесс установки Prosody в операционной системе Debian GNU/Linux. | ||
| + | |||
| + | Как описано на [[http:// | ||
| + | |||
| + | deb http:// | ||
| + | |||
| + | Для этой цели может понадобиться добавить ключ их репозитория: | ||
| + | |||
| + | wget https:// | ||
| + | |||
| + | Если wget выдаёт ошибку | ||
| + | |||
| + | ERROR: The certificate of `prosody.im' | ||
| + | ERROR: The certificate of `prosody.im' | ||
| + | |||
| + | тогда его следует запускать с ключом --no-check-certificate . Тогда вся строка целиком будет выглядеть так: | ||
| + | |||
| + | wget --no-check-certificate https:// | ||
| + | |||
| + | После того, как добавлен ключ, обновляем списки доступных пакетов: | ||
| + | |||
| + | apt-get update | ||
| + | |||
| + | И устанавливаем Prosody: | ||
| + | |||
| + | apt-get install prosody | ||
| + | |||
| + | ===== Настройка ===== | ||
| + | |||
| + | На [[http:// | ||
| + | |||
| + | |||
| + | **1.** Указание **домена** (или нескольких доменов), | ||
| + | |||
| + | VirtualHost " | ||
| + | |||
| + | и изменяем её так, как нам нужно. Если наш домен " | ||
| + | |||
| + | VirtualHost " | ||
| + | |||
| + | Если далее в описании данного домена имеется строка | ||
| + | |||
| + | enabled = false | ||
| + | |||
| + | её следует закомментировать следующим образом: | ||
| + | |||
| + | | ||
| + | -- enabled = false | ||
| + | |||
| + | **2.** Выбор **модулей**, | ||
| + | |||
| + | После этого Jabber-сервер готов к запуску. Однако, | ||
| + | |||
| + | **3.** Создать свой **SSL-сертификат**((Самоподписанный сертификат по умолчанию не считается доверенным большинством программ, | ||
| + | |||
| + | openssl req -new -x509 -days 365 -nodes -out " | ||
| + | |||
| + | После этого перемещаем полученные файлы, например, | ||
| + | |||
| + | ssl = { | ||
| + | key = "/ | ||
| + | | ||
| + | } | ||
| + | |||
| + | для глобальных настроек, | ||
| + | |||
| + | VirtualHost " | ||
| + | -- enabled = false -- Remove this line to enable this host | ||
| + | |||
| + | -- Assign this host a certificate for TLS, otherwise it would use the one | ||
| + | -- set in the global section (if any). | ||
| + | -- Note that old-style SSL on port 5223 only supports one certificate, | ||
| + | -- use the global one. | ||
| + | ssl = { | ||
| + | key = "/ | ||
| + | certificate = "/ | ||
| + | } | ||
| + | |||
| + | **4.** Если сервер не предназначен для публичного использования, | ||
| + | |||
| + | allow_registration = false; | ||
| + | |||
| + | **5.** Полезной возможностью также является создание чат-комнат. Следующая строка включает такую возможность: | ||
| + | |||
| + | Component " | ||
| + | |||
| + | Таким образом, | ||
| + | |||
| + | <file lua / | ||
| + | -- Prosody XMPP Server Configuration | ||
| + | -- | ||
| + | -- Information on configuring Prosody can be found on our | ||
| + | -- website at http:// | ||
| + | -- | ||
| + | -- Tip: You can check that the syntax of this file is correct | ||
| + | -- when you have finished by running: luac -p prosody.cfg.lua | ||
| + | -- If there are any errors, it will let you know what and where | ||
| + | -- they are, otherwise it will keep quiet. | ||
| + | -- | ||
| + | -- Good luck, and happy Jabbering! | ||
| + | |||
| + | |||
| + | ---------- Server-wide settings ---------- | ||
| + | -- Settings in this section apply to the whole server and are the default settings | ||
| + | -- for any virtual hosts | ||
| + | |||
| + | -- This is a (by default, empty) list of accounts that are admins | ||
| + | -- for the server. Note that you must create the accounts separately | ||
| + | -- (see http:// | ||
| + | -- Example: admins = { " | ||
| + | admins = { " | ||
| + | |||
| + | -- Enable use of libevent for better performance under high load | ||
| + | -- For more information see: http:// | ||
| + | --use_libevent = true; | ||
| + | |||
| + | -- This is the list of modules Prosody will load on startup. | ||
| + | -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too. | ||
| + | -- Documentation on modules can be found at: http:// | ||
| + | modules_enabled = { | ||
| + | |||
| + | -- Generally required | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | |||
| + | -- Not essential, but recommended | ||
| + | " | ||
| + | " | ||
| + | |||
| + | -- These are commented by default as they have a performance impact | ||
| + | --" | ||
| + | " | ||
| + | |||
| + | -- Nice to have | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | |||
| + | -- Admin interfaces | ||
| + | " | ||
| + | --" | ||
| + | |||
| + | -- HTTP modules | ||
| + | " | ||
| + | --" | ||
| + | |||
| + | -- Other specific functionality | ||
| + | --" | ||
| + | --" | ||
| + | --" | ||
| + | --" | ||
| + | --" | ||
| + | --" | ||
| + | }; | ||
| + | |||
| + | -- These modules are auto-loaded, | ||
| + | -- to disable them then uncomment them here: | ||
| + | modules_disabled = { | ||
| + | -- " | ||
| + | -- " | ||
| + | -- " | ||
| + | }; | ||
| + | |||
| + | -- Disable account creation by default, for security | ||
| + | -- For more information see http:// | ||
| + | allow_registration = false; | ||
| + | |||
| + | -- These are the SSL/ | ||
| + | -- to use SSL/TLS, you may comment or remove this | ||
| + | ssl = { | ||
| + | key = "/ | ||
| + | certificate = "/ | ||
| + | } | ||
| + | |||
| + | -- Force clients to use encrypted connections? | ||
| + | -- prevent clients from authenticating unless they are using encryption. | ||
| + | |||
| + | c2s_require_encryption = false | ||
| + | |||
| + | -- Force certificate authentication for server-to-server connections? | ||
| + | -- This provides ideal security, but requires servers you communicate | ||
| + | -- with to support encryption AND present valid, trusted certificates. | ||
| + | -- NOTE: Your version of LuaSec must support certificate verification! | ||
| + | -- For more information see http:// | ||
| + | |||
| + | s2s_secure_auth = false | ||
| + | |||
| + | -- Many servers don't support encryption or have invalid or self-signed | ||
| + | -- certificates. You can list domains here that will not be required to | ||
| + | -- authenticate using certificates. They will be authenticated using DNS. | ||
| + | |||
| + | -- s2s_insecure_domains = { " | ||
| + | |||
| + | -- Even if you leave s2s_secure_auth disabled, you can still require valid | ||
| + | -- certificates for some domains by specifying a list here. | ||
| + | |||
| + | --s2s_secure_domains = { " | ||
| + | |||
| + | -- Required for init scripts and prosodyctl | ||
| + | pidfile = "/ | ||
| + | |||
| + | -- Select the authentication backend to use. The ' | ||
| + | -- use Prosody' | ||
| + | -- To allow Prosody to offer secure authentication mechanisms to clients, the | ||
| + | -- default provider stores passwords in plaintext. If you do not trust your | ||
| + | -- server please see http:// | ||
| + | -- for information about using the hashed backend. | ||
| + | |||
| + | authentication = " | ||
| + | |||
| + | -- Select the storage backend to use. By default Prosody uses flat files | ||
| + | -- in its configured data directory, but it also supports more backends | ||
| + | -- through modules. An " | ||
| + | -- additional dependencies. See http:// | ||
| + | |||
| + | --storage = " | ||
| + | |||
| + | -- For the " | ||
| + | --sql = { driver = " | ||
| + | --sql = { driver = " | ||
| + | --sql = { driver = " | ||
| + | |||
| + | -- Logging configuration | ||
| + | -- For advanced logging see http:// | ||
| + | log = { | ||
| + | info = "/ | ||
| + | error = "/ | ||
| + | " | ||
| + | } | ||
| + | |||
| + | ----------- Virtual hosts ----------- | ||
| + | -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. | ||
| + | -- Settings under each VirtualHost entry apply *only* to that host. | ||
| + | |||
| + | VirtualHost " | ||
| + | |||
| + | VirtualHost " | ||
| + | -- enabled = false -- Remove this line to enable this host | ||
| + | |||
| + | -- Assign this host a certificate for TLS, otherwise it would use the one | ||
| + | -- set in the global section (if any). | ||
| + | -- Note that old-style SSL on port 5223 only supports one certificate, | ||
| + | -- use the global one. | ||
| + | ssl = { | ||
| + | key = "/ | ||
| + | certificate = "/ | ||
| + | } | ||
| + | |||
| + | |||
| + | ------ Components ------ | ||
| + | -- You can specify components to add hosts that provide special services, | ||
| + | -- like multi-user conferences, | ||
| + | -- For more information on components, see http:// | ||
| + | |||
| + | ---Set up a MUC (multi-user chat) room server on conference.example.com: | ||
| + | Component " | ||
| + | |||
| + | -- Set up a SOCKS5 bytestream proxy for server-proxied file transfers: | ||
| + | --Component " | ||
| + | |||
| + | ---Set up an external component (default component port is 5347) | ||
| + | -- | ||
| + | -- External components allow adding various services, such as gateways/ | ||
| + | -- transports to other networks like ICQ, MSN and Yahoo. For more info | ||
| + | -- see: http:// | ||
| + | -- | ||
| + | --Component " | ||
| + | -- component_secret = " | ||
| + | </ | ||
| + | |||
| + | ==== Модули ==== | ||
| + | |||
| + | Чтобы включить использование какого-либо дополнительного модуля Prosody, нужно в файле конфигурации указать его: | ||
| + | |||
| + | < | ||
| + | modules_enabled = { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Встроенные === | ||
| + | |||
| + | == announce == | ||
| + | |||
| + | Модуль " | ||
| + | |||
| + | Например, | ||
| + | |||
| + | wombat.org.ua/ | ||
| + | |||
| + | == motd == | ||
| + | |||
| + | Модуль " | ||
| + | |||
| + | Для того, чтобы такое сообщение отправлялось, | ||
| + | |||
| + | < | ||
| + | -- Использование [[ .. ]] вместо " .. " | ||
| + | -- позволяет вставлять несколько строк текста | ||
| + | motd_text = [[Добро пожаловть на сервер! | ||
| + | Покупайте наших слонов!]] | ||
| + | </ | ||
| + | |||
| + | === Сторонние === | ||
| + | |||
| + | Сущствует много сторонних модулей для Prosody. Посмотреть список можно по адресу: | ||
| + | |||
| + | Чтобы [[https:// | ||
| + | |||
| + | В официальной документации предлагается для скачивания папки с модулями воспользоваться командой | ||
| + | |||
| + | hg clone https:// | ||
| + | |||
| + | но если у вас не установлен клиент Mercurial (команда '' | ||
| + | |||
| + | Например, | ||
| + | |||
| + | wget https:// | ||
| + | tar -xvf 40056a27f394.tar.gz | ||
| + | sudo cp prosody-modules-40056a27f394/ | ||
| + | |||
| + | | ||
| + | ===== Jabber-сервер на 443 порту ===== | ||
| + | |||
| + | Для того, чтобы принимать соединения в порт 443, не нарушая при этом работы других сервисов (например, | ||
| + | |||
| + | / | ||
| + | |||
| + | ====== Подключение к серверам Google ====== | ||
| + | |||
| + | Если пользователю не удаётся добавить в список контактов пользователей сервисов Google (GTalk, Gmail, ...), а Jabber-сервер выдаёт в логи следующие сообщения: | ||
| + | |||
| + | Oct 21 22:57:16 s2sout95897f8 | ||
| + | Oct 21 22:57:16 s2sout95897f8 | ||
| + | Oct 21 22:57:16 s2sout95897f8 | ||
| + | Oct 21 22:57:16 s2sout95897f8 | ||
| + | Oct 21 22:57:16 s2sout95897f8 | ||
| + | |||
| + | где " | ||
| + | |||
| + | Следует отметить, | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
