configure ejabberd xmpp ubuntu server part 2

In First Tutorial we have configure ejabberd XMPP with default menisa database . now in this tutorial i will explain how to configure ejabberd with MySql .

 

configure ejabberd xmpp ubuntu server part 2

configure ejabberd xmpp ubuntu server part 2

 

Step 1 :  Open etc/ejabberd/ejabberd.cfg file and comment following line :

{auth_method, internal}.

and add the following line in file :

{auth_method, odbc}.
{odbc_server, {mysql, “server”, “database name”, “username”, “password”}}.

here

  1. server : your mysql server ip
  2. user name and password : database access username and password .

Step 2 :

Now you need to configure mysql on server . so for that you need to install SVN on Ubuntu server by following command :

after installation of SVN you need to download MySql module.

  1. first create a directory  using mkdir command
  2. download following package  http://svn.process-one.net/ejabberd-modules/mysql/trunk/ by using below command : svn co http://svn.process-one.net/ejabberd-modules/mysql/trunk/
  3. after download  run /.build.sh c file . it will generate following beam file  in ebin folder

    mysql.beam

    mysql_auth.beam

    mysql_conn.beam

    mysql_recv.beam

  4. Please copy below file into  ejabberd ebin directory  /usr/lib/ejabberd/ebin this folder .
  5.  now open etc/ejabberd/ejabberd.cfg  file and do following changes
  • Change mod_last to mod_last_odbc to store the last seen date in MySQL.

  •  Change mod_offline to mod_offline_odbc to store offline messages in MySQL.

  • Change mod_roster to mod_roster_odbc to store contact lists in MySQL.

  •  Change mod_private to mod_private_odbc to store user private XML storage in MySQL.

  •   Change mod_privacy to mod_privacy_odbc to store user privacy lists in MySQL.

  •  Change mod_pubsub to mod_pubsub_odbc to store PubSub nodes, items and subscriptions in MySQL.

  •   Change mod_vcard to mod_vcard_odbc to store user description in MySQL.

Step 3 :

  1. Now Login in mySql Database and create a database “ejabberd
  2. Now download ejabberd MySql table schema folloing command   wget https://raw.githubusercontent.com/processone/ejabberd/master/sql/mysql.sql
  3. Now import this file in recently created “ejabberd” database.
  4. For installing mod_archive (for saving chat in DB)

     
  5. now go to this directory ejabberd-modules/mod_archive/trunk/src/ here you will find  this “mod_archive_odbc_mysql.sql” my sql file , you need to import this file in recently created database “ejabberd
  6. In /etc/ejabberd/ejabberd.cfg add mod_archive_odbc module

 

Now you have configured Ejabberd with MySql

if you need any assistance please comment ..

Configure ejabberd xmpp ubuntu server

 

configure ejabberd xmpp ubuntu server

configure ejabberd xmpp ubuntu server

 

After facing so many issues and investing so many hours I write below steps for configure ejabberd. In first tourial we learn how to configure ejabbere on AWS EC 2 Ubuntu server. In second tutorial we will configure it with mysql.

Step 1: First Update Ubuntu Server  with following commands

 Step 2: sudo apt-get install ejabberd– this command will install ejabberd  on ubuntu machine.

Step 3: After complete installation of ejabberd , you need to register a user , you can register user below command

ejabberdctl register admin XXX.com password

Here admin — user name of user

XXX.com  – your domain name

password : user password

if above command show error then you need to register user with localhost domain .

Step 4 : After successfully registration of  user , you can edit domain in ejabberd.cfg (ejabberd Configuration file) , path of this file is /etc/ejabberd/ejabberd.cfg . now you can open this file using vi  editor sudo vi ejabberd.cfg. 

now you can search below section and edit with you domain name

Now restart ejabberd server with following command sudo service ejabberd restart

if this command didn’t work then you can start ejabberd server by alternative command sudo /etc/init.d/ejabberd start

Step 5 : Now you can check server is running by hitting below URL : http://xxx.com:5280/admin  (here xxx.com is your domain name )

if above url is not loaded  i.e. ejabberd server is not started  , then please check status of ejabberd sudo service ejabberd status

if it shows  server is  already stopped then you can run sudo service ejabbered startn 

or or sudo /etc/init.d/ejabberd start

if this didn’t work then you can run following command sequentially for stop ejabberd server on any node

 

Step 6 : now repeat step 5 again and enter user name and password that you have registered by running this command  ejabberdctl register admin localhost password

user name : admin@xxx.com

password : password

 

Step 7 :  Now you can test ejjaberd XMPP on server using any XMPP client like pidgin .

 

 

export database table by php

Posted: 30th December 2015 by admin in mysql, php
Tags: , , ,

export database table php

Sometime there is need to export database table by php code. There is a very simple approach to do this.

 

export database table by php

export database table by php

 

 

Joomla Last Database Query

 

 

Joomla last database query.As we all know it is a bit difficult to find last executed query in CMS. because there are lots of internal trigger and threads are running. But there is a simple way to find last database query in joomla.

 

Joomla Last Database Query

 

The Query

Joomla’s database querying changed with the introduction of Joomla 1.6. The recommended way of building database queries is through “query chaining” (although string queries are still supported).

Query chaining refers to a method of connecting a number of methods, one after the other, with each method returning an object that can support the next method, improving readability and simplifying code.

To obtain a new instance of the JDatabaseQuery class we use the JDatabaseDriver getQuery method:

 

 

Php backtrace with proper information.

 

Php backtrace with proper information

Php backtrace with proper information

Php backtrace with proper information. we can use debug_backtrace. But debug_backtrace provide a lots of data which might be not use full for one. So for fetching more accurate information we can use the below code.

 

select table_name,column_name from information_schema.columns
where column_name like ‘%search%’

Simple Responsive Slider using jquery

Simple Responsive Slider using jquery

Simple Responsive Slider using jquery

Here is a Simple Responsive Slider using jquery which works on every breakpoints. A very simple js/jquery which helps you to modify it according to your requirements.

Download infinite_Image_Carousel-master

Custom linkedin button for share and auth

Custom linkedin button for share and auth

Custom linkedin button for share and auth

2012 in review

Posted: 4th March 2014 by urfusion in Uncategorized

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog .

2012 annual report

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 2,300 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 4 years to get that many views.

Click here to see the complete report.

2013 in review

Posted: 4th March 2014 by urfusion in Uncategorized

The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

2013 annual report

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 3,400 times in 2013. If it were a cable car, it would take about 57 trips to carry that many people.

Click here to see the complete report.