{"id":13,"date":"2014-02-06T19:38:25","date_gmt":"2014-02-06T18:38:25","guid":{"rendered":"http:\/\/luca.lovalvo.net\/1_luca_lo_valvo\/archive\/12546_installer_punjab-serveur_bosh_xmpp.html"},"modified":"2022-11-04T15:34:08","modified_gmt":"2022-11-04T14:34:08","slug":"installer-punjab-serveur-bosh-xmpp","status":"publish","type":"post","link":"https:\/\/luca.lovalvo.ch\/blog\/installer-punjab-serveur-bosh-xmpp\/","title":{"rendered":"Installer Punjab &#8211; serveur BOSH XMPP"},"content":{"rendered":"<p>Afin d&#39;utiliser un client web XMPP web en Ajax\/php, il est n&eacute;c&eacute;ssaire de disposer d&#39;un serveur BOSH en plus de son serveur XMPP.<\/p>\n<p>Voici comment installer le serveur BOSH&nbsp;<a href=\"https:\/\/github.com\/twonds\/punjab\" target=\"_blank\" rel=\"noopener\">Punjab<\/a>&nbsp;sous Ubuntu.<\/p>\n<p><strong>1) Installer : Python ,&nbsp;python-twisted :<\/strong><br \/><font color=\"#3366ff\">sudo APT-GET install&nbsp;python python-twisted<\/font><\/p>\n<p><strong>2) T&eacute;l&eacute;charger la derni&egrave;re version de punjab sois via Git ou via l&#39;archive ZIP :<\/strong><\/p>\n<p><font color=\"#3366ff\">wget [URL_DE_L_ARCHIVE]&nbsp;<\/font><\/p>\n<p>d&eacute;compresser l&#39;archive :<br \/><font color=\"#3366ff\">unzip l_ARCHIVE.zip<\/font><\/p>\n<p><strong>3) Une fois dans l&#39;archive on lance le script de configuration:<\/strong><\/p>\n<p><font color=\"#3366ff\">python .\/setup.py instal<\/font>l<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4) On lance punjab :<\/strong><\/p>\n<p><font color=\"#3366ff\">twistd -ny punjab.tac<\/font><\/p>\n<p>&nbsp;<\/p>\n<p>Par d&eacute;faut le serveur est lanc&eacute; sur le port &nbsp;<font color=\"#008000\">5280<\/font><br \/><font color=\"#008000\">http:\/\/ip_de_votre_serveur:5280\/<\/font><\/p>\n<p>Le serveur bosh lui est sur l&#39;URL : <font color=\"#008000\">http:\/\/ip_de_votre_serveur:5280\/http-bind<\/font><\/p>\n<p>Afin d&#39;&eacute;viter les probl&egrave;mes de cross-domaine, nous allons cr&eacute;er un alias apache avec un reverse proxy.<\/p>\n<p><strong>Dans votre fichier apache2.conf :<\/strong><\/p>\n<p><font color=\"#3366ff\">&lt;Location \/http-bind&gt;<\/font><\/p>\n<p><font color=\"#3366ff\">ProxyPass http:\/\/localhost:5280\/http-bind<\/font><\/p>\n<p><font color=\"#3366ff\">ProxyPassReverse http:\/\/localhost:5280\/http-bind<\/font><\/p>\n<p><font color=\"#3366ff\">SetEnv force-proxy-request-1.0 1<\/font><\/p>\n<p><font color=\"#3366ff\">SetEnv proxy-nokeepalive 1<\/font><\/p>\n<p><font color=\"#3366ff\">&lt;\/Location&gt;&nbsp;<\/font><\/p>\n<p>Votre serveur bosh est maintenant disponible via l&#39;adresse :<br \/><font color=\"#008000\">http:\/\/vos_domaines.tld\/http-bind<\/font><\/p>\n<p><em>Il est possible de faire ceci sur un vhost pour un seul domaine.<br \/>Dans mon cas j&#39;ai besoin d&#39;acc&eacute;der au m&ecirc;me serveur BOSH depuis plusieurs domaine.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Afin d&#39;utiliser un client web XMPP web en Ajax\/php, il est n&eacute;c&eacute;ssaire de disposer d&#39;un serveur BOSH en plus de son serveur XMPP. Voici comment installer le serveur BOSH&nbsp;Punjab&nbsp;sous Ubuntu. 1) Installer : Python ,&nbsp;python-twisted :sudo APT-GET install&nbsp;python python-twisted 2) T&eacute;l&eacute;charger la derni&egrave;re version de punjab sois via Git ou via l&#39;archive ZIP : wget [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-serveur"],"_links":{"self":[{"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":1,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":202,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions\/202"}],"wp:attachment":[{"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/luca.lovalvo.ch\/blog\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}