Showing posts with label How to. Show all posts
Showing posts with label How to. Show all posts

Saturday, 6 October 2012

linux boot order


  • Bios check the system and launch the first stage boot loader on the MBR of the primary   hard disk

  • First stage boot loader itself into memory and launch the second stage boot loader from boot partition


  • The second stage boot loader   load the kernel into memory, which in turn load any modules& mount root partition, read only

  • The kernel transfer control of the boot process to the /sbin/init program

  • /sbin/init program load all service and user interface tool and mount all partition listed in /etc/fstab

  • The user is presented with a login screen for freshly booted Linux system
                                                               
                                                                   System boot sequence

      • Grub stage one load MBR

      • Second stage  /boot/grub/stage1.5 (boot partition higher 1024 cylinder) 2

      • /boot/grub/grub.conf  ----- see selection os menu

      •  /boot/vmlinux.2.6.18-5.elxen load to ram

      • initrd block device load (scsi)

      • /etc/rc.d/rc.sysinit

      • /etc/sysconfig/clock

      • /etc/rc.serial

      • /etc/inittab

      • init – run level 5

      • /etc/inittab run script called /etc/X11/prefdm (X display manger)

      • /etc/X11

      • gdm,kdm or xdm
      • Depending on the content of the /etc/sysconfig/desktop file

      • /usr/X11R6/bin/xorg

      • /usr/X116/lib/modules

      • /etc/X11

      • /etc/X11/xorg.conf




Tuesday, 11 September 2012

Webcam software for linux


Cheese, webcam software for linux allows you to record videos, photos with fun graphics. You can install the software either using ubuntu software center or using command line. This guide explains you how to install cheese on your ubuntu linux.
Open your terminal and login as root user

#apt-get install cheese
If you are using rpm based distribution, use this command
#yum install cheese
The prompt will ask you to install the package with some dependencies, press “Y” to continue. Now it will download packages from the repository and install it in your host.
After installation over you can start the application by using the command cheese
In your terminal type
$ cheese &
You can also launch it using GNOME panel click Applications>Accessories>Cheese

How to change the Apache HTTP port number


The default apache HTTP Listen port number is 80. If you want to change this port, you need to edit the httpd.conf file.
If you have installed apache http server from source code, then the default installation path is/usr /local/apache2 or if you have installed it  using repository then the apache configuration file httpd.conf is located under /etc . ie /etc/httpd.conf
Open the httpd.conf file
vim /usr/local/apache2/conf/httpd.conf
Listen 80
Change the port number to your desired port number from 80
Listen <Your_port_number>  
For example  i here changed the port number from 80 to 8081
Listen 8081
Check your firewall settings and ensure that your desired port number is opened.
After changing the port number restart the apache server
You can restart it by using one of the following way
/usr/local/apache2/bin/apachectl -k restart
service httpd restart
/etc/init.d/httpd restart
service apache2 restart
/etc/init.d/apache2 restart
Now fireup your browser with http://localhost:8081 or http://127.0.0.1:8081

How to check cpu information in linux



We can get all the CPU information by viewing the file /proc/cpuinfo. It contains number of processors, vendor id, cpu family, model, model name, cpu MHz, cache memory information etc.,
KrishnanHari ~ # cat /proc/cpuinfo

How to install and configure Apache web server in linux step by step guide and implementation


Apache web sever is the leading open source internet web server. Several key factors have contributed to Apache’s success:
  • The Apache license. It is an open sourceBSD−like license that allows for both commercial and non−commercial uses of Apache.
  • Talented community of developers with a variety of backgrounds and an open development process based on technical merits.
  • Modular architecture. Apache users can easily add functionality or tailor Apache to their specific enviroment.
  • Portable: Apache runs on nearly all flavors of Unix (and Linux), Windows, BeOs, mainframes
  • Robustness and security.
Many commercial vendors have adopted Apache−based solutions for their products, including Oracle, Red Hat and IBM. In addition, Covalent provides add−on modules and 24×7 support for Apache.
How to setup a Apache webserver
This article guides you how to set up a apache web server in Linux operating system (redhat, fedora distributions). Open terminal in root user mode and check whether httpd is installed. If it is already installed leave it, else installs it from the repository using yum. In case you don’t have yum configuration, configure it. After configuration of the yum follow the below procedure.
To Check whether httpd is installed
# rpm –qa | grep httpd
To install httpd
#yum install httpd
After installation of the httpd package , open its configuration file which is located at/etc/httpd/http.conf . Before editing the configuration file make a backup of the file and save it in an another directory.
Now open the file by using vi editor ( you can use any other type of editors )
#vi /etc/httpd/http.conf
Use :set number command to set the line number to the file. It increases the readability of the file.
search the line which contains “ Listen 80 ” and change it to “ Listen “your system ip address “ :80 “ after that save and quit the file by using Esc + :wq command.
Now restart the httpd service by using the following command. It restarts the service temporarily upto system is turned on
#service httpd restart.
If you want to turn on the service always, use the chkconfig configure apache to start at boot
# chkconfig httpd on
Use the httpd init script in the /etc/init.d directory to start/stop/restart apache after booting
# /etc/init.d/httpd  start
#/etc/init.d/httpd  stop
#/etc/init.d/httpd  restart
You can also test whether the Apache process is running with the following command; you should get a response of plain old process ID numbers
# pgrep httpd
Open the firewall and enable the http services. To open firewall use setup command
# setup
Now point out the browser to http://domainname or else http://ipaddress
In the browser a test page will be displayed like the below figure.
In case if the message is not displayed once again check the firewall and SE linux ( services )
Restart  the network service
# service network restart
#chkconfig network on
Restart httpd service
# service httpd restart
#chkconfig httpd on
The public directory is located at /var/www
Create a test html file and check it whether it is working or not
# vi /var/www/test.html &
test.html
<html>
<head>
<title>  HTTP web server </title>
</head>
<body>
<h1>  The web server is running successfully </h1>
</body>
</html>
open a browser and point out to http://ipaddress/test.html

Friday, 31 August 2012

Raid partition step by step


Redundant Array of Independent Disks (RAID) is a series of disks that can save your data even if a terrible failure occurs on one of the disks. While some versions of RAID make complete copies of your data, others use the so-called parity bit to allow your computer to rebuild the data on lost disks
RAID allows an administrator to form an array of several hard drives into one logical drive recognized as one drive by the operating system. It also spreads the data stored over the array of drives to decrease disk access time and accomplish data redundancy. The data redundancy can be used to recover data should one of the hard drives in the array crash.

RAID level 0, or striping,

Means that data is written across all hard drives in the array to accomplish the fast disk performance. No redundancy is used, so the size of the logical RAID drive is equal to the size of all the hard drives in the array. Because there is no redundancy, recovering data from a hard drive crash is not possible through RAID.

RAID level 1, or mirroring,

Means that all data is written to each disk in the array, accomplishing redundancy. The data is “mirrored” on a second drive. This allows for easy recovery should a disk fail. However, it does mean that, for example, if there are two disks in the array, the size for the logical disk is size of the smaller of the two disks because data must be mirrored to the second disk.

RAID level 5

Combines striping and parity. Data is written across all disks as in RAID 0, but parity data is also written to one of the disks. Should a hard drive failure occur, this parity data can be used to recover the data from the failed drive, including while the data is being accessed and the drive is still missing from the array.

RAID level 6

Data is written across all disks as in RAID 5, but two sets of parity data is calculated. Performance is slightly worse than RAID 5 because the extra parity data must be calculated and written to disk. RAID 5 allows for recovery using the parity data if only one drive in the array fails. Because of the dual parity, RAID 6 allows for recovery from the failure of up to two drives in the array.
In real life we never create raid on same hard disk. But its exam and examiner is not going to provide you three spare hard disk so you should be able to create three raid partition on same physical hard disk.
To create raid partition we will use fdisk utility.
Execute fdisk command with -l switch it will show your hard disks mount point
#fdisk -l 
now use fdisk commands with proper hard disk options. I am using /dev/sda as you can see in image my hard disk is mounted on /dev/sda. you should the proper hard disk whatever you receive in the output of this commands for example it could be hdd sdb
#fdisk /dev/sda 
now create a new partition and assign file type to raid
Command (m for help)n
First cylinder (1543-2610, deaults 1543):
press enter Using deafults value 1543 Last cylender ..............): +100M
linux fdisk commmad create new raid partitions
Now create two more partition repeating the same process don't forget to save with w commands.
linux raid partitions
Inform kernel about this change by partprobe commands and verify with fdisk -l commands

fdisk -l linux commands
Okey now you have 3 raid partitions and Linux will treat these partition same as three physical hard disks. You can create raid device with these partitions
Create raid 5 device with these partitions
create raid devices
Now format this newly created md0 raid device
mke2fs linux commands
To use this device you must have specify mount point. we are going to use this raid device on /data directory. So create a /data directory and mount md0 on it
mount Linux commands
This way will mount temporary. To permanently mount make its entry in /etc/fstab file
fstab Linux files
At this point you have successfully created a raid device md0 and permanently mounted it on /data. In our next article I will show you that how can you add new hard disk in raid device and remove faulty media from raid devices.


 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes