Author Archive

Secure MS SQL – BEST PRACTICES
Monday, February 02nd, 2009 | Author:

There are several points that Microsoft suggests before configuring your MS SQL Server.

BEST PRACTICES ACCORDING TO MICROSOFT

  • Install only those components that you will use immediately. Microsoft recommends that you create a list of components that you will be using, and only enable those. If the need arises, you can install the additional components at that time. The components in a SQL Server installation are the Database Engine, Analysis Services Engine, Reporting Services, Integration Services, Notification Services, and Documents and Samples. more…
Difference between SQL Server 2005 and SQL Server 2008
Wednesday, January 14th, 2009 | Author:

difference-between-2005-2008

MS SQL 2005 Server was released after 5 servers of it previous SQL version, MS SQL 2000, Hence it required allot to revisions to cope up with the current windows development environment. Therefore MS SQL 2005 SP2 had major changes in it, with too many performances and security fixes. Microsoft could not add few revisions due to its basic development structure however they had all the scope to introduce them in SQL 2008 release. And indeed, MS SQL 2008 has many installation as well as performance fixes being applied to it and allowing Windows Administrators to have full control on SQL activities. The biggest advantage of SQL 2008 over SQL 2005 is the ability to manage and maintain server performance. SQL 2008 does not require too much resource which is the best deal for today’s Shared Hosting environment. Also an upper hand to whose to do not want to invest too much on hardware of their dedicated servers just to run SQL server on it.

more…

Backup MySQL using VBS scripts
Monday, January 12th, 2009 | Author:

I have seen so many people searching ASP or ASP .NET scripts to backup their MySQL databases. Not only this but my Blog has been getting to many hits for the search term “backup mysql asp”. After seeing the need of so many people for the script I decided to write a VBS script to backup all or single MySQL database on Windows server. I am not very good at ASP so I didn’t write the script in ASP or ASP .NET but one can convert this script in either ASP or ASP .NET, it should not be a huge problem I suppose.

backup-mysql-asp more…

How to install phpMyAdmin on Windows
Saturday, November 15th, 2008 | Author:

These steps can be followed on Windows 2000, Windows NT servers, Windows 2003, Windows 2008 and Windows XP.

For steps on Linux refer the link below:

How to install PHPMyAdmin on Linux

How to install phpMyAdmin 2.11 on Windows Desktop and Server

Here are steps that will help you installed PHPMyAdmin on a Windows server.

REQUIREMENTS:

>> PHP 4.3/4.4/5.1
>> MySQL 4.0/4.1/5.0

DOWNLOAD:

This installation was tested on phpMyAdmin-2.11.1
You can select the file from PHPMyAdmin Downloads

more…

Secure your MS SQL Database Connection String
Tuesday, November 11th, 2008 | Author:

Ways to secure your MS SQL connection string in ASP .NET.

We have seen allot of people looking to have the best option to secure the connection string in their ASP .NET code to connect the MS SQL database since it contains the username and password of their database. It is very important to use a secure method for corporate clients and those who save Credit Card details in their MS SQL database. Or they will easily get hacked and all the important data will be exploited by the hacker. And also for those who store important data in MSSQL.

Here are the list of methods that can be used to secure your MS SQL connection string in your ASP.NET application.

METHODS:

1. Using a DSN connection string:

more…

Enable SQL 2005 Remote Connections
Monday, November 10th, 2008 | Author:

Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition

You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:

1.    Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click MS SQL Server Surface Area Configuration.
2.    On the MS SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
3.    On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

Note Click OK when you receive the following message:
Changes to Connection Settings will not take effect until you restart the Database Engine service.
4.    On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

Enable the SQL Server Browser service

If you are running MS SQL Server 2005 by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections. For example, MS SQL Server 2005 Express is installed with a default instance name of Computer Name\SQLEXPRESS. You are only required to enable the SQL Server Browser service one time, regardless of how many instances of SQL Server 2005 you are running. To enable the MS SQL Server Browser service, follow these steps.

more…

Using Pass Phrases to Encrypt Data in MSSQL 2005
Wednesday, October 22nd, 2008 | Author:

Using Pass Phrases to Encrypt Data

A password that allows for spaces can be referred to as a pass phrase. The benefit of pass phrases is that you can make them meaningful and easy to remember. Instead of creating and managing encryption keys or certificates in your database server, you can encrypt data using only a pass phrase.The ENCRYPTBYPASSPHRASE statement uses the supplied pass phrase to generate a symmetric key, which is used to perform the actual data encryption. No key management is required, as the key will be recreated each time the same pass phrase is supplied.The common syntax of the ENCRYPTBYPASSPHRASE statement is as follows:

ENCRYPTBYPASSPHRASE ('PASSPHRASE', 'PLAINTEXT')

In this statement, PASSPHRASE specifies the data string to be used to derive an encryption key. PLAINTEXT specifies the data to be encrypted. No permissions are required to run the ENCRYPTBYPASSPHRASE statement.

The following syntax encrypts the string using the supplied pass phrase:

more…

Install RRDTool On Windows Server
Friday, October 10th, 2008 | Author:

We all have an impressions that it is very difficult to install RRDTool on a Windows Server but that is not the case. There are few very Simple Steps to install RRDTool on a Windows server:

STEPS:

1. Create a Folder on any of your drives with name RRDTool.

2. Download the latest version of RRDTool from the link below:

DOWNLOAD RRDTool

3. Extract the ZIP in RRDTool folder.

4. Open START >> Run >> type cmd to open Windows command prompt.

5. Type following command on prompt to use the RRDTool.

cd C:\RRDTool\

That is it…!!!! You are ready to use your RRDTool on your Windows machine.

These steps are applicable to all Windows versions including Windows XP, Windows Vista, Windows NT and Winsdows 2003/2008 Servers.

Some times we see the error below in the event logs:

SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\MSSQL\DATA\%file_name%] in database [%DB_name%] (2).  The OS file handle is 0×00000838.  The offset of the latest long I/O is: 0x000000ebdc0000

Do you refer it to as a stalled IO? We always hear a questions such as, what’s wrong with SQL Server..? Why is SQL taking so long to read or write to the disk..? Let us discuss why it is not a MS SQL Server problem:

MS SQL Server does data file reads and writes almost exclusively as asynchronous IO, using the win32 APIs ReadFile, WriteFile, ReadFileScatter and WriteFileGather. Each of these APIs behave in a fairly similar steps, the caller sends in a handle to the file, some memory location to read or write, the size of the block and a structure that tells the kernel how to handle the IO. In MS SQL Server’s case, how to handle the IO is Asynchronously, please.  The call returns immediately so that the thread issuing so that the IO can get out of the way and make life happy for other users who are also waiting got their query to return.

The catch here is that, ordinarily the time between the Asynchronous call to read or write and the completion of the read or write should be on the order of 10ms. The longer it takes for an IO to return the more noticeable a performance impact there is to end users.

more…

Category: MSSQL Server, Window Hosting |  Tags: , , , , , | Comments off
IIS Optimizing & Monitoring Tools
Thursday, October 09th, 2008 | Author:

Here are some useful tools that help us in configuring IIS server to be more secure and less resource consuming:

1. IIS Passwords Sync:

IIS 6.0 web sites run under anonymous user accounts. It is IUSR_<machine name> (by default) or other user accounts created by your web hosting control panel. The users’ passwords are set automatically set and are never known. However, sometimes for some reason the passwords get out of sync or corrupted and need to be reset. The easiest way to reset these passwords is to use IIS Passwords Sync program. It extracts the passwords that Microsoft IIS 6.0 has in its metabase and updates the accounts in “Local Users and Groups” to use that passwords.

DOWNLOAD LINK

2. IIS Pool:

With IIS Pool tool we can easily search the problematic sites which have default application pool.

IIS Application Pools Monitoring and Analysis:

This program allows monitoring of IIS 6 application pools. All the monitoring data is stored in log files. It is possible to analyze a pool to find a website (or a virtual application) using too much resources. …

Overview -

IIS Application Pools Monitoring and Analysis:

* This program allows monitoring of IIS 6 application pools.

* All the monitoring data is stored in log files.

* It is possible to analyze a pool to find a website (or a virtual application) using too much resources.

Features -

* IIS application pools monitoring

* IIS application pools analysis

* Find websites using too much resources

DOWNLOAD LINK

3. IIS Report:

Overview -

IIS Report is a command line tool. It allows us to create different IIS related reports. For example it can get the list of all SSL websites and sort it by IP address, or get the list of all websites and sort it by application pool name and then by website name, …

There is no installation required. Just download and unrar the archive file. Then start the program with:

C:\>iisreport.exe /?

to get more information and see all the parameters available.

Benefits -

* Easy-to-use

* Fast

* It is possible to import the reports with Excel

* It is possible to parse the reports with VBS or BAT programs and other administration applications.

DOWNLOAD LINK

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