MySQL Installation for Ubuntu

MySQL is a freely available open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). basic steps of configuring MySQL for use with a MySQL-based application in which the application runs on the same server as the database.


SQL is the most popular language for adding, accessing and managing content in a database. It is most noted for its quick processing, proven reliability, ease and flexibility of use. MySQL is an essential part of almost every open source PHP application.


Preparing MySQL For Applications
Install and start MySQL.
Create a MySQL “root” user.
Create a regular MySQL user that the application will use to access the database.
Create your applications database.
Create your databases data tables.
Perform some basic tests of your database structure.

Installation Features of MySQL
The MySQL database server, which manages databases and tables, controls user access, and processes SQL queries.

MySQL client programs, which make it possible to connect to and interact with the server.

Libraries and header files that come in handy when compiling other programs that use MySQL.

Shared libraries for the MySQL client.

Benchmark and performance testing tools for the MySQL database server.

MySQL Installation Layout for Linux RPM Packages
Client programs and scripts

The mysqld server

Log files, databases

MySQL manual in Info format

Unix manual pages

Include (header) files


Support files, including error messages, character set files, sample configuration files, SQL for database installation


Types are used with MySQL

/etc/my.cnf (or) /etc/mysql/my.cnf




/var/run/mysqld/ & /var/lib/mysql/mysql.sock

MySQL Syntax
SELECT column_name(s)
FROM table_name
LIMIT number;

Installation of Mysql Server 5.5 for Ubuntu
Updating System
sudo apt-get update

Installation MsySQL Server
sudo apt-get install mysql-server-5.6

It Will Ask For Password


It Will Ask For Repeat Password


Re-Starting Services
service mysql status
service mysql start
service mysql stop
service mysql restart



IPTraf is console-based network statistics utility for Linux. iptraf recognize various protocols, including IP, TCP, UDP, ICMP, IGMP, IGP, IGRP, OSPF, ARP and RARP.
In this how-to we are going to show you how to install iptraf, network monitoring utility.

An IP traffic monitor that shows information on the IP traffic passing over your network. Includes TCP flag information, packet and byte counts, ICMP details, OSPF packet types.
General and detailed interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP packet counts, IP checksum errors, interface activity, packet size counts.
A TCP and UDP service monitor showing counts of incoming and outgoing packets for common TCP and UDP application ports
A LAN statistics module that discovers active hosts and shows statistics showing the data activity on them
TCP, UDP, and other protocol display filters, allowing you to view only traffic you’re interested in.
Supports Ethernet, FDDI, ISDN, SLIP, PPP, and loopback interface types.
Utilizes the built-in raw socket interface of the Linux kernel, allowing it to be used over a wide range of supported network cards.

IPTraf Installation
Updating System
sudo apt-get update

Install IPTraf
sudo apt-get install iptraf

Installation is Completed
Please check by typing iptraf in command prompt

Follow Below Steps
Open Terminal
Type iptraf in Terminal
It Display Below Details


Press a Key to Continue

Press Continue

IP  Traffic Monitoring

Ip traffic monitor

General Interface Statistics


Detailed Interface Statistics


Statical Breakdown


Lan Station Monitor




Monit Installation

Monit is a free open source and very useful tool that automatically monitors and manages server process, files, directories, checksums, permissions, filesystems and services like Apache, Nginx, MySQL, FTP, SSH, Sendmail and so on in a UNIX/Linux based systems and provides an excellent and helpful monitoring functionality to system administrators.

Monit is a free open source and very useful tool that automatically monitors and manages server process, files, directories, checksums, permissions, filesystems and services like Apache, Nginx, MySQL, FTP, SSH, Sendmail and so on in a UNIX/Linux based systems and provides an excellent and helpful monitoring functionality to system administrators.

The monit has user friendly web interface where you can directly view the system status and setup up processes using native HTTP(S) web server or via the command line interface. This means you must have web server like Apache or Nginx installed on your system to access and view monit web interface.

Monit has a ability to start a process if it is not running, restart a process if not responding and stop a process if uses high resources. Additionally you can also use Monit to Monitor files, directories and filesystems for changes, checksum changes, file size changes or timestamp changes. With Monit you can able to monitor remote hosts TCP/IP port, server protocols and ping. Monit keeps its own log file and alerts about any critical error conditions and recovery status.

Installation of Monit
Updating System
sudo apt-get update

Install Monit From Terminal
sudo apt-get install monit

Configuring Monit Conf File
echo “set httpd port 2812 and
use address localhost  # only accept connection from localhost
allow localhost        # allow localhost to connect to the server and
allow admin:monit      # require user ‘admin’ with password ‘monit’
allow @monit           # allow users of group ‘monit’ to connect (rw)
allow @users readonly  # allow users of group ‘users’ to connect readonly” >> /etc/monit/monitrc

Re-Starting Monit Service
sudo service monit restart

Installation is Completed & Please Check in Web Interface
Please Check http://IP-Address:2812

Login Credentials


System Status

system status

How To Add Monit Services
In Ubuntu & Debian we have to add services in /etc/monit/monitrc
In CentOS & Fedora we have to add services in /etc/monit.conf

Apache2 Service
check process apache with pidfile /run/
start program = “/etc/init.d/apache2 start” with timeout 60 seconds
stop program  = “/etc/init.d/apache2 stop”
Mysql Service
check process mysqld with pidfile /var/run/mysqld/
start program = “/etc/init.d/mysql start”
stop program = “/etc/init.d/mysql stop”

Nginx Service
check process nginx with pidfile /var/run/
start program = “/etc/init.d/nginx start”
stop program = “/etc/init.d/nginx stop”

Sshd Service
check process sshd with pidfile /var/run/
start program “/etc/init.d/sshd start”
stop program “/etc/init.d/sshd stop”
if failed host port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

Checking Syntax
monit -t

Checking Log Errors
tail -f /var/log/monit.log

How to Resolve Grub Rescue Issue

How to Resolve Grub Rescue Issue

Grub Rescue Issue
Set the root to use the /boot directory on partition (hd0,2)
Load kernel module linux
Set that module to use the kernel image vmlinuz-2.6.32-33-generic
Set initrd(initialize RAM disk) to use the image initrd.img-2.6.32-33-generic
Boot Linux

Type Commands in Grub Rescue
grub rescue>  set root=(hd0,2)/boot
grub rescue>  insmod linux
grub rescue>  linux (hd0,2)/boot/vmlinuz-2.6.32-33-generic root=/dev/sda2
grub rescue>  initrd (hd0,2)/boot/initrd.img-2.6.32-33-generic
grub rescue>  boot

Moving Dir
*.mod files back to the /boot/grub dir

busybox>  cd /boot
busybox>  mv mod/* grub
busybox>  reboot

Grub Boot Loader Screen
grub rescue>  set boot=(hd0,msdos5)
grub rescue>  set prefix=(hd0,msdos5)/boot/grub
grub rescue>  insmod normal
grub rescue>  normal

After booting into Ubuntu
sudo grub-install /dev/sda

Web Control Panel for ContOS

Web Control Panel
Its a CentOS Web Control Panel (Setups Server for Web Hosting) for Server’s, it will access SSH Access, Server Services & Apache Settings So On !!

Apache Web Server (Mod Security + OWASP rules optional)
PHP 5.4 (suPHP, SuExec + PHP version switcher)
MySQL + phpMyAdmin
Postfix + Dovecot + roundcube webmail (Antivirus, Spamassassin optional)
CSF Firewall
File System Lock (no more website hacking, all your files are locked from changes)
Backups (optional)
AutoFixer for server configuration

System Requirements
Possible to work with CentOS 5 but not fully tested, CentOS 7 is NOT supported for now!
Clean Updated Installation required without MySQL.
32bit Server – 512MB RAM
64bit Server – 1024MB RAM
HDD – 10 GB