Archive for the ‘cPanel VPS Hosting’ Category

How to retrieve data from Mysql Database?

Thursday, May 31st, 2007

While using PHP, you can run MYSQL SELECT.

The following will show you to retrieve data from mysql_fetch_array()

include ‘config.php’;
include ‘opendb.php’;

$query = “SELECT name, subject, message FROM contact”;
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo “Name :{$row['name']}
” .
“Subject : {$row['subject']}
” .
“Message : {$row['message']}

“;
}

include ‘closedb.php’;
?>

The following will show you how to retrieve data from mysql_fetch_assoc()

include ‘config.php’;
include ‘opendb.php’;

$query = “SELECT name, subject, message FROM contact”;
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
echo “Name :{$row['name']}
” .
“Subject : {$row['subject']}
” .
“Message : {$row['message']}

“;
}

include ‘closedb.php’;
?>

To Create login Username and Password Storage in Mysql Database

Tuesday, May 22nd, 2007

CREATE TABLE tbl_auth_user (
user_id VARCHAR(10) NOT NULL,
user_password CHAR(32) NOT NULL,

PRIMARY KEY (user_id)
);

INSERT INTO tbl_auth_user (user_id, user_password) VALUES (’theadmin’, PASSWORD(’chumbawamba’));
INSERT INTO tbl_auth_user (user_id, user_password) VALUES (’webmaster’, PASSWORD(’webmistress’));

How to install phpBB2 Forum with cPanel Fantastico?

Saturday, May 19th, 2007

> Login in cPanel
> Click on Fantastico
> Now you see a list, from there click on phpBB2
> Click on New installation
> Select installation location
> Enter a name to install after the domain is selected
> Select username and password
> Thereafter, enter the necesary details according to selection
> Click on finish installation
> Enter the email where you want the information to be sent

Thats all!!!

How to install MySQL in Windows Operating System?

Monday, May 7th, 2007

The following are the steps to install Mysql in Windows -

The Zip file -

mysql-shareware-3_22_34-win.zip

Also check for latest versions on the internet

a) A temporary directory should be created
b) Unzip the file to the directory
c) After the unzip process, search for “setup.exe”
d) Make sure you close all programs
e) Search for Setup File in the temporary directory
f) Select “OK” in order to proceed
g) Follow the instructions of the installation process
h) Restart Windows
i) In MS-DOS, switch to c:\mysql\bin
j) At the prompt -

mysqld-shareware –standalone or mysqld

k) MySQL Session begins
l) Type “mysql” at the prompt
m) In order to test, type “show databases;”
n) In order to quit type “quit”
o) Thereafter, to shutdown completely, type -

mysqladmin -u root shutdown

Installation of RPM package

Friday, March 16th, 2007

Two important flags for Installation and Upgrations of RPM -

-i –> Installation

-u –> Upgration

These packages are always placed in a directory on the system. -i flag is used in a situation of Installation of Kernel. Please make a note, prior to installtion, we need to check already installed packages
{rpm -q package name}.

After the approptiate package selected to install, we use

{rpm -ivh package name}.

Setting up a Dual-Boot System in a Debian Linux

Saturday, January 27th, 2007

In this situation, the following are possible -

a) On a single HD, Unpartitioned space
b) Second unpartitioned HD

For instance, the following is the situation of your system -

> Windows exists on the system
> Aiming for a Dual-boot
> The system HD does not have a second partiton / Unpartitioned HD which has Windows Installation
> If the Windows Version is 9x/ME, GRUB is required and will not use any other boot manager

The following is the procedure -

> To check the format of HD,
My Computer>Right-Click on C Drive>Properties>Check Type of File System

> Run Debian Installation > turn to Partitioning Disk Screen > Manually Edit partition table > Enter
> On the partition screen, scroll down to Free Space which is normally unpartitioned > Enter > This will create a Linux Partition
> Then select Automatic Partiton > Enter
> Select Default All Files as partition scheme > Enter
> On the next screen, it will show #1 partition which is the Windows partition
> #2 partition for the Debian Installation
> #5 refers to Swap partition
> Finish partition and save changes
> This will create the Base package
> It will then prompt and ask “Install the GRUB boot loader to the master boot record” > Yes
> Remove CD and Reboot
> Grub will then start loading Debian as default

Ubuntu Server / Desktop Monitoring With Cacti

Thursday, January 25th, 2007

Ubuntu Servers

What is Cacti?
It is a solution based on network graphs and was mainly aim of development of the strength of RRD TOOL Data Storage and its function. It polls fasts, and also has a advanced graph templates, it can acquire multiple data at the same time and many other user management features. Its a interface that is very easy to use and helps in the LAN installations upgrade upto various Complex networks with different devices.

The following is the installation Cacti from the source code -

a) Preparation of Server -

> Apache Web Server Installation along with PHP support in Ubuntu Server.
> sudo apt-get install apache2 apache2-common apache2-mpm-prefork apache2-utils
sudo apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi

> In the case of installation of PHP5 support, make a use of the following Command -

sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi

This will install Apache2 webserver

b) MySQL Installation with PHP support -

sudo apt-get install mysql-server mysql-client libmysqlclient12-dev
sudo apt-get install php4-mysql

c) In this case you could also install php5 support, by using the following -

sudo apt-get install php5-mysql

d) To check with other dependancies Installation, please make follow the commands mentioned below -

sudo apt-get install make gcc g++
sudo apt-get install cgilib freetype2 libttf-dev libttf2 libpngwriter0-dev libpng3-dev libfreetype6-dev libart-2.0-dev snmp

e) Installation RRD Tool from Source -

There is a requirement of the download of the latest RRD tool -

sudo cd /usr/local/src/
sudo wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.2.15.tar.gz
sudo tar xfvz rrdtool-1.2.15.tar.gz
sudo cd rrdtool-1.2.15
sudo ./configure
sudo make
sudo make install

RRD Tool installation Complete

f) Installation of Cacti form Source -

Download the Latest Version from http://www.cacti.net/download_cacti.php to Apache Web Server document root.
However the default is /var/www/, the download can be completed if the root path is changed.

sudo cd /var/www/
sudo wget http://www.cacti.net/downloads/cacti-0.8.6i.tar.gz

g) Extraction of Tarball distribution -

sudo tar xzvf cacti-0.8.6i.tar.gz

h) Move to Cacti Directory -

sudo mv cacti-0.8.6i cacti

i) In order to check for the correct permission granted in Cacti files -

sudo chown -R www-data:www-data rra/ log/

j) In order to import Cacti default database -

sudo mysql cacti < cacti.sql

k) Creation of MySQL Username and Password for Cacti

sudo mysql --user=root mysql

mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ’password entered here’;

mysql> flush privileges;

mysql> exit

Installation of VirtualBox in Ubuntu Edgy

Monday, January 22nd, 2007

A virtualBox is a Open-Source professional virtualizer for x86 hardware. The next question arises how to install Virtualbox in Ubuntu Edgy.

Steps -

>First of all, download the latest .deb package

sudo apt-get install libxalan110 libxerces27

wget http://www.virtualbox.org/download/1.3.2/VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb

> After the download, the following file can be seen -

VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb file

> The installation of the above file can be done by the following Command -

sudo dpkg -i VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb

> If you see the following errors -

Selecting previously deselected package virtualbox.
(Reading database … 174459 files and directories currently installed.)
Unpacking virtualbox (from VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb) …
dpkg: dependency problems prevent configuration of virtualbox:
virtualbox depends on libxalan110; however:
Package libxalan110 is not installed.
virtualbox depends on libxerces27; however:
Package libxerces27 is not installed.
dpkg: error processing virtualbox (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
virtualbox

The above error can be disregarded by entering the following Command -

sudo apt-get -f install

The Installation is Complete.

> TO start VirtualBox Graphical User Interface -

VirtualBox