{"id":161443,"date":"2012-12-05T12:56:03","date_gmt":"2012-12-05T08:56:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=161443"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=161443","title":{"rendered":"<span class=\"post_title\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Prosody v0.8 (Jabber-\u0441\u0435\u0440\u0432\u0435\u0440) \u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 LDAP<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0441\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a!<br \/>  \u0412\u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043c\u043d\u043e\u0439 OpenFire \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438\u0437 80 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u043e\u043a\u043e\u043b\u043e 2\u0445 \u0413\u0431 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u044f\u0442\u0441\u044f \u2014 \u044d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OpenFire \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. <br \/>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u0435\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u044b\u0439 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c jabber-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e ldap-\u0437\u0430\u043f\u0438\u0441\u044f\u043c, \u0438 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0438\u0437 ldap-\u0433\u0440\u0443\u043f\u043f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>  \u0418\u0437 \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u044f \u0432\u044b\u0431\u0440\u0430\u043b Prosody. \u041d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u043e.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u0430\u043b \u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e <a href=\"http:\/\/habrahabr.ru\/post\/138995\/\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"http:\/\/habrahabr.ru\/users\/acidumirae\/\" class=\"user_link\">AcidumIrae<\/a><br \/>  \u0412\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043a\u0443\u0447\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0422\u043e saslauthd \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a LDAP, \u043f\u043e\u0442\u043e\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e saslauthd \u0438\u0449\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443 userPrincipalName, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043c\u043e\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u044f\u0445 LDAP \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u0411\u044b\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u0435\u043b\u043e\u0447\u0438, \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043d\u044e, \u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0437\u0438\u043b\u0441\u044f \u0431\u0435\u0437\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043d\u043e \u0434\u043d\u044f \u0434\u0432\u0430.<br \/>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043d\u0443\u043b\u044f, \u0431\u0435\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Prosody \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<br \/>  \u0421\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0443\u0434\u0443 \u043d\u0430 Debian 6.0, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u0442\u043e\u043c.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0430\u043a\u0435\u0442 prosody, \u043d\u043e \u0432\u0435\u0440\u0441\u0438\u0438 0.7, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 LDAP \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0443 \u043c\u0435\u043d\u044f \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u043e\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0432\u043b\u044e \u043f\u0430\u043a\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 0.8 \u0434\u043b\u044f 64bit-\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <a href=\"http:\/\/prosody.im\/download\/start\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>. \u0422\u0430\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0417\u0430\u043e\u0434\u043d\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c LuaSec \u043e\u0442\u0442\u0443\u0434\u0430 \u0436\u0435.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0435\u0431\u0438\u0430\u043d \u0440\u0443\u0433\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 apt-get install lua5.1 liblua5.1-0 liblua5.1-expat0 liblua5.1-socket2 liblua5.1-filesystem0 # \u0410 \u0442\u0435\u043f\u0435\u0440\u044c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Prosody wget http:\/\/prosody.im\/downloads\/debian\/prosody_0.8.2-1_amd64.deb wget http:\/\/prosody.im\/downloads\/debian\/liblua5.1-sec0_0.3.2-2prosody1_amd64.deb dpkg -i liblua5.1-sec0_0.3.2-2prosody1_amd64.deb dpkg -i prosody_0.8.2-1_amd64.deb <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 LDAP \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 Prosody, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u0442\u0430\u0432\u044f\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438:<br \/>  mod_auth_ldap, mod_storage_ldap, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u0442\u0435\u043a\u0438 ldap.lib.lua(mod_lib_ldap) \u0438 vcard.lib.lua<br \/>  \u0414\u043e\u0431\u044b\u043b \u044f \u0438\u0445 \u0437\u0434\u0435\u0441\u044c \u2014 <a href=\"http:\/\/0-8.prosody-modules.googlecode.com\/hg\/\">0-8.prosody-modules.googlecode.com\/hg\/<\/a><br \/>  \u041a\u0440\u043e\u043c\u0435 mod_auth_ldap, \u0435\u0433\u043e \u0441\u043a\u0430\u0447\u0430\u043b \u0441 <a href=\"http:\/\/scm.stefant.org\/svn\/tools\/stuff\/trunk\/patches\/prosody\/\">scm.stefant.org\/svn\/tools\/stuff\/trunk\/patches\/prosody\/<\/a>, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443 \u043c\u0435\u043d\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u0438. \u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441\u0443\u043d\u0443 \u0432 \u0441\u043f\u043e\u0439\u043b\u0435\u0440 \u0442\u0435\u043a\u0441\u0442 \u043c\u043e\u0434\u0443\u043b\u044f  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">mod_auth_ldap.lua<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">local new_sasl = require &quot;util.sasl&quot;.new; local nodeprep = require &quot;util.encodings&quot;.stringprep.nodeprep; local log = require &quot;util.logger&quot;.init(&quot;auth_ldap&quot;);  local ldap_server = module:get_option(&quot;ldap_server&quot;) or &quot;localhost&quot;; local ldap_rootdn = module:get_option(&quot;ldap_rootdn&quot;) or &quot;&quot;; local ldap_password = module:get_option(&quot;ldap_password&quot;) or &quot;&quot;; local ldap_tls = module:get_option(&quot;ldap_tls&quot;); local ldap_base = assert(module:get_option(&quot;ldap_base&quot;), &quot;ldap_base is a required option for ldap&quot;); local ldap_scope = module:get_option(&quot;ldap_scope&quot;) or &quot;onelevel&quot;; local ldap_filter = module:get_option(&quot;ldap_filter&quot;) or &quot;&quot;;  local lualdap = require &quot;lualdap&quot;; local ld = assert(lualdap.open_simple(ldap_server, ldap_rootdn, ldap_password, ldap_tls)); module.unload = function() ld:close(); end  local function ldap_filter_escape(s) return (s:gsub(&quot;[\\\\*\\\\(\\\\)\\\\\\\\%z]&quot;, function(c) return (&quot;\\\\%02x&quot;):format(c:byte()) end)); end  local function find_userdn(username) \tlocal iter, err = ld:search { \t\tbase = ldap_base; \t\t-- we need to set scope here, else ldap-search may fail (silently!!) \t\tscope = ldap_scope; \t\tfilter = &quot;(&(uid=&quot;..ldap_filter_escape(username)..&quot;)&quot;..ldap_filter..&quot;)&quot;; \t} \tif not iter then \t    module:log(&quot;error&quot;, &quot;LDAP usersearch failed (%s): %s&quot;, username, err); \t    return false; \tend \tfor dn, attribs in iter do \t   return dn; \tend \treturn false; end  local provider = { name = &quot;ldap&quot; };  function provider.test_password(username, password) \tlocal userdn = find_userdn(username); \tif not userdn then return false; end \t \tlocal ldu = lualdap.open_simple(ldap_server, userdn, password, ldap_tls); \tif not ldu then return false; end  \tldu:close(); \treturn true; end  function provider.user_exists(username) \treturn find_userdn(username); end  function provider.get_password(username) return nil, &quot;Passwords unavailable for LDAP.&quot;; end function provider.set_password(username, password) return nil, &quot;Passwords unavailable for LDAP.&quot;; end function provider.create_user(username, password) return nil, &quot;Account creation\/modification not available with LDAP.&quot;; end  function provider.get_sasl_handler() \tlocal realm = module:get_option(&quot;sasl_realm&quot;) or module.host; \tlocal testpass_authentication_profile = { \t\tplain_test = function(sasl, username, password, realm) \t\t\tlocal prepped_username = nodeprep(username); \t\t\tif not prepped_username then \t\t\t\tlog(&quot;debug&quot;, &quot;NODEprep failed on username: %s&quot;, username); \t\t\t\treturn &quot;&quot;, nil; \t\t\tend \t\t\treturn provider.test_password(prepped_username, password), true; \t\tend \t}; \treturn new_sasl(realm, testpass_authentication_profile); end  module:add_item(&quot;auth-provider&quot;, provider); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<pre><code class=\"bash\"># \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 Prosody \u0438 \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0442\u0443\u0434\u0430 # \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \/usr\/lib\/prosody\/modules cd \/usr\/lib\/prosody\/modules wget http:\/\/scm.stefant.org\/svn\/tools\/stuff\/trunk\/patches\/prosody\/mod_auth_ldap.lua wget http:\/\/0-8.prosody-modules.googlecode.com\/hg\/mod_storage_ldap\/mod_storage_ldap.lua wget http:\/\/0-8.prosody-modules.googlecode.com\/hg\/mod_lib_ldap\/ldap.lib.lua # \u0411\u0438\u0431\u043b\u0438\u0442\u0435\u043a\u0430 vcard.lib.lua \u0434\u043e\u043b\u0436\u043d\u0430 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 ldap mkdir ldap cd ldap wget http:\/\/0-8.prosody-modules.googlecode.com\/hg\/mod_storage_ldap\/ldap\/vcard.lib.lua <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0438.<\/p>\n<p>  \/etc\/prosody\/prosody.cfg.lua<br \/>  1. \u0412\u043a\u043b\u044e\u0447\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430:<br \/>  \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u043f\u0446\u0438\u044e &quot;&#8212;c2s_require_encryption = false&quot;, \u0440\u0430\u0441\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u043c\u0435\u043d\u044f\u0435\u043c false \u043d\u0430 true<br \/>  2. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e LDAP:<br \/>  \u043d\u0430\u0445\u043e\u0434\u0438\u043c authentication = \u00abinternal_plain\u00bb \u0438 \u043c\u0435\u043d\u044f\u0435\u043c  <\/p>\n<pre><code class=\"lua\">authentication = &quot;ldap&quot;; ldap_server = &quot;localhost&quot;; ldap_base = &quot;ou=users,dc=example,dc=com&quot;; ldap_rootdn = &quot;cn=manager,dc=example,dc=com&quot;; ldap_password = &quot;password&quot;; <\/code><\/pre>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u2014 <a href=\"https:\/\/code.google.com\/p\/prosody-modules\/wiki\/mod_auth_ldap\">code.google.com\/p\/prosody-modules\/wiki\/mod_auth_ldap<\/a><br \/>  3. \u0418\u043d\u043a\u043b\u044e\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f mod_storage_ldap  <\/p>\n<pre><code class=\"lua\">Include '\/etc\/prosody\/prosody-posix-ldap.cfg.lua' <\/code><\/pre>\n<p>4. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0430\u0448 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0435\u043a\u0446\u0438\u044e Virtual hosts  <\/p>\n<pre><code class=\"lua\">VirtualHost &quot;example.com&quot;         ssl = {                 key = &quot;\/etc\/prosody\/certs\/localhost.key&quot;;                 certificate = &quot;\/etc\/prosody\/certs\/localhost.cert&quot;;         } <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/prosody\/prosody.cfg.lua<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">-- Prosody XMPP Server Configuration -- -- Information on configuring Prosody can be found on our -- website at http:\/\/prosody.im\/doc\/configure -- -- 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. --  ---------- 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:\/\/prosody.im\/doc\/creating_accounts for info) -- Example: admins = { &quot;user1@example.com&quot;, &quot;user2@example.net&quot; } admins = { }  -- Enable use of libevent for better performance under high load -- For more information see: http:\/\/prosody.im\/doc\/libevent use_libevent = false;  -- 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:\/\/prosody.im\/doc\/modules modules_enabled = {  \t-- Generally required \t\t&quot;roster&quot;; -- Allow users to have a roster. Recommended ;) \t\t&quot;saslauth&quot;; -- Authentication for clients and servers. Recommended if you want to log in. \t\t&quot;tls&quot;; -- Add support for secure TLS on c2s\/s2s connections \t\t&quot;dialback&quot;; -- s2s dialback support \t\t&quot;disco&quot;; -- Service discovery  \t-- Not essential, but recommended \t\t&quot;private&quot;; -- Private XML storage (for room bookmarks, etc.) \t\t&quot;vcard&quot;; -- Allow users to set vCards \t\t--&quot;privacy&quot;; -- Support privacy lists \t\t--&quot;compression&quot;; -- Stream compression  \t-- Nice to have \t\t&quot;legacyauth&quot;; -- Legacy authentication. Only used by some old clients and bots. \t\t&quot;version&quot;; -- Replies to server version requests \t\t&quot;uptime&quot;; -- Report how long server has been running \t\t&quot;time&quot;; -- Let others know the time here on this server \t\t&quot;ping&quot;; -- Replies to XMPP pings with pongs \t\t&quot;pep&quot;; -- Enables users to publish their mood, activity, playing music and more \t\t&quot;register&quot;; -- Allow users to register on this server using a client and change passwords \t\t&quot;adhoc&quot;; -- Support for &quot;ad-hoc commands&quot; that can be executed with an XMPP client  \t-- Admin interfaces \t\t&quot;admin_adhoc&quot;; -- Allows administration via an XMPP client that supports ad-hoc commands \t\t--&quot;admin_telnet&quot;; -- Opens telnet console interface on localhost port 5582  \t-- Other specific functionality \t\t&quot;posix&quot;; -- POSIX functionality, sends server to background, enables syslog, etc. \t\t--&quot;bosh&quot;; -- Enable BOSH clients, aka &quot;Jabber over HTTP&quot; \t\t--&quot;httpserver&quot;; -- Serve static files from a directory over HTTP \t\t--&quot;groups&quot;; -- Shared roster support \t\t--&quot;announce&quot;; -- Send announcement to all online users \t\t--&quot;welcome&quot;; -- Welcome users who register accounts \t\t--&quot;watchregistrations&quot;; -- Alert admins of registrations \t\t--&quot;motd&quot;; -- Send a message to users when they log in };  -- These modules are auto-loaded, should you -- (for some mad reason) want to disable -- them then uncomment them below modules_disabled = { \t-- &quot;presence&quot;; -- Route user\/contact status information \t-- &quot;message&quot;; -- Route messages \t-- &quot;iq&quot;; -- Route info queries \t-- &quot;offline&quot;; -- Store offline messages };  -- Disable account creation by default, for security -- For more information see http:\/\/prosody.im\/doc\/creating_accounts allow_registration = false;  -- These are the SSL\/TLS-related settings. If you don't want -- to use SSL\/TLS, you may comment or remove this ssl = { \tkey = &quot;\/etc\/prosody\/certs\/localhost.key&quot;; \tcertificate = &quot;\/etc\/prosody\/certs\/localhost.cert&quot;; }  -- Only allow encrypted streams? Encryption is already used when -- available. These options will cause Prosody to deny connections that -- are not encrypted. Note that some servers do not support s2s -- encryption or have it disabled, including gmail.com and Google Apps -- domains.  c2s_require_encryption = true --s2s_require_encryption = false  -- Select the authentication backend to use. The 'internal' providers -- use Prosody's configured data storage to store the authentication data. -- 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:\/\/prosody.im\/doc\/modules\/mod_auth_internal_hashed -- for information about using the hashed backend.  --authentication = &quot;internal_plain&quot; authentication = &quot;ldap&quot;; ldap_server = &quot;localhost&quot;; ldap_base = &quot;ou=users,dc=example,dc=com&quot;; ldap_rootdn = &quot;cn=manager,dc=example,dc=com&quot;; ldap_password = &quot;password&quot;; --ldap_filter = &quot;(authorizedService=jabber)&quot;; -- optional  Include '\/etc\/prosody\/prosody-posix-ldap.cfg.lua'  -- 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 &quot;sql&quot; backend is included by default, but requires -- additional dependencies. See http:\/\/prosody.im\/doc\/storage for more info.  --storage = &quot;sql&quot; -- Default is &quot;internal&quot;  -- For the &quot;sql&quot; backend, you can uncomment *one* of the below to configure: --sql = { driver = &quot;SQLite3&quot;, database = &quot;prosody.sqlite&quot; } -- Default. 'database' is the filename. --sql = { driver = &quot;MySQL&quot;, database = &quot;prosody&quot;, username = &quot;prosody&quot;, password = &quot;secret&quot;, host = &quot;localhost&quot; } --sql = { driver = &quot;PostgreSQL&quot;, database = &quot;prosody&quot;, username = &quot;prosody&quot;, password = &quot;secret&quot;, host = &quot;localhost&quot; }  -- Logging configuration -- For advanced logging see http:\/\/prosody.im\/doc\/logging -- Hint: If you create a new log file or rename them, don't forget  -- to update the logrotate config at \/etc\/logrotate.d\/prosody log = {         -- Log all error messages to prosody.err \terror = &quot;\/var\/log\/prosody\/prosody.err&quot;;         -- Log everything of level &quot;info&quot; and higher (that is, all except &quot;debug&quot; messages)         -- to prosody.log         info = &quot;\/var\/log\/prosody\/prosody.log&quot;; -- Change 'info' to 'debug' for more verbose logging         --&quot;*syslog&quot;; -- Uncomment this for logging to syslog }  -- Pidfile, used by prosodyctl and the init.d script pidfile = &quot;\/var\/run\/prosody\/prosody.pid&quot;;  ----------- 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 &quot;localhost&quot;  VirtualHost &quot;example.com&quot; \t-- enabled = false -- Remove this line to enable this host  \t-- Assign this host a certificate for TLS, otherwise it would use the one \t-- set in the global section (if any). \t-- Note that old-style SSL on port 5223 only supports one certificate, and will always \t-- use the global one.         ssl = {                 key = &quot;\/etc\/prosody\/certs\/localhost.key&quot;;                 certificate = &quot;\/etc\/prosody\/certs\/localhost.cert&quot;;         }  ------ Components ------ -- You can specify components to add hosts that provide special services, -- like multi-user conferences, and transports. -- For more information on components, see http:\/\/prosody.im\/doc\/components  ---Set up a MUC (multi-user chat) room server on conference.example.com: --Component &quot;conference.example.com&quot; &quot;muc&quot;  -- Set up a SOCKS5 bytestream proxy for server-proxied file transfers: --Component &quot;proxy.example.com&quot; &quot;proxy65&quot;  ---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:\/\/prosody.im\/doc\/components#adding_an_external_component -- --Component &quot;gateway.example.com&quot; --\tcomponent_secret = &quot;password&quot; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f mod_lib_ldap, \u044f \u0441\u043a\u0430\u0447\u0430\u044e \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0438 \u0438\u0437\u043c\u0435\u043d\u044e \u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b  <\/p>\n<pre><code class=\"bash\">cd \/etc\/prosody wget http:\/\/0-8.prosody-modules.googlecode.com\/hg\/mod_lib_ldap\/dev\/prosody-posix-ldap.cfg.lua chmod 755 prosody-posix-ldap.cfg.lua <\/code><\/pre>\n<p>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0437\u0446\u044b \u043b\u0435\u0436\u0430\u0442 \u0437\u0434\u0435\u0441\u044c \u2014 <a href=\"http:\/\/0-8.prosody-modules.googlecode.com\/hg\/mod_lib_ldap\/dev\/\">0-8.prosody-modules.googlecode.com\/hg\/mod_lib_ldap\/dev\/<\/a><br \/>  \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/prosody\/prosody-posix-ldap.cfg.lua<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">-- Use Include 'prosody-posix-ldap.cfg.lua' from prosody.cfg.lua to include this file authentication = 'ldap' -- Indicate that we want to use LDAP for authentication --storage        = 'ldap' -- Indicate that we want to use LDAP for roster\/vcard storage storage = {         roster = &quot;ldap&quot;;         vcard = &quot;ldap&quot;; }  ldap = {    hostname      = 'localhost',                    -- LDAP server location     bind_dn       = 'cn=manager,dc=example,dc=com', -- Bind DN for LDAP authentication (optional if anonymous bind is supported)     bind_password = 'password',                      -- Bind password (optional if anonymous bind is supported)      user = {       basedn        = 'ou=users,dc=example,dc=com', -- The base DN where user records can be found       filter        = 'objectClass=posixAccount',   -- Filter expression to find user records under basedn       usernamefield = 'uid',                        -- The field that contains the user's ID (this will be the username portion of the JID)       namefield     = 'cn',                         -- The field that contains the user's full name (this will be the alias found in the roster)     },      groups = {       basedn      = 'ou=groups,dc=example,dc=com', -- The base DN where group records can be found       memberfield = 'memberUid',                   -- The field that contains user ID records for this group (each member must have a corresponding entry under the user basedn with the same value in usernamefield)       namefield   = 'cn',                          -- The field that contains the group's name (used for matching groups in LDAP to group definitions below)        {         name  = 'First Group', -- The group name that will be seen in users' rosters         cn    = 'first_group', -- This field's key *must* match ldap.groups.namefield! It's the name of the LDAP group this definition represents         admin = false,      -- (Optional) A boolean flag that indicates whether members of this group should be considered administrators.       },       {         name  = 'Second Group',         cn    = 'second_group',         admin = true,       },     },      vcard_format = {       displayname = 'cn', -- Consult the vCard configuration section in the README       nickname    = 'uid',     }, } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 groups \u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b \u0433\u0440\u0443\u043f\u043f\u044b \u0438\u0437 LDAP. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u0435\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0435. <br \/>  \u041d\u043e \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0435\u043b \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0435\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0432 \/usr\/lib\/prosody\/modules\/mod_storage_ldap.lua. <u>\u0415\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442<\/u><br \/>  \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \/usr\/lib\/prosody\/modules\/mod_storage_ldap.lua \u0441\u0442\u0440\u043e\u043a\u0443  <\/p>\n<pre><code class=\"lua\">    local filter      = memberfield .. '=' .. tostring(username); <\/code><\/pre>\n<p>\u0417\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u043c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043d\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"lua\">    --local filter      = memberfield .. '=' .. tostring(username);     local filter; <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043b\u043e\u0433\u0438 (\/var\/log\/prosody) \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438. <br \/>  \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c lualdap, \u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u044b\u0440\u0446\u044b <a href=\"http:\/\/files.luaforge.net\/releases\/lualdap\/lualdap\/LuaLDAP1.1.0\">lualdap<\/a> \u0438 <a href=\"http:\/\/files.luaforge.net\/releases\/compat\/Compat-5.1\/Compat-5.1release5\">compat<\/a>  <\/p>\n<pre><code class=\"bash\"># \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 apt-get install libldap-dev liblua5.1-0-dev # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043d\u0435\u0435 mkdir \/tmp\/lualdap cd \/tmp\/lualdap # \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0441\u044b\u0440\u0446\u044b wget http:\/\/files.luaforge.net\/releases\/lualdap\/lualdap\/LuaLDAP1.1.0\/lualdap-1.1.0.tar.gz wget http:\/\/files.luaforge.net\/releases\/compat\/Compat-5.1\/Compat-5.1release5\/compat-5.1r5.tar.gz # \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c  tar xvfz compat-5.1r5.tar.gz tar xvfz lualdap-1.1.0.tar.gz <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0440\u0435\u0445\u0442\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0443\u0442\u0438. \u041c\u043e\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">lualdap-1.1.0\/config<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"># Installation directories # System's libraries directory (where binary libraries are installed) LUA_LIBDIR= \/usr\/lib\/lua\/5.1 # Lua includes directory LUA_INC= \/usr\/include\/lua5.1 # OpenLDAP includes directory OPENLDAP_INC= \/usr\/include # OpenLDAP library (an optional directory can be specified with -L&lt;dir&gt;) OPENLDAP_LIB= -lldap  # OS dependent LIB_OPTION= -shared #for Linux #LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X  # Lua version number (first and second digits of target version) LUA_VERSION_NUM= 500 LIBNAME= $T.so.$V COMPAT_DIR= ..\/compat-5.1r5  # Compilation parameters WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -ansi INCS= -I$(LUA_INC) -I$(OPENLDAP_INC) -I$(COMPAT_DIR) CFLAGS= $(WARN) $(INCS) CC= gcc  # $Id: config,v 1.5 2006\/07\/24 01:42:06 tomas Exp $<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">lualdap-1.1.0\/Makefile<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"># $Id: Makefile,v 1.30 2007\/03\/13 22:07:33 godinho Exp $  T= lualdap V= 1.1.0 CONFIG= .\/config  include $(CONFIG)  ifeq &quot;$(LUA_VERSION_NUM)&quot; &quot;500&quot; COMPAT_O= $(COMPAT_DIR)\/compat-5.1.o endif  OBJS= src\/lualdap.o $(COMPAT_O)   src\/$(LIBNAME): $(OBJS)         export MACOSX_DEPLOYMENT_TARGET=&quot;10.3&quot;; $(CC) $(CFLAGS) $(LIB_OPTION) -o src\/$(LIBNAME) $(OBJS) $(OPENLDAP_LIB)  $(COMPAT_DIR)\/compat-5.1.o: $(COMPAT_DIR)\/compat-5.1.c         $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)\/compat-5.1.c  install: src\/$(LIBNAME)         mkdir -p $(LUA_LIBDIR)         cp src\/$(LIBNAME) $(LUA_LIBDIR)         cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so  clean:         rm -f $(OBJS) src\/$(LIBNAME) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c  <\/p>\n<pre><code class=\"bash\">make make install <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<p>  \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438   <\/p>\n<ul>\n<li><a href=\"http:\/\/www.prosody.im\/doc\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Prosody<\/a><\/li>\n<li><a href=\"https:\/\/code.google.com\/p\/prosody-modules\/\">\u041c\u043e\u0434\u0443\u043b\u0438, \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043a\u0435\u0442<\/a><\/li>\n<li><a href=\"https:\/\/wiki.koumbit.net\/ProsodyConfiguration\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u0432\u044f\u0437\u043a\u0435 Prosody + LDAP<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/161443\/\"> http:\/\/habrahabr.ru\/post\/161443\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0441\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a!<br \/>  \u0412\u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043c\u043d\u043e\u0439 OpenFire \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438\u0437 80 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u043e\u043a\u043e\u043b\u043e 2\u0445 \u0413\u0431 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438, \u043d\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u044f\u0442\u0441\u044f \u2014 \u044d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 OpenFire \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u0438 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440. <br \/>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u0435\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u044b\u0439 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c jabber-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e ldap-\u0437\u0430\u043f\u0438\u0441\u044f\u043c, \u0438 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0438\u0437 ldap-\u0433\u0440\u0443\u043f\u043f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>  \u0418\u0437 \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u044f \u0432\u044b\u0431\u0440\u0430\u043b Prosody. \u041d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u043e.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-161443","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161443"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161443\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}