Senin, 16 September 2013

Xathrya Sabertooth

Xathrya Sabertooth


Creating Chat Server using OpenFire on Ubuntu

Posted: 15 Sep 2013 06:50 AM PDT

OpenFire is a real time collaboration (RTC) server licensed under Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber). In other word, OpenFire is free open source application used for building a chat server.

In this article we will use OpenFire to build a chat server on ubuntu. In this article I use:

  1. Ubuntu 12.04
  2. Oracle Java Development Kit (JDK)
  3. MySQL
  4. OpenFire

Please note that all the command invoked on terminal are using root privilege!

Preparation

It is always a good choice to update and upgrade your system. To do so, do following:

apt-get update  apt-get upgrade

Update / Install Latest JDK

We will use Oracle JDK instead of OpenJDK. First we need to uninstall OpenJDK (purge it!)

apt-get remove --purge openjdk*

Once the purge complete, install Oracle JDK

apt-get install oracle-java7-installer

Database

The database used here is MySQL server. If you haven’t install it, you can invoke following command to install it.

apt-get install mysql-server

Now, login to mysql

mysql -u root -p

Next, create a database by these series of SQL command:

CREATE DATABASE dbopenfire CHARACTER SET='utf8';  CREATE USER 'openfire'@'localhost' IDENTIFIED BY '0wnByX4thrya';  GRANT ALL PRIVILEGES ON dbopenfire.* TO openfire@localhost WITH GRANT OPTION;  FLUSH PRIVILEGES;

and then quit. Note that you can change the password identification for user openfire.

Installing OpenFire

Download the latest OpenFire package for Debian-based Linux. The latest version of OpenFire (per September 15th, 2013) is 3.8.2 which can be downloaded here.

Or, you can install it directly.

cd /tmp  wget http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire_3.8.2_all.deb  dpkg -i openfire_3.8.2_all.deb

Now, replace java-6-sun with java-7-oracle (we have install java-7-oracle, right?)

apt-get install rpl  rpl '6-sun' '7-oracle' /etc/init.d/openfire  service openfire start

Set Firewall

Now, set the firewall to allow packet traffic for ports used by openfire.

ufw allow 9090/tcp  ufw allow 9091/tcp  ufw allow 5222/tcp  ufw allow 7777/tcp  ufw allow 7443/tcp  ufw allow 7070/tcp  ufw allow 3478/tcp  ufw allow 3479/tcp

Configuration

Now we will configure the OpenFire by web.

Open your browser and go to http://Your-IP:9090 where Your IP is your server IP.

Click continue until you reach setting for database connection (we omit other default setting). Choose Standard Database Connection. Now you will get a form. Fill the form with setting we use on previous sections. For example:

  • Database Driver Presets = MySQL
  • JDBC Driver Class = com.mysql.jdbc.Driver
  • Database Url = jdbc:mysql://localhost:3306/dbopenfire
  • Username = openfire
  • Password = <the password you set>
  • Minimum connections = 5
  • Maximum connections = 25
  • Connection Timeout = 1.0 Days

On profile setting, choose default and click on continue.

Now set the administrator account. You pick the password by yourself, and should be different from database password.

The configuration is finished.

Add New Account

To add new account, click on User Groups -> Users -> Create New User. Fill the required information.

Client?

Basically, any XMPP/JABBER capable client can connect to this chat server. For an alternative, you can use Spark which is developed by the very same developer who develop OpenFire. You can download it here. Download in respect of your client operating system.

Introduction to Preboot Execution Environment (PXE)

Posted: 15 Sep 2013 06:45 AM PDT

Preboot eXecution Environment or PXE (also known as Pre-Execution Environment) sometimes pronounced as pixie, is an environment to boot computer using network interface independently of data storage device (like hard disks) or installed operating systems. This kind of method is used as base of Diskless Node.

PXE makes use of several network protocols: Internet Protocol, User Datagram Protocol, Dynamic Host Configuration Protocol (DHCP), and Trivial File Transfer Protocol (TFTP) and also use concept of Globally Unique Identifier (GUID), Universally Unique Identifier (UUID), and Universal Network Device Interface. PXE will extends the firmware of the PXE client (the computer to be bootstrapped via PXE) with a set of predefined Application Programming Interface (API).

Mechanism

In normal boot process, after powering the machine a client will go to a BIOS and execute bootstrap program on HDD or CD\DVD. When using a PXE, the boot process is changed. After the computer is powered on, it will go to BIOS and then use the Network Card’s PXE stack. After that, the client will execute following procedure.

  1. The client firmware locate a PXE redirection service on the network (Proxy DHCP) in order to receive information about available PXE boot servers.
  2. Client parsing the information retrieved
  3. Client ask an appropriate boot server for the file path of a Network Bootstrap Program (NBP)
  4. Client download the required image and load to RAM (using TFTP access)
  5. Client execute the image

In short, The NBP is responsible for the 2nd stage boot.

What You Need?

As you might think, the PXE utilize network communication. In detail, it can be considered as one of client-server architecture system. You need a server which provides everything you need, and a client which send a request to server.

On Server Side

A server machine has to be configured to receive a request for PXE boot.

  1. DHCP
  2. TFTP
  3. appropriate NBP

On Client Side

A client machine should supports PXE booting. You should be able to enable it.

Tidak ada komentar:

Posting Komentar