Posts

Showing posts from May, 2020

Enable Clustering in Openfire

Image
Clustering Clustering is a technique used to "scale up" a single XMPP domain. The server members within a cluster share an identical configuration. Each member allows any user within the domain to connect, authenticate, and exchange stanzas. Clustered server shares a single database, and also required to be resident within the same LAN-based (low latency) network infrastructure. This type of deployment is suitable to provide runtime redundancy and will support a larger number of users and connections (within a single domain) than a single server. How to Cluster Openfire To create an Openfire cluster, you should have at least two Openfire servers, and each server must have the Hazelcast plugin installed. Install hazelcast plugin The Hazelcast plugin version corresponding to the Openfire release (3.9.3) is 1.2.0 Edit the config file of hazelcast in plugins/hazelcast/classes directory $nano openfire/plugins/hazelcast/classes/hazelcast-cache-config.xml By de

Enable JMX Port in Tomcat with authentication

What is JMX ? Java provides a technology called JMX that supplies tools for monitoring and managing applications, system objects, devices and service-oriented networks. Those resources are represented by objects called Managed Bean (MBeans) Enable JMX port in Tomcat To monitor Heap Memory, Threads, CPU Usage, Classes, and configure various MBeans at remote we need to enable a JMX port in tomcat. Step 1: Go to path where you have Tomcat installed $ cd /usr/share/tomcat7/bin Step 2: Make setenv.sh file and give it the read, execute and access permission $ chmod 755 setevn.sh Step 3: Edit the setenv .sh file and paste the following lines export JAVA_OPTS="-Dcom.sun.management.jmxremote=true \ -Dcom.sun.management.jmxremote.port=9999\ -Dcom.sun.management.jmxremote.authenticate=false\ -Dcom.sun.management.jmxremote.ssl=false \ -Djava.rmi.server.hostname=192.168.x.x"   1. enables jmxremote   2 . specifies the port  3. says that we don’t need to use ssl  4. says to leave

Tomcat SSL/TLS Configuration | Run tomcat over HTTPS

Image
HTTPS HTTPS (also called HTTP over TLS, HTTP over SSL and HTTP Secure) is a protocol for secure communication over a computer network which is widely used on the Internet. HTTPS consists of communication over Hypertext Transfer Protocol (HTTP) within a connection encrypted by Transport Layer Security or its predecessor, Secure Sockets Layer. The main motivation for HTTPS is authentication of the visited website and protection of the privacy and integrity of the exchanged data. SSL SSL (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browsers remain private and integral. SSL is a security protocol. Protocols describe how algorithms should be used. TLS Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL), both of which are frequently referred to as 'SSL', are cryptographic protocols designed to provide communi

PubNub Access Manager

Pubnub Access Manager PubNub Access Manager (PAM) extends PubNub's existing security framework by allowing developers to create and enforce secure access to channels throughout the PubNub Real Time Network. Access Manager allows you to manage granular permissions for your realtime apps and data streams, create multiple permission levels, grant and revoke access, and audit user access. To use Access Manager, you need to enable Access Manager in the Admin Dashboard. Once you enable Access Manager, you must grant permissions before any data can be sent or received. PAM Server side Configuration In order to client side working correctly, at server side must first issue the appropriate permissions for a given PAM channel or channel-group and auth token combination. for granting these permission you must initialize pubnub instance at least with your subscribe and secret keys. Example : Step 1. Make Pubnub Configuration : - PNConfiguration pnConfiguration = new PNConfigurat

PubNub Webhook Overview

Webhook Overview A WebHook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST. A web application implementing WebHooks will POST a message to a URL when certain things happen. PubNub Presence Pubnub presence all about the user presence at pubnub platform. it provides the presence of user when they are joining, leaving a channel or when there is a user's state changes. Presence Webhooks provide a means for your server to be notified whenever presence events occur on any channel for your keys. This provides an easy to scale solution for your server side application to monitor the presence events. How it would reduce the overhead Without Presence Webhooks, your server would have to subscribe to all the channels'  -pnpres channels. So this can be a tedious task to control overs channels if your app has thousands of channels or more. Pubnub Webhooks would help us in this scenario and it is easier to implement and sc

Character Set in Java

Image
A character set refers to the composite number of different characters that are being used and supported by a computer software and hardware. Almost all computer systems and languages use the ASCII character encoding. The ASCII code represents each character using 8 bits (that is, one byte) and there are 256 different characters available. Several of these are "control characters." Java, however, uses 16 bits (that is, 2 bytes) for each character and uses an encoding called Unicode. The first 256 characters in the Unicode character set correspond to the traditional ASCII character set, but the Unicode character set also includes many unusual characters and symbols from several different languages. Typically, a new Java program is written and placed in a standard ASCII file. Each byte is converted into the corresponding Unicode character by the Java compiler as it is read in. When an executing Java program reads (or writes) character data, the characters are tr