{"id":443,"date":"2011-04-21T14:57:33","date_gmt":"2011-04-21T12:57:33","guid":{"rendered":""},"modified":"2018-11-01T01:09:10","modified_gmt":"2018-11-01T00:09:10","slug":"installing-jabberd2-server-ubuntu-1010-maverick","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/installing-jabberd2-server-ubuntu-1010-maverick\/","title":{"rendered":"Installing Jabberd2 server on Ubuntu 10.10 Maverick"},"content":{"rendered":"<p>Jabberd2 server is an application server based on XMPP protocol.&nbsp;This Guide describes the <em><u><strong>basic <\/strong><\/u><\/em>installation and configuration on Ubuntu 10.10&nbsp;Maverick OS.<\/p>\n<p>&nbsp;<\/p>\n<p>You need to be in privileged user mode in order for this guide to work.<\/p>\n<pre>\r\n$sudo -s\r\npassword:\r\n#\r\n<\/pre>\n<p>&nbsp;1.) We neet to allow the universe Ubuntu repository. Make sure the following lines are included in &quot;\/etc\/apt\/sources.list&quot; file (adapt the server address to your Ubuntu repository):<\/p>\n<pre>\r\ndeb http:\/\/sk.archive.ubuntu.com\/ubuntu maverick universe\r\n\r\ndeb-src http:\/\/sk.archive.ubuntu.com\/ubuntu maverick universe<\/pre>\n<p>After addition run<\/p>\n<pre>\r\n#apt-get update\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>2.) Install MySQL database system which is an option for DB system required by Jabberd2&nbsp;server.<\/p>\n<pre>\r\n#apt-get install mysql-server\r\n<\/pre>\n<p>During the installation you will be prompted for root database user.<\/p>\n<p>&nbsp;<\/p>\n<p>3.) Install Jabberd2 server<\/p>\n<pre>\r\n#apt-get install jabberd2\r\n<\/pre>\n<p>&nbsp;The service is running right after the installation, but since it is not yet configured properly, we stop it using:<\/p>\n<pre>\r\n#service jabberd2 stop\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>4.) Create a database and a database user for Jabberd2 server. A script for database creation is shipped with the Jabberd2 installation and can be found at &quot;\/usr\/share\/doc\/jabberd2\/db-setup.mysql.gz&quot;. All you need to do is unzip it and run it in MySQL&nbsp;environment. The command for user creation is not included in the script, so we will need to type it ourselves. Log in to MySQL using root DB user password:<\/p>\n<pre>\r\n#gzip -d \/usr\/share\/doc\/jabberd2\/db-setup.mysql.gz\r\n#mysql -p\r\nmysql&gt; source \/usr\/share\/doc\/jabberd2\/db-setup.mysql\r\nmysql&gt; GRANT select,insert,delete,update ON jabberd2.* to jabberd2@localhost IDENTIFIED by 'secret';\r\nmysql&gt; quit<\/pre>\n<p>With the command GRANT we created user &#8218;jabberd2&#8216; authenticated by password &#8218;secret&#8216; (these are the default credentials for jabberd2&nbsp;to authenticate itself in MySQL; it is strongly recomended to change them). The user was granted access to database named jabberd2 (created by the script).<\/p>\n<p>&nbsp;<\/p>\n<p>5.) Final step si configuring ID parameter and data storage for Jabberd2. Configuration files are located in &quot;\/etc\/jabberd2\/&quot; directory. The ones we will be editing are sm.xml and c2s.xml (Jabberd2 server is configured using few .xml configuration files).<\/p>\n<p>In file &quot;sm.xml&quot; we need to edit the ID parameter (aprox. line 6)<\/p>\n<pre>\r\n&lt;id&gt;p2b.sip.uniza.sk&lt;\/id&gt;\r\n<\/pre>\n<p>This ID parameter is the domain in which Jabberd2 is deployed for XMPP&nbsp;services. It is also the &quot;domain&quot; part of the user&#8217;s JID&nbsp;(Jabber&nbsp;ID).<\/p>\n<p>For examle, user in our domain would have JID:<\/p>\n<p class=\"rteindent1\">clovek@p2b.sip.uniza.sk<\/p>\n<p>The ID&nbsp;parameter can be set as domain name <em><strong>ONLY <\/strong><\/em>if you have &quot;_xmpp-server._tcp.domain&quot; SRV record in your DNS<\/p>\n<p>(our case: &quot;_xmpp-server._tcp.p2b.sip.uniza.sk&quot;).<\/p>\n<p>Otherwise it needs to be set as a full FQDN of the machine the Jabberd2 is deployed on (in our case if we didn&#8217;t have _xmpp-server SRV record in DNS, we would set the ID&nbsp;parameter &quot;server.p2b.sip.uniza.sk&quot;, which is a FQDN&nbsp;of the machine). This also requires at least type A record in DNS&nbsp;(if you do not have that either, it could be just a simple IP address of the machine).<\/p>\n<p>This also aplies to ID parameter in c2s.xml (aprox. line 125).<\/p>\n<pre>\r\n&lt;id register-enable='true'&gt;p2b.sip.uniza.sk&lt;\/id&gt;<\/pre>\n<p>Note: The &quot;register-enable&quot; property configures Jabberd2 to allow users to automatically create their non-existing accounts on first login. If you do not want to enable this, set the property to &quot;false&quot; value.<\/p>\n<p>&nbsp;<\/p>\n<p>Configuring data storage and user authentication:<\/p>\n<p>After the installation, Jabberd2&nbsp;is configured for using MySQL by default. All we need to do is change MySQL credentials in sm.xml ale c2s.xml.<\/p>\n<p>Data storage configuration in sm.xml:<\/p>\n<pre>\r\n&lt;storage&gt;\r\n  ...\r\n  &lt;driver&gt;mysql&lt;\/driver&gt;\r\n  ...\r\n  &lt;mysql&gt;\r\n    &lt;dbname&gt;jabberd2&lt;\/dbname&gt;\r\n    &lt;user&gt;jabberd2&lt;\/user&gt;\r\n    &lt;pass&gt;secret&lt;\/pass&gt;\r\n    ...\r\n  &lt;\/mysql&gt;\r\n  ...\r\n&lt;\/storage&gt;\r\n<\/pre>\n<p class=\"MsoNormal\">Authentication of users in c2s.xml:<\/p>\n<pre>\r\n&lt;authreg&gt;\r\n  ...\r\n  &lt;module&gt;mysql&lt;\/module&gt;\r\n  ...\r\n  &lt;mysql&gt;\r\n    ...\r\n    &lt;dbname&gt;jabberd2&lt;\/dbname&gt;\r\n    &lt;user&gt;jabberd2&lt;\/user&gt;\r\n    &lt;pass&gt;secret&lt;\/pass&gt;\r\n    ...\r\n  &lt;\/mysql&gt;\r\n&lt;\/authreg&gt;\r\n<\/pre>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p>Jabberd2 is now configured for basic behaviour and we can start the service by:<\/p>\n<pre>\r\n#service jabberd2 start\r\n<\/pre>\n<p>Try testing your server with your favourite client&nbsp;(e.g. Miranda).<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Jabberd2 server is an application server based on XMPP protocol.&nbsp;This Guide describes the <em><u><strong>basic <\/strong><\/u><\/em>installation and configuration on Ubuntu 10.10&nbsp;Maverick OS.<\/p>\n<p>&nbsp;<\/p>\n<p>You need to be in privileged user mode in order for this guide to work.<\/p>\n<pre>\r\n$sudo -s\r\npassword:\r\n#\r\n<\/pre>\n<p>&nbsp;1.) We neet to allow the universe Ubuntu repository. Make sure the following lines are included in &quot;\/etc\/apt\/sources.list&quot; file (adapt the server address to your Ubuntu repository):<\/p>","protected":false},"author":449,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[685,663],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-linux_-_howto-en","category-instant_messaging-xmpp-en"],"taxonomy_info":{"category":[{"value":685,"label":"Linux - HOWTO"},{"value":663,"label":"XMPP"}]},"featured_image_src_large":false,"author_info":{"display_name":"","author_link":"https:\/\/nil.uniza.sk\/en\/author\/"},"comment_info":3,"category_info":[{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0},{"term_id":663,"name":"XMPP","slug":"instant_messaging-xmpp-en","term_group":0,"term_taxonomy_id":661,"taxonomy":"category","description":"","parent":659,"count":2,"filter":"raw","cat_ID":663,"category_count":2,"category_description":"","cat_name":"XMPP","category_nicename":"instant_messaging-xmpp-en","category_parent":659}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/449"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}