{"id":359,"date":"2016-04-22T14:48:11","date_gmt":"2016-04-22T14:48:11","guid":{"rendered":"http:\/\/www.nywzjs.com\/?p=359"},"modified":"2016-08-13T09:24:40","modified_gmt":"2016-08-13T09:24:40","slug":"%e9%85%8d%e7%bd%ae%e5%b0%8f%e4%ba%ac%e4%b8%9c%e7%9a%84%e5%8d%b3%e6%97%b6%e9%80%9a%e4%bf%a1%ef%bc%88im%ef%bc%89%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"http:\/\/www.nywzjs.com\/?p=359","title":{"rendered":"\u914d\u7f6e\u5c0f\u4eac\u4e1c\u7684\u5373\u65f6\u901a\u4fe1\uff08IM\uff09\u670d\u52a1"},"content":{"rendered":"<p>\u5c0f\u4eac\u4e1c\u81ea\u5e26\u7684\u662f\u6709\u5373\u65f6\u901a\u4fe1\u670d\u52a1\u7684\uff0c\u4f46\u662f\u7f51\u4e0a\u6d41\u4f20\u7684\u5927\u591a\u90fd\u9609\u5272\u4e86\u8fd9\u4e2a\u529f\u80fd\uff0c\uff0c\u5176\u5b9e\uff0c\uff0c\u8fd9\u4e2a\u529f\u80fd\u8fd8\u662f\u5f88\u6709\u7528\u7684\uff0c\uff0c<\/p>\n<p>\u600e\u4e48\u914d\u8d77\u6765\u5462\uff1f<\/p>\n<p>\u9996\u5148\uff0c\u9700\u8981JAVA\u73af\u5883\uff08\u5927\u7ea6\u4e5f\u5c31\u662f\u8981\u4e0b\u8f7d\u5b89\u88c5JDK\uff09\u3010\u8fd9\u4e2a\u5f85\u5b9a\uff0c\u53ef\u4ee5\u5148\u8bd5\u4e0b\u4e0d\u5b89\u88c5JDK\u7684\u3011\uff0c\u5176\u6b21\u591a\u4e2a\u4eba\u90fd\u63a8\u8350\u4f7f\u7528Linux\u7cfb\u7edf\uff0c\uff0c\uff0c<\/p>\n<p>\u7528\u7684\u963f\u91cc\u4e91\u7684\u670d\u52a1\u5668\u5b89\u88c5JDK\u73af\u5883\u7684\u65b9\u6cd5\uff0c\u5b89\u88c5\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>Windows\u4e3b\u673a\uff1ahttps:\/\/help.aliyun.com\/knowledge_detail\/6702345.html<\/p>\n<p>Linux\u4e3b\u673a\uff1ahttps:\/\/help.aliyun.com\/knowledge_detail\/6507861.html<\/p>\n<p><strong>1\u3001\u4e0b\u8f7dOpenFire<\/strong><\/p>\n<p>\u6700\u65b0\u7248\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/www.igniterealtime.org\/downloads\/index.jsp<\/p>\n<p>\u4e0b\u8f7d\u6700\u65b0\u7248\u7684Openfire\uff0c\u4e0b\u8f7d\u540e\u4e0a\u4f20\u5230Linux\u3002\u6211\u7684\u662f\u5728root\u76ee\u5f55\u3002<\/p>\n<p>\u4e0a\u4f20\u540e\u767b\u9646\u7ec8\u7aef\uff0c\u6267\u884c\u547d\u4ee4\u3002<\/p>\n<p><span style=\"color: #993300;\">rpm -ivh openfire-4.0.2-1.i386.rpm<\/span><\/p>\n<p>\u6ca1\u6709\u62a5\u9519\u56de\u5230\u547d\u4ee4\u7b26\u4e0b\u5373\u5b89\u88c5\u5b8c\u6210\uff0c\u6267\u884c\uff1a<\/p>\n<p><span style=\"color: #993300;\">\/etc\/init.d\/openfire start<\/span><\/p>\n<p>\u663e\u793a[OK]\u5373\u5b89\u88c5\u5b8c\u6210<\/p>\n<p><strong>2\u3001\u914d\u7f6eOpenfire<\/strong><\/p>\n<p>\u6253\u5f00\u7f51\u5740\uff1aip:9090\u5373\u6253\u5f00\u914d\u7f6e\u9875\u9762\u3002<\/p>\n<p>\u6839\u636e\u5411\u5bfc\u8fdb\u884c\u914d\u7f6e\u5373\u53ef\u3002<\/p>\n<p>\u6ce8\u610f\uff1a<\/p>\n<p><a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/00002.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-360\" src=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/00002-300x180.jpg\" alt=\"00002\" width=\"300\" height=\"180\" srcset=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/00002-300x180.jpg 300w, http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/00002.jpg 835w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u8fd9\u4e00\u6b65\u4e2d\uff0c\u57df\u7684\u4f4d\u7f6e\u586b\u5199\u771f\u5b9eIP\u6216\u57df\u540d\u3002\u5426\u5219\u4f1a\u51fa\u9519\u3002<\/p>\n<p>\u4e0b\u4e00\u6b65\u9700\u8981\u586b\u5199\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u53ef\u4ee5\u9009\u62e9Mysql\uff0c\u53ef\u4ee5\u4e0eECSHOP\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u4e5f\u53ef\u4ee5\u5206\u5f00\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u6ca1\u6709\u9700\u8981\u6ce8\u610f\u7684\u5730\u65b9\uff0c\u6309\u5411\u5bfc\u64cd\u4f5c\u3002<\/p>\n<p>\u8fdb\u5165\u7ba1\u7406\u5e73\u53f0\u3002<\/p>\n<p><strong>3\u3001\u5b89\u88c5\u63d2\u4ef6\uff1a<\/strong><\/p>\n<p>\u767b\u9646\u7ba1\u7406\u63a7\u5236\u53f0-\u63d2\u4ef6-\u6709\u6548\u7684\u63d2\u4ef6<\/p>\n<p>\u5b89\u88c5Fastpath Service \u00a0\uff0cPresence Service \u00a0\uff0cUser Service \u00a0\u4e09\u4e2a\u63d2\u4ef6\uff0c\u9ed8\u8ba4\u6709Search \u00a0\uff0c\u603b\u51714\u4e2a\u3002<\/p>\n<p>\u914d\u7f6e\u63d2\u4ef6\uff1a\u7ba1\u7406\u63a7\u5236\u53f0-\u670d\u52a1\u5668-\u670d\u52a1\u5668\u914d\u7f6e<\/p>\n<p>\u63d2\u4ef6\u914d\u7f6e\u5982\u56fe\uff1a<\/p>\n<p><a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/012.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-361\" src=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/012-300x234.jpg\" alt=\"012\" width=\"300\" height=\"234\" srcset=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/012-300x234.jpg 300w, http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/012.jpg 709w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/013.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-362\" src=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/013-300x272.jpg\" alt=\"013\" width=\"300\" height=\"272\" srcset=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/013-300x272.jpg 300w, http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/013.jpg 581w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>4\u3001\u4fee\u6539\u5c0f\u4eac\u4e1c\u7a0b\u5e8f<\/strong><\/p>\n<p>includes\u76ee\u5f55\u4e0b\uff1alib_chat.php<br \/>\n\u4fee\u6539\u51fd\u6570\u51fd\u6570\uff08\u5224\u65ad\u7528\u6237\u662f\u5426\u5b58\u5728\uff09\uff1afunction check_of_username_exist<\/p>\n<p>\/**<br \/>\n*<br \/>\n* \u5224\u65ad\u7528\u6237\u662f\u5426\u5b58\u5728<br \/>\n*<br \/>\n* @param string $username<br \/>\n* @return boolean<br \/>\n*\/<br \/>\nfunction check_of_username_exist($username)<br \/>\n{<br \/>\n$_CFG = $GLOBALS['_CFG'];<br \/>\n$of_username = $_CFG['chat_server_admin_username'];<br \/>\n$of_password = $_CFG['chat_server_admin_password'];<br \/>\n$of_ip = $_CFG['chat_server_ip'];<br \/>\n$of_port = $_CFG['chat_server_port'];<\/p>\n<p>$of_url = get_of_url($of_ip, $of_port);<br \/>\nif(empty($username))<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>$url = $of_url.'\/plugins\/userService\/users\/'.$username;<\/p>\n<p>$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, $url);<br \/>\n\/\/ \u6388\u6743\u9a8c\u8bc1<br \/>\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);<br \/>\ncurl_setopt($ch, CURLOPT_USERPWD, $of_username.\":\".$of_password);<\/p>\n<p>\/\/ \u8bbe\u7f6e\u53ef\u4ee5\u8bfb\u53d6\u8fd4\u56de\u503c<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<\/p>\n<p>\/\/ \u8fd0\u884ccurl<br \/>\n$result = trim(curl_exec ( $ch ));<br \/>\n\/\/ \u5173\u95ed<br \/>\ncurl_close ( $ch );<\/p>\n<p>\/\/\u8bfbXML\u6587\u4ef6\u5185\u5bb9\uff0c\u5e76\u4fdd\u5b58\u5230\u5b57\u7b26\u4e32\u53d8\u91cf\u4e2d<br \/>\n$xml = new SimpleXMLElement($result);<br \/>\n\/\/\u83b7\u5f97username\u7684\u503c<br \/>\n$test = new SimpleXMLElement($result);<br \/>\n$refusername = $test-&gt;username;<br \/>\nif(!empty($username))<br \/>\n{<br \/>\nif($refusername == $username)<br \/>\n{<br \/>\nreturn true;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nreturn false;<br \/>\n}<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>}<br \/>\n\u4fee\u6539\u51fd\u6570\u540d\uff1a\u83b7\u53d6\u804a\u5929\u670d\u52a1\u5668\u7684\u57df\u540d\uff1afunction get_xmpp_domain()<br \/>\n\/**<br \/>\n*<br \/>\n* \u83b7\u53d6\u804a\u5929\u670d\u52a1\u5668\u7684\u57df\u540d<br \/>\n*<br \/>\n* @param unknown $username<br \/>\n* @param string $type \u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b\uff1axml,text,image,\u9ed8\u8ba4\u4e3atext<br \/>\n* @return string<br \/>\n*\/<br \/>\nfunction get_xmpp_domain()<br \/>\n{<br \/>\n$_CFG = $GLOBALS['_CFG'];<br \/>\n$of_username = $_CFG['chat_server_admin_username'];<br \/>\n$of_password = $_CFG['chat_server_admin_password'];<br \/>\n$of_ip = $_CFG['chat_server_ip'];<br \/>\n$of_port = $_CFG['chat_server_port'];<\/p>\n<p>$of_url = get_of_url($of_ip, $of_port);<\/p>\n<p>$url = $of_url.'\/plugins\/userService\/users\/domain';<\/p>\n<p>$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, $url);<br \/>\n\/\/ \u6388\u6743\u9a8c\u8bc1<br \/>\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);<br \/>\ncurl_setopt($ch, CURLOPT_USERPWD, $of_username.\":\".$of_password);<br \/>\n\/\/ \u8bbe\u7f6e\u53ef\u4ee5\u8bfb\u53d6\u8fd4\u56de\u503c<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<\/p>\n<p>\/\/ \u8fd0\u884ccurl<br \/>\n$result = trim(curl_exec ( $ch ));<\/p>\n<p>\/\/ \u5173\u95ed<br \/>\ncurl_close ( $ch );<br \/>\n\/\/\u83b7\u5f97email\u7684\u503c<br \/>\n$test = new SimpleXMLElement($result);<br \/>\n$email = $test-&gt;email;<br \/>\n$result = $email;<br \/>\nreturn $result;<br \/>\n}<\/p>\n<p>\u4e0a\u4f20\u4e4b\u540e\u53d8\u5f62\uff0c\u7279\u5730\u5b58\u4e86txt\u6587\u4ef6\u3002<a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/lib_chat.txt\">lib_chat<\/a><\/p>\n<p><strong>5\u3001\u914d\u7f6e\u5c0f\u4eac\u4e1c<\/strong><\/p>\n<p>\u540e\u53f0-\u5373\u65f6\u901a\u4fe1-\u804a\u5929\u670d\u52a1\u5668\u8bbe\u7f6e \u00a0\u8bbe\u7f6e\u5982\u56fe\uff1a<\/p>\n<p><a href=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/ser.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-364\" src=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/ser-300x212.jpg\" alt=\"ser\" width=\"300\" height=\"212\" srcset=\"http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/ser-300x212.jpg 300w, http:\/\/www.nywzjs.com\/wp-content\/uploads\/2016\/04\/ser.jpg 520w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>6\u3001\u4e0b\u8f7dspark<\/strong><\/p>\n<p>\u8fd9\u4e2a\u5c31\u662f\u5546\u5bb6\u8981\u7528\u7684\u5ba2\u6237\u7aef\u4e86\u3002<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/www.igniterealtime.org\/downloads\/index.jsp<\/p>\n<p>\u5b89\u88c5\u540e\u7528\u540e\u53f0\u6dfb\u52a0\u7684\u5ba2\u670d\u767b\u9646\u5373\u53ef\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p><strong>\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\uff1a<\/strong><\/p>\n<p>1\u3001\u542f\u52a8Openfire\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u4f1a\u62a5\u9519\uff1a<\/p>\n<p>Starting openfire (via systemctl): Job for openfire.service failed because a configured resource limit was exceeded. See \"systemctl status openfire.service\" and \"journalctl -xe\" for details.<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u662f\uff1a<\/p>\n<p>\u6253\u5f00\/etc\/init.d\/openfire\u6587\u4ef6\uff0c\u5c06JAVA_HOME\u6539\u6210JDK\u7684\u76ee\u5f55\uff0c\u5982<\/p>\n<p><span style=\"color: #993300;\">JAVA_HOME=\"\/usr\/local\/src\/jdk1.8.0_77\/\"<\/span><\/p>\n<p>2\u3001Web\u7aef\u70b9\u5ba2\u670d\u94fe\u63a5\u6ca1\u53cd\u5e94\uff0c\u901a\u8fc7Spark\u67e5\u627e\u53ef\u4ee5\u5efa\u7acb\u4f1a\u8bdd\uff0c\u4f46\u662fSpark\u53ef\u4ee5\u5230Web\uff0c\u4f46\u662fWeb\u7a97\u53e3\u53d1\u5e03\u7684\u6d88\u606f\u4e0d\u80fd\u5230Spark\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<p>\u5148\u67e5\u4e00\u4e0bChat.php\u7684\u6e90\u6587\u4ef6\uff0c\u770b<\/p>\n<p><span class=\"html-tag\">&lt;input <span class=\"html-attribute-name\">type<\/span>=\"<span class=\"html-attribute-value\">hidden<\/span>\" <span class=\"html-attribute-name\">id<\/span>=\"<span class=\"html-attribute-value\">from<\/span>\" <span class=\"html-attribute-name\">value<\/span>=\"<span class=\"html-attribute-value\">1@127.0.0.1<\/span>\" \/&gt;<\/span><\/p>\n<p>\u770b\u662f\u5426\u662f\u4ee5\u4e0a\u683c\u5f0f\uff0c\u5f88\u6709\u53ef\u80fd\u662f<\/p>\n<p>&lt;input <span class=\"html-attribute-name\">type<\/span>=\"<span class=\"html-attribute-value\">hidden<\/span>\" <span class=\"html-attribute-name\">id<\/span>=\"<span class=\"html-attribute-value\">from<\/span>\" <span class=\"html-attribute-name\">value<\/span>=\"<span class=\"html-attribute-value\">1@<\/span>\" \/&gt;<\/p>\n<p>@\u540e\u9762\u662f\u7a7a\u7684\u3002\u90a3\u89e3\u51b3\u529e\u6cd5\u662f\uff1a<\/p>\n<p>\u6253\u5f00\/chat.php\u6587\u4ef6\uff0c\u4fee\u6539\u7ea6436\u884c$xmpp_domain = get_xmpp_domain();\u4e3a$xmpp_domain = \u201c127.0.0.1\u201d;<\/p>\n<p>\u8fd9\u4e2a\u5176\u5b9e\u5e76\u6ca1\u6709\u771f\u6b63\u89e3\u51b3\u95ee\u9898\uff0c\u6700\u597d\u662f\u80fd\u591f\u4fee\u590dget_xmpp_domain();\u51fd\u6570\u3002\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Spark\u4e8c\u5f00\u6559\u7a0b\uff1ahttp:\/\/www.thinksaas.cn\/topics\/0\/342\/342334.html<\/p>\n<p>Spark\u5f00\u6e90\u9879\u76ee\uff1ahttps:\/\/github.com\/igniterealtime\/Spark<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u4eac\u4e1c\u81ea\u5e26\u7684\u662f\u6709\u5373\u65f6\u901a\u4fe1\u670d\u52a1\u7684\uff0c\u4f46\u662f\u7f51\u4e0a\u6d41\u4f20\u7684\u5927\u591a\u90fd\u9609\u5272\u4e86\u8fd9\u4e2a\u529f\u80fd\uff0c\uff0c\u5176\u5b9e\uff0c\uff0c\u8fd9\u4e2a\u529f\u80fd\u8fd8\u662f\u5f88\u6709\u7528\u7684\uff0c\uff0c \u600e\u4e48\u914d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[85,100],"_links":{"self":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/359"}],"collection":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359"}],"version-history":[{"count":0,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/359\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}