Hi Guys,
So today, I'm going to guide you through APACHE Server installation on Linux systems. Here, I'm using Fedora 27 as my Linux environment, Even though I have used Fedora 27 here, you may free to use your favourite Linux environment as well. (e.g: RedHat, Ubuntu, CentOS and Etc..)
What is APACHE Server?
Ha ha, Simple answer is here --> Please read this to get a better understanding on What is Apache server. https://httpd.apache.org/
The Apache HTTP Server, conversationally called Apache, is free and open-source cross-stage web server programming, discharged under the terms of Apache License 2.0. Apache is created and kept up by an open network of designers under the sponsorship of the Apache Software Foundation
So Let's start
Step 1
Code to use: dnf install httpd
Run this command in the terminal (with root privilege) to install HTTP daemon in Fedora.
Figure 1: installing httpd
Note: Normally Apache is pre-installed in Fedora by default, In case it is not there, the system
will ask for the confirmation. In that case user may confirm by pressing ‘Y’ and install the HTTP
package. (User may insert dnf install httpd –y directly as confirmation)
Figure 2 : Installing httpd with confirmation
Information Technology.
Blog was created for getting more knowledge about the Information Technology which is growing up very fast. So enjoy with getting Knowledge.
Saturday, August 3, 2019
Thursday, February 23, 2017
Working with Java JMS
Follwing code will show how to Connect with Java JMS
This is using TIBCO EMS
Before this Install TIBCO EMS
ADD Dependencys(tibjms.jar, jms2.0.jar)
1) Sample (1) to SEND a message to TIBCO EMS
import java.util.Vector;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import com.tibco.tibjms.TibjmsQueueConnectionFactory;
public class TibcoEMSQueueSender {
public static void main(String args[]) {
String serverUrl = "tcp://localhost:7222";
String userName = "admin";
String password = "admin";
String queueName = "myQueue";
try {
Vector
data.add("Hello World!"+System.currentTimeMillis());
System.out.println("Sending JMS message to server " + serverUrl + "...");
QueueConnectionFactory factory = new TibjmsQueueConnectionFactory(serverUrl);
QueueConnection connection = factory.createQueueConnection(userName, password);
QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
// Use createQueue() to enable sending into dynamic queues.
Queue senderQueue = session.createQueue(queueName);
QueueSender sender = session.createSender(senderQueue);
/* publish messages */
for (int i = 0; i < data.size(); i++) {
TextMessage jmsMessage = session.createTextMessage();
String text = (String) data.elementAt(i);
jmsMessage.setText(text);
sender.send(jmsMessage);
System.out.println("Sent message: " + text);
}
connection.close();
} catch (JMSException e) {
e.printStackTrace();
System.exit(0);
}
}
}
2) Sample (2) to SEND a message to TIBCO EMS
import com.tibco.tibjms.TibjmsConnectionFactory;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
public class SenderSwingTIBCO {
public static void main(String[] args) {
try {
TibjmsConnectionFactory tibjmsConnectionFactory = new TibjmsConnectionFactory("tcp://localhost:7222");
Connection connection = tibjmsConnectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Destination destination = session.createQueue("myQueue");
MessageProducer messageProducer = session.createProducer(destination);
messageProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
StringBuffer strContent = new StringBuffer();
strContent.append("eluwa");
TextMessage textMessage = session.createTextMessage(strContent.toString());
messageProducer.send(textMessage);
session.close();
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
3) Sample (1) to RECEIVE a message to TIBCO EMS
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import com.tibco.tibjms.TibjmsQueueConnectionFactory;
public class TibcoEMSQueueReceiver {
public static void main(String args[]) {
String serverUrl = "tcp://localhost:7222";
String userName = "admin";
String password = "admin";
String queueName = "myQueue";
try {
System.out.println("Start listening for incoming JMS message on " + serverUrl + "...");
QueueConnectionFactory factory = new TibjmsQueueConnectionFactory(serverUrl);
QueueConnection connection = factory.createQueueConnection(userName, password);
QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
// Use createQueue() to enable receiving from dynamic queues.
Queue receiverQueue = session.createQueue(queueName);
QueueReceiver receiver = session.createReceiver(receiverQueue);
connection.start();
/* read queue messages */
while (true) {
TextMessage message = (TextMessage) receiver.receive();
if (message == null)
break;
System.out.println("Received message: " + message.getText());
}
connection.close();
} catch (JMSException e) {
e.printStackTrace();
System.exit(0);
}
}
}
4) Sample (2) for RECEIVE a message to TIBCO EMS
import com.tibco.tibjms.TibjmsConnectionFactory;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.TextMessage;
public class RecieverSwingTIBCO {
public static void main(String[] args) {
try {
TibjmsConnectionFactory tibjmsConnectionFactory = new TibjmsConnectionFactory("tcp://localhost:7222");
Connection connection = tibjmsConnectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Destination destination = session.createQueue("myQueue");
MessageConsumer messageConsumer=session.createConsumer(destination);
Message message=messageConsumer.receive();
message.acknowledge();
TextMessage textMessage=(TextMessage)message;
System.out.println(textMessage.getText());
session.close();
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Try to send and recieve messages from running above classes.
This is using TIBCO EMS
Before this Install TIBCO EMS
ADD Dependencys(tibjms.jar, jms2.0.jar)
1) Sample (1) to SEND a message to TIBCO EMS
import java.util.Vector;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import com.tibco.tibjms.TibjmsQueueConnectionFactory;
public class TibcoEMSQueueSender {
public static void main(String args[]) {
String serverUrl = "tcp://localhost:7222";
String userName = "admin";
String password = "admin";
String queueName = "myQueue";
try {
Vector
data.add("Hello World!"+System.currentTimeMillis());
System.out.println("Sending JMS message to server " + serverUrl + "...");
QueueConnectionFactory factory = new TibjmsQueueConnectionFactory(serverUrl);
QueueConnection connection = factory.createQueueConnection(userName, password);
QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
// Use createQueue() to enable sending into dynamic queues.
Queue senderQueue = session.createQueue(queueName);
QueueSender sender = session.createSender(senderQueue);
/* publish messages */
for (int i = 0; i < data.size(); i++) {
TextMessage jmsMessage = session.createTextMessage();
String text = (String) data.elementAt(i);
jmsMessage.setText(text);
sender.send(jmsMessage);
System.out.println("Sent message: " + text);
}
connection.close();
} catch (JMSException e) {
e.printStackTrace();
System.exit(0);
}
}
}
2) Sample (2) to SEND a message to TIBCO EMS
import com.tibco.tibjms.TibjmsConnectionFactory;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
public class SenderSwingTIBCO {
public static void main(String[] args) {
try {
TibjmsConnectionFactory tibjmsConnectionFactory = new TibjmsConnectionFactory("tcp://localhost:7222");
Connection connection = tibjmsConnectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Destination destination = session.createQueue("myQueue");
MessageProducer messageProducer = session.createProducer(destination);
messageProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
StringBuffer strContent = new StringBuffer();
strContent.append("eluwa");
TextMessage textMessage = session.createTextMessage(strContent.toString());
messageProducer.send(textMessage);
session.close();
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
3) Sample (1) to RECEIVE a message to TIBCO EMS
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import com.tibco.tibjms.TibjmsQueueConnectionFactory;
public class TibcoEMSQueueReceiver {
public static void main(String args[]) {
String serverUrl = "tcp://localhost:7222";
String userName = "admin";
String password = "admin";
String queueName = "myQueue";
try {
System.out.println("Start listening for incoming JMS message on " + serverUrl + "...");
QueueConnectionFactory factory = new TibjmsQueueConnectionFactory(serverUrl);
QueueConnection connection = factory.createQueueConnection(userName, password);
QueueSession session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
// Use createQueue() to enable receiving from dynamic queues.
Queue receiverQueue = session.createQueue(queueName);
QueueReceiver receiver = session.createReceiver(receiverQueue);
connection.start();
/* read queue messages */
while (true) {
TextMessage message = (TextMessage) receiver.receive();
if (message == null)
break;
System.out.println("Received message: " + message.getText());
}
connection.close();
} catch (JMSException e) {
e.printStackTrace();
System.exit(0);
}
}
}
4) Sample (2) for RECEIVE a message to TIBCO EMS
import com.tibco.tibjms.TibjmsConnectionFactory;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.TextMessage;
public class RecieverSwingTIBCO {
public static void main(String[] args) {
try {
TibjmsConnectionFactory tibjmsConnectionFactory = new TibjmsConnectionFactory("tcp://localhost:7222");
Connection connection = tibjmsConnectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Destination destination = session.createQueue("myQueue");
MessageConsumer messageConsumer=session.createConsumer(destination);
Message message=messageConsumer.receive();
message.acknowledge();
TextMessage textMessage=(TextMessage)message;
System.out.println(textMessage.getText());
session.close();
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Try to send and recieve messages from running above classes.
Thursday, December 15, 2011
Windows --------->Mac OS copyright @ http://pariganakalipi.blogspot.com/
සුබ දවසක් යාළුවනේ, ඔයාලට කොහොමද? අලුත් දෙයක් අරගෙන ඔන්න මේ පැත්තට අදත් ගොඩ වැදුනා, ඔයාලා දන්නවා ඇති Apple පරිගණක වල භාවිත කරන Max OS එක අපගේ සාමාන්ය පරිගණක වලට භාවිත කිරීමට නොහැකි බව, මෙහෙම වෙන්නෙ Apple සමාගම අකමැතියි තව මෘදුකාංග අනෙකුත් OS සමග ක්රියාකරවීමට, ඒ වගේම මේකත් දන්නවා ඇති දැන්, Mac OS එක අපේ කොම් වලට ගහන්න පුළුවන් විදිහට හදාගෙන යනවා කියලා, ඒක තාම සෑම පරිගණකයකටම වැඩ කරන්නෙ නෑ, මේක කරන්නෙ, HAZARD නමින් හදුන්වන Ethical Hacking Team එක, එයාලා මේ ලගකදී අලුත් වර්ෂන් එකත් නිකුත් කරන්න බලාපොරොත්තුවෙන් සිටිනවා, එහෙත් ඔයාලා කැමති ඇති, වැඩි දෙනෙක් භාවිත කරන Windows 7 Mac OS එක විදිහට පාවිච්චි කරන්න කැමති ඇති, මොකද ඇපල් පරිගණකයක් දැකලාවත් නැති අපිට, Mac කියන්නෙ සිහිනයක් වෙලා තිබ්බෙ, ඔයාලා කැමති අයට දාගෙන බලන්න පුළුවන්, බැළු බැල්මට මුල්න්ම OS එක හරියට හොයාගන්නත් බැරි තරම් විදිහට වෙනස් ඇත්තෙන්ම, Mac OS එකේ පෙනුම එහෙම් පිටින්ම. පහත පිංතූරය බලන්න, එහිදී ඔයාලට පැහැදිලිව දකින්න පුලුවන්.
ඔබත් කැමති නම් පහලින් 32bit සහ 64bit සදහා සහය දක්වන Mac OS X Lion එක Download කරගන්න පුළුවන්, ඔබගේ කොම් එකේ Windows 7 Version එක අනුව Install කරගන්න....මෙම Skin Pack එක ඔබ Install කිරීමෙන් අනතුරුව Uninstall කරගැනීමේ හැකියාව තිබෙනවා, පහල ලින්ක් වලින් අදාලා Skin Pack එක Download කරගන්න.
Monday, December 5, 2011
Web Cam එක Security Cam එකක් කරගමු!!!
සියලු අයිතිය හා උපුටා ගැනිම - ශ්රි ලංකා Online
සුභ දවසක් ඔක්කොම දෙනාට......අද ටිකක් විශේෂ දවසක් , මොකද අද අපේ ලිපිය ටිකක් වටිනා එකක්...උඩ මාතෘකාව දැක්කම එක තෙරෙනවා නේ..ඉතින් මේක කරන්න ගොඩක් අය උත්සහ කරලා ඇති ඉතින් මම හිතුවා මෙක ක්රමානුකුලව කියලා දෙන්න...ඔයාලට මතක ඇති මම මයික්රසොෆ්ට් ස්කයි ඩ්රයිව් එක හදාගන්න හැටි කියලා දිලා කිව්වා මෙක කතන්දරෙ පළමු පිටුව කියලා....ඉතින් එහෙනම් මෙක තමා දෙවන පිටුව.ඔක්කොටම කලින් එක කියෙව්වෙ නැත්නම් සහ එක හදා ගත්තෙ නැත්නම් පහල ලින්ක් එකට ගිහින් මයික්රසොෆ්ට් ස්කයි ඩ්රයිව් එක හදාගන්න..
මෙතනින් බලන්න http://tinyurl.com/3ss3kx7
මෙක අත්යාවශ්යයි මේ වැඩෙට ඉතින් ඔක හදාගත්තට පස්සෙ මේ පහල තියෙන පින්තුරය වගේ පෙන්න ඔනේ.

හරි දැන් අපේ අද මාතෘකාව වන වෙබ් කැම් එක ආරක්ෂිත කැමරාවක් විදියට හදාගන්න හැටි බලමු. හැමදාම කරනවා වගේ මෙකේ සිද්ධාන්තය මම පැහැදිලි කරන්නම් , අපි වෙබ් කැම් වැඩසටහනක් මගින් ඡායාරුපගත කරනවා එ වෙලාවෙ සිදුවන දෙවල් සහ එ ඡායාරුප වෙබ් එකට අප්ලොඩ් කිරිමක් සිදුකරනවා එ වෙලාවෙදිම...ඉතින් එවා වෙන තැනකින් ලොග් වෙලා බලන්න හැකියාව තියෙන එක තමා මේක ආරක්ෂිත කැමරාවක් වගේ වැඩ කරන්නේ.
හරි දැන් සිද්ධාන්තය පැහැදිලි නේ....අපි පියවර වශයෙන් වැඩේ කරමු.
පියවර 01
මුලින්ම විශේෂ වෙබ් කැම් වැඩසටහන Install කරගන්න ඔනේ...මෙකෙ නම ඩොර්ජෙම් , මෙක අපේ Downloads පිටුවට ගිහින් Download කරගන්න පුලුවනි , Setup File එක Download උනාට පස්සෙ Run කරලා ඩොර්ජෙම් Install කරගන්න PC එකට
මෙතනින් Download කරගන්න
පියවර 02
හරි දැන් තියෙන්නෙ ඩොර්ජෙම් වැඩසටහන හදාගන්න අපිට ඔනේ විදියට...

ඉහල රූපෙ තියෙන විදියට කැම් සොස් එක සහ JPEG Compression එක 50ට හදන්න...මොකද අඩු කොලිටි කරාම රූපේ විශාලත්වය අඩු වෙන නිසා හොඳයි.
දැන් Options වලට ගිහින් Motion Detection එක On කරගන්න

හරි දැන් තියෙන්නෙ කැම් එකෙන් ෆොටො ගන්න විදිය සහ වෙබ් එකට අප්ලොඩ් කරන විදිය හදන්න...
දැන් මේ ව්දියට යන්න -
Store Settings - Add - File
එතකොට මේ ව්දියට පෙනෙයි සහ මෙකෙ තමන්ට ඔනෙ විදියට මෙවා ටික හදා ගන්න

දැන් File එක Save වෙන තැන වෙන්න ඔනේ අපි හදා ගත්ත ස්කයි ඩ්රයිව් එක....එක බ්රව්ස් කරලා දෙන්න සහ File Name එකට මෙහෙම දෙන්න " %G , %g "....එකෙන් ෆොටො එක ගත්ත දිනය සහ වෙලාව ඔබට බලාගන්න පුලුවනි.

ස්කයි ඩ්රයිව් එක ඇතුලේ වෙනම Folder එකක් හදාගෙන, Save කරන තැන හදාගන්න
පියවර 03
දැන් ඔක්කොම හරි...ඩොර්ජෙම් එකෙ Auto Capture එක On කරල Minimize කරලා තියන්න සහ skydrive.live.com එකට ගිහින් වෙන PC එකකින් බලන්න කැම් එකෙන් මොනාද මේ මොහොතේ වෙන්නෙ සහ කවුරු හරි එක Use කරන්න හැදුවද කියලා ඔබ නැති අතරෙ.
හරි එහෙනම් කියලා දෙන එක අපේ යුතුකම සහ එක ප්රයොජනවත් විදියට භාවිත කිරිම ඔබෙ වගකීම....ඉතින් මෙක හොඳ විදියට භාවිත කරන්න සහ ප්රතිචාරයකුත් දාලා යන්න.
උපුටා ගැනිම - ශ්රි ලංකා Online
Sunday, December 19, 2010
Java
Java is a Object Oriantation Language.
Java has developed by James Gosling a wel known programer of c language.
I ll plan to give about my knowledge in java using this blog.. share it to all thank you!!!
Java has developed by James Gosling a wel known programer of c language.
I ll plan to give about my knowledge in java using this blog.. share it to all thank you!!!
Saturday, July 3, 2010
Meaning of the Words.
Applet :- A Small Java Application that is downloaded by an ActiveX or Java enabled web browser. Once it has been downloaded, the applet will run on the user's Computer.Common applets include financial calculators and web drawing programs.
Application :- Computer software that performs a task to set of tasks, such as word proccessing or drawing.Applications are also refered to as programs.
ASCII :- American Standard Code For Information Intercharge, an encoding system for converting keyboard characters and instructions into the binary number code that the computer understands.
Bandwith :- The Capasity of a networked connetion.Bandwith determines how much data can be sent along the network wires.
Binary Code :- The most basic language a computer understands, it is composed of a series of 0s and 1s,The computer interprets the code from numbers ,letters,punctuation marks and symbols.
bit :- (Short for "binary digit"). The smallest piese of computer information, either the number 0 or 1 .
Boot :- To start up a computer.Cold boot-restarting computer after having turnned off the power. Warm boot- restarting computer without having turrned off the power.
To be Continued..
Application :- Computer software that performs a task to set of tasks, such as word proccessing or drawing.Applications are also refered to as programs.
ASCII :- American Standard Code For Information Intercharge, an encoding system for converting keyboard characters and instructions into the binary number code that the computer understands.
Bandwith :- The Capasity of a networked connetion.Bandwith determines how much data can be sent along the network wires.
Binary Code :- The most basic language a computer understands, it is composed of a series of 0s and 1s,The computer interprets the code from numbers ,letters,punctuation marks and symbols.
bit :- (Short for "binary digit"). The smallest piese of computer information, either the number 0 or 1 .
Boot :- To start up a computer.Cold boot-restarting computer after having turnned off the power. Warm boot- restarting computer without having turrned off the power.
To be Continued..
Wednesday, June 23, 2010
Allow PINGs through your Windows Vista Firewall
It is not possible to ping your windows vista computer from another computer while having your firewall enabled. Yes the most simplest and the most drastic solution is to disable the firewall. But there are better ways to get over it.
Enable ICMP Echo Request
Open an Administrative command prompt. This could be done by right clicking the cmd --> Run as Administrator OR in the search pain type cmd and Ctrl+Shift+Enter
Once you open it type the following to Enable ICMP Echo Request
netsh firewall set icmpsetting 8 enable
To disable ICMP Echo Request
netsh firewall set icmpsetting 8 disable
Hope this helped most of you out there wondering how to enable a ping request on your Windows Vista PC without having to disable the firewall
Enable ICMP Echo Request
Open an Administrative command prompt. This could be done by right clicking the cmd --> Run as Administrator OR in the search pain type cmd and Ctrl+Shift+Enter
Once you open it type the following to Enable ICMP Echo Request
netsh firewall set icmpsetting 8 enable
To disable ICMP Echo Request
netsh firewall set icmpsetting 8 disable
Hope this helped most of you out there wondering how to enable a ping request on your Windows Vista PC without having to disable the firewall
Subscribe to:
Posts (Atom)

