Archive for ◊ September, 2008 ◊

Monitoring Bandwidth usage with SNMP and RRDtool for Linux
Sunday, September 28th, 2008 | Author:

Before monitor any server you need to install SNMP and RRDTool packages on monitor server and net-snmp package on server which you want to monitor.

lets assume server which has SNMP and RRDTool means monitor server has ip address 10.10.10.1
and server which you want to monitor has IP address 99.99.99.99

SNMP Installation
SNMP packages require for querring .

– type command at the prompt
#yum search snmp
It will show you different snmp packages.
You neet to install 2 packages
net-snmp
net-snmp-devel
type command
#yum install net-snmp
#yum install net-snmp-devel

RRDTool Installation

RRD store and display time-series data (i.e. network bandwidth, server load average). It stores the data in a very compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density.

RRDTool 1.2.x has dependancies ,hence you need to install following packages.

* libart_lgpl-2.3.11-2.i386.rpm
* libart_lgpl-devel-2.3.11-2.i386.rpm

more…

Install Java on Linux Platform
Sunday, September 28th, 2008 | Author:

Download the JDK from http://java.sun.com/j2se/1.5.0/download.jsp
(A)  install jdk by running the RPM or bin file.

Installation Instructions

Install formats – JDK 5.0 is available in two installation formats.

  • Self-extracting Binary File – This file can be used to install the JDK in a location chosen by the user. This one can be installed by anyone (not only root users), and it can easily be installed in any location. As long as you are not root user, it cannot displace the system version of the Java platform suppled by Linux. To use this file, see Installation of Self-Extracting Binary below.
  • RPM Packages – A rpm.bin file containing RPM packages, installed with the rpm utility. Requires root access to install, and installs by default in a location that replaces the system version of the Java platform supplied by Linux. To use this bundle, see Installation of RPM File below.

Choose the install format that is most suitable to your needs.

more…

Category: Java, Linux Server Hosting |  Tags: , , | Comments off
Installing Tomcat on Linux
Sunday, September 28th, 2008 | Author:

To install apache tomcat , you need to install jdk (Java Development kit).
Tomcat need JAVA_HOME set properly before prior to operation or installation.
e.g.
JAVA_HOME=/usr/local/jdk
PATH=$JAVA_HOME/bin:$PATH

You can download the installer from
http://archive.apache.org/dist/jakarta/tomcat-5/v5.0.28/bin/jakarta-tomcat-5.0.28.tar.gz

Download version 5.0.28 to be compatible with JDK 1.4.2 because the latest versions of tomcat require JDK5

To extract and install Tomcat run this command:

]# tar xvfz jakarta-tomcat-5.0.28.tar.gz

The Tomcat files are installed in a directory called jakarta-tomcat-5.0.28 in the current directory.

Then you need to set CATALINA_HOME properly prior to start tomcat.

Use following command to set CATALINA_HOME and provide full path of tomcat directory (from toot).

export CATALINA_HOME=/user/local/jakarta/jakarta-tomcat-5.0.28

Run Tomcat

goto bin directory of tomcat
cd /user/local/jakarta/jakarta-tomcat-5.0.28/bin
]# ./startup.sh

Open web browser and type http://your_domain:8080/ you should see the Tomcat Administration page

Test Tomcat

go to webapps/ROOT in the tomcat directory and create page hello_world.html and write in it

Hello World

open the URL http://your_domain:8080/hello_world.html you should see your page.

Test JSP page

go to webapps/ROOT in the tomcat directory and create page test.jsp and write in it the following lines
<html>
<%=new String(“Hello World…”)%>
<br>
<%=new java.util.Date()%>
<br>
</html>

save and run the following URL http://your_domain:8080/test.jsp you should see Hello World.. followed by current date.

Monitor Tomcat

You can see the log file in the logs directory  /user/local/jakarta/jakarta-tomcat-5.0.28/log/

Stop Tomcat

Go to the tomcat bin directory and run command.

]# ./shutdown.sh

Note:- Apache Tomcat on Linux faster that tomcat in Windows at least 2 times in both startup, shutdown and in compiling jsp files.

Category: Java, Linux Server Hosting |  Tags: , , | Comments off
Thread Safety in JSP & Servlet
Sunday, September 28th, 2008 | Author:

You can thread safe your jsp (java server pages) pages in two ways

1. By implementing the SingleThreadModel interface.

This is done by adding the directive to your jsp page

<%@ page isThreadSafe=”false” %>

Within your jsp page.

When you implement SingleThreadModel interface instead of a single instance of the servlet generated for your jsp page loaded in memory, jsp engine creates new instance of that jsp page for each client request.
but avoid this method because, this methods has some performance issue and there are many pitfalls.

2. By using synchronized block or synchronized method

more…

Category: Hosting Security, Java |  Tags: , , , , | Comments off
MySQL Database Indexing
Sunday, September 28th, 2008 | Author:

What is Database Indexing?
Database index is like data structure that improves the performance of a database.
Index on table can be created one or more column on databse table, which improves random access of any records and efficient access of ordered records.

Types of Indexes in MySql

1. Normal Indexes :-
Normal Index have not restriction like Uniqueness,it is a basic index.

2. Unique Indexes :–
It is like a Normal index but only one difference, all values of the indexed columns must only occur once.

3.Primary Keys :-
Primary keys are basically unique index and must be add “PRIMARY KEY” in specific column.

How to Create Index in Mysql at time of table creation.

CREATE TABLE student (
fname VARCHAR(30),
lname VARCHAR(30),
studID INT, INDEX (studID)
)

You can create index on existing table, used following MySQL Statement

CREATE INDEX index_studID ON student(studID)

Advantages of database index
1. Database indexes speed up the database selection operation.

Advantages of database index
1. Database indexes slow down the database insert,update,delete operations.
2. Database Index takes more space.

Category: MySQL Hosting |  Tags: , , , | Comments off
Computer Security and Firewalls
Sunday, September 28th, 2008 | Author:

What do we want from secure computer systems?

Here is a reasonable goal:  Computers are as secure as real world systems, and people believe it.

Security is the condition of being protected against danger, loss, and hackers. In the general sense, security is a concept similar to safety.

In today’s web-based world, hackers and malicious software are the biggest threat to anyone who conducts business online.  Viruses and worms have the ability to cripple entire networks while an experienced hacker can penetrate a system and thieve confidential data.  Because of this, consumers and online businesses alike are taking proactive steps towards protecting their personal information.  Some are conferring with their web hosting providers to ensure that the security measures they implement are reliable.

There are many creative ways that unscrupulous people use to access or abuse unprotected computers. I have mentioned few of them below,

more…

Category: Hosting Security |  Tags: , , , , , | Comments off