<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abhi&#039;s Weblog &#187; ejabberd</title>
	<atom:link href="http://abhinavsingh.com/blog/tag/ejabberd/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhinavsingh.com/blog</link>
	<description>PHP, Memcached, XMPP and Web Development</description>
	<lastBuildDate>Wed, 06 Apr 2011 22:19:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting up ejabberd 2.1.x development environment on Ubuntu</title>
		<link>http://abhinavsingh.com/blog/2010/03/setting-up-ejabberd-2-1-x-development-environment-on-ubuntu/</link>
		<comments>http://abhinavsingh.com/blog/2010/03/setting-up-ejabberd-2-1-x-development-environment-on-ubuntu/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 21:04:13 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[ejabberd]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=587</guid>
		<description><![CDATA[apt-get provide a convenient way of installing ejabberd on Ubuntu distributions. However, if you are an erlang developer and looking to write custom ejabberd modules, you might want to install ejabberd from the source code. Checkout ejabberd source To start with lets grab the ejabberd 2.1.x branch source code: sudo apt-get install git-core git clone [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F03%2Fsetting-up-ejabberd-2-1-x-development-environment-on-ubuntu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F03%2Fsetting-up-ejabberd-2-1-x-development-environment-on-ubuntu%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=ejabberd,Ubuntu,XMPP&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><code>apt-get</code> provide a convenient way of installing <code>ejabberd</code> on <code>Ubuntu</code> distributions. However, if you are an <code>erlang</code> developer and looking to write custom ejabberd modules, you might want to install ejabberd from the source code.</p>
<p><strong style="font-size:18px;"><u>Checkout ejabberd source</u></strong><br />
To start with lets grab the ejabberd 2.1.x branch source code:</p>
<ul>
<li>sudo apt-get install git-core</li>
<li>git clone git://git.process-one.net/ejabberd/mainline.git ejabberd</li>
<li>cd ejabberd</li>
<li>git checkout -b 2.1.x origin/2.1.x</li>
<li>cd src</li>
</ul>
<p><strong style="font-size:18px;"><u>Installing pre-requisites</u></strong><br />
Lets setup necessary pre-requisites before compiling ejabberd source code:</p>
<ul>
<li>sudo apt-get install build-essential</li>
<li>sudo apt-get install automake autoconf</li>
<li>sudo apt-get install erlang erlang-manpages</li>
<li>sudo apt-get install libexpat1-dev zlib1g-dev libssl-dev</li>
</ul>
<p><strong style="font-size:18px;"><u>Compiling ejabberd source code</u></strong><br />
Compiling and installing is dead simple:</p>
<ul>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ul>
<p><strong style="font-size:18px;"><u>Setting up administration account</u></strong><br />
By now we have ejabberd server setup on our ubuntu box. Lets setup the admin account:</p>
<ul>
<li>sudo ejabberdctl start</li>
<li>sudo ejabberdctl register admin localhost password</li>
<li>sudo vim /etc/ejabberd/ejabberd.cfg</li>
<li>Add following configurations if not already present:
<pre name="code" class="php">{acl, admin, {user, "admin", "localhost"}}.
{loglevel, 5}. %% Log level while development</pre>
</li>
<li>sudo ejabberdctl restart</li>
<li>Visit ejabberd admin panel: http://localhost:5280/admin</li>
<li>When prompted enter username as <code>admin@localhost</code> and the password you chose above while registering admin account</li>
</ul>
<p><strong style="font-size:18px;"><u>Resolving startup errors</u></strong><br />
You might see a few error reports in logs or elsewhere while starting ejabberd server:</p>
<ul>
<li>
<pre class="php" name="code">/sbin/ejabberdctl: 340: cannot create //var/lock/ejabberdctl/ejabberdctl-1: Directory nonexistent</pre>
</li>
<li>
<pre class="php" name="code">=ERROR REPORT==== 2010-03-29 21:53:03 ===
C(<0.995.0>:ejabberd_captcha:331) : The option captcha_cmd is not configured, but some module wants to use the CAPTCHA feature.</pre>
</li>
<li>
<pre class="php" name="code">=INFO REPORT==== 2010-03-29 21:53:03 ===
I(<0.780.0>:ejabberd_rdbms:37) : ejabberd has not been compiled with relational database support. Skipping database startup.</pre>
</li>
</ul>
<p>Here is how you can resolve the above errors:</p>
<ul>
<li>sudo mkdir /var/lock/ejabberdctl/ejabberdctl-1</li>
<li>Add following line in <code>ejabberd.cfg</code>
<pre class="php" name="code">{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.</pre>
<p> Replace <code>/lib/ejabberd/priv/bin/captcha.sh</code> with path to <code>/ejabberd/tools/captcha.sh</code></li>
</ul>
<p><strong style="font-size:18px;"><u>Getting started with ejabberd development</u></strong><br />
Below are links to a few useful resources to get you started with erlang and ejabberd module development:</p>
<ul>
<li>Erlang programming rules and conventions: <a href="http://www.erlang.se/doc/programming_rules.shtml">http://www.erlang.se/doc/programming_rules.shtml</a></li>
<li>Erlang documentation: <a href="http://www.erlang.org/doc">http://www.erlang.org/doc</a></li>
<li>Ejabberd module development wiki: <a href="http://www.process-one.net/en/wiki/ejabberd_module_development">http://www.process-one.net/en/wiki/ejabberd_module_development</a></li>
<li>Ejabberd documentation: <a href="https://support.process-one.net/doc/display/MESSENGER/ejabberd">https://support.process-one.net/doc/display/MESSENGER/ejabberd</a></li>
</ul>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F03%2Fsetting-up-ejabberd-2-1-x-development-environment-on-ubuntu%2F","http:\/\/www.erlang.se\/doc\/programming_rules.shtml","http:\/\/www.erlang.org\/doc","http:\/\/www.process-one.net\/en\/wiki\/ejabberd_module_development","https:\/\/support.process-one.net\/doc\/display\/MESSENGER\/ejabberd"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDEwLzAzL3NldHRpbmctdXAtZWphYmJlcmQtMi0xLXgtZGV2ZWxvcG1lbnQtZW52aXJvbm1lbnQtb24tdWJ1bnR1Lzx3cHRiPlNldHRpbmcgdXAgZWphYmJlcmQgMi4xLnggZGV2ZWxvcG1lbnQgZW52aXJvbm1lbnQgb24gVWJ1bnR1PHdwdGI%2BaHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZzx3cHRiPkFiaGkmIzAzOTtzIFdlYmxvZw%3D%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2011/04/jaxl-library-list-of-available-hooks-for-various-xmpp-events/" title="JAXL library &#8211; List of available hooks for various XMPP events">JAXL library &#8211; List of available hooks for various XMPP events</a> (3)</li><li><a href="http://abhinavsingh.com/blog/2010/08/php-code-setup-and-demo-of-jaxl-boshchat-application/" title="PHP Code, Setup and Demo of Jaxl boshchat application">PHP Code, Setup and Demo of Jaxl boshchat application</a> (80)</li><li><a href="http://abhinavsingh.com/blog/2010/08/releasing-jaxl-2-0-object-oriented-xmpp-framework-in-php/" title="Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP">Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP</a> (6)</li><li><a href="http://abhinavsingh.com/blog/2010/07/introducing-wp-chat-xmpp-chat-plugin-for-wordpress/" title="Introducing WP-Chat :: XMPP Chat plugin for Wordpress">Introducing WP-Chat :: XMPP Chat plugin for Wordpress</a> (46)</li><li><a href="http://abhinavsingh.com/blog/2010/04/setting-nginx-php-fastcgi-and-xcache-on-a-new-ubuntu/" title="Setting Nginx, PHP Fastcgi and XCache on a new Ubuntu">Setting Nginx, PHP Fastcgi and XCache on a new Ubuntu</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2010/03/setting-up-ejabberd-2-1-x-development-environment-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

