osslab.doc

Embed Size (px)

Citation preview

Ex.No:1Date:

KERNEL CONFIGURATION

AIM:To install and configure the kernel in linuxplatform.

STEPS TO INSTALL KERNAL:STPE 1:First check current working kernel version.

[fosslab@fosslab]$uname r

2.6.35.6-45.fc14.i686STEP 2:Download latest kernel from www.kernel.org.

STEP 3:login to root user.

[fosslab@fosslab]$su Password: [root@fosslab]#STEP 4:Extract the kernel source code.

[root@fosslab]#tar zxvf linux-2.6.39.2.tar.gz

STEP 5: change the directory to kernel source.

[root@fosslab]#cd linux-2.6.39.2

STEP 6: open the make file.

[root@fosslab linux-2.6.39.2]#vi makefile

Look fourth line it will be in following format.

EXTRAVERSION= .2

Now you can add mykernel at end of this line like this

EXTRAVERSION= .2-mykernel

Save and exit the file.

STEP 7: now make menu configuration.

[root@fosslab linux-2.6.39.2]#make menuconfig

Now following window is display to you.

Use down arrow to select File system ---> Then the following window is display to you.

Use down arrow to select DOS/FAT/NT File systems ---> Now following window is display to you.

Use down arrow and Tab to select NTFS file system support.

Now extra two sub option is displayed to you, like this

Use Tab to select NTFS write support. Exit and save the kernel configuration.

STEP 8: now make bzImage file. This will take few minutes.

[root@fosslab linux-2.6.39.2]#make bzImage

STEP 9: Now copy this bzimage to /boot/vmlinuz-2.6.39.2-mykernel.

[root@fosslab linux-2.6.39.2]#cp arch/x86/boot/bzImage/boot/vmlinuz-2.6.39.2-mykernelSTEP 10: make modules. This will take few minutes.

[root@fosslab linux-2.6.39.2]#make modules

STEP 11: Now install the modules.

[root@fosslab linux-2.6.39.2]#make modules_install

STEP 12: change the directory to boot.

[root@fosslab boot]#cd boot[root@fosslabboot]#chmod 755 vmlinuz-2.6.39.2-mykernelSTEP 13: change the directory to grub.

STEP 14:now open grub.conf file.

[root@fosslab grub]#vi grub.conf

Insert following lines at end of the grub.conf file. title Fedora (2.6.39.2-mykernel)

root (hd0,0)kernel /boot/rmlinuz-2.6.39.2-mykernel ro root=UUID=1427721c-c499-

445d-9653-45czd365bb9b rd_NO_LUKSrd_NO_LVMrd_NO_MDrd_NO_DM LANG=en_US.UTF-8

SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet initrd /boot/initramfs-2.6.39.2-mykernel.img

Now Save and exit the file.

STEP 15: reboot your system.

[root@fosslab grub]#reboot

STEP 16: Now check your current kernel version.

[fosslab@fosslab]$uname r

RESULT:Thus the kernel was successfully installed and configured.

Ex.No: 2Date:

VIRTUALIZATIONAIM:

Virtualisation environment (e.g., xen, kqemu or lguest) to test an

applications,new kernels and isolate applications.

STEPS FOR VIRTUALIZATION USING QEMU AND FREEDOS:STEP 1:Download the fdbasecd.iso from www.freedos.org (or) from fosslab server.

The following steps should be followed from the directory where fdbasecd.iso is stored.

STEP 2:create virtualdisk.

[fosslab@fosslab]$qemu-img create virtualdisk.img 100M

STEP 3: boot the disk.

[fosslab@fosslab]$qemu -hdavirtualdisk.img -cdrom fdbasecd.iso -boot d

Select 1to boot from CDROM

STEP 4:select 1 for Install to harddisk using FreeDOS SETUP(Default).

STEP 5:select language-English(US).

STEP 6:now select Run FreeDOS from CD-ROM(return to command prompt)

STEP 7:typefdisk in following window.

STEP 8:Enable Large disk support (Y).

STEP 9:select create DOS partition or logical DOS Driver.

STEP 10: select create primary DOS partition.

STEP 11:selectyes from following window.

STEP 12:primary DOS partition created.

RESULT:The virtual hard disk primary DOS partition is successfully created.

Ex.No: 3Date:

COMPILING FROM SOURCEAIM:

To Installing webattery for compiling from source.

STEPS FOR INSTALLING WEBATTERY:STEP 1:download webbattery from following link.

http://pkgs.org/contos-5-rhel-5/epel-i386/webattery-1.2-6.e15.src.rpm/download/STEP 2: Move downloaded file to /home/fosslab folder.

[fosslab@fosslab]$mv Downloads/webattery-1.2-6.e15.src.rpm /home/fosslabSTEP 3:change directory to /home/fosslab.

[fosslab@fosslab]$cd /home/fosslab

[fosslab@fosslab]$rpm ivh webatter-1.2-6.e15.src.rpm

The above command creates a directory rbmbuildunder the home folder /home/fosslab/

Example:/home/fosslab/rpmbuildSTEP 4:change directory.

[fosslab@fosslab]$cd /home/fosslab/rpmbuild/SOURCES/

STEP 5:Extract the source file using the command.

[fosslab@fosslab SOURCES]$tar zxvf webattery-1.2.tar.gz

STEP 6: now following steps are perform by root user.so,login to root user.

[fosslab@fosslab]$su Password: [root@fosslab]#STEP 7: change the directory.

[root@fosslab]#cd /home/fosslab/rpmbuild/SOURCES/

[root@fosslab SOURCES]#cd webattery-1.2/

STEP 8:check for the necessary tools/libraries for the build environment and creates the makefile.

[root@fosslab webattery-1.2]#./configure

STEP 9:compile all the source files and create the executable binaries using following command.

[root@fosslab webattery-1.2]#make

STEP 10: now install webattery.

[root@fosslab webattery-1.2]#make install

STEP 11: now verify webattery is installed or not.

[root@fosslab]#which webattery/usr/local/bin/webatteryRESULT:

The webattery is successfully installed in linux.

Ex.No: 4Date:

INSTALLING ZIP PACKAGES IN LINUXAIM:

To install the zip packages (JOOMLA) in linux platform.

STEPS FOR INSTALLING JOOMLA ZIP PACKAGE:STEP 1:First of all we need to make sure that php and mysql is install on our system included our webserver.

[fosslab@fosslab]$which phpmysqlhttpd/usr/local/bin/php/usr/bin/mysql/usr/sbin/httpdIf php or mysql or apache server is not installed you can install with following commands

[fosslab@fosslab]$sudo yum -y install httpdphpmysqlmysql- server php-mysqlSTEP 2: Now phpmysql and apache(httpd) server is installed next we need to download Joomla from its site.

[fosslab@fosslab]$wget http://joomlacode.org/gf/download/frsrelease/10785/42655/ Joomla_1.5.14-Stable-Full_Package.zipNow Next steps are to be performed by root user

STEP 3:login to root user

[fosslab@fosslab]$su Password: [root@fosslab]#STEP 4:Create a directory for install yourjoomla package.

[root@fosslab]#mkdir /var/www/html/mysite

STEP 5:Move downloaded file to new directorymysite.

[root@fosslab]#mv Downloads/ Joomla_1.5.14-Stable- Full_Package.zip/var/www/html/mysite/STEP 6:change the directory.

[root@fosslab]#cd /var/www/html/mysite

STEP 7:unzip the moved zip package.

[root@localhostmysite]#unzip Joomla_1.5.14-Stable- Full_Package.zipSTEP 8:Remove the zip file.

[root@localhostmysite]#rm Joomla_1.5.14-Stable- Full_Package.zipSTEP 9:create a configuration file and make it read and write able.

[root@localhostmysite]#vi configuration.php[root@localhostmysite]# chmod 666 configuration.php[root@localhostmysite]# firefox localhost/mysite&Now configuring joomla:STEP 10:open your browser and type localhost/mysite

Now start the installationSTEP 11:select your language.

Click next after selecting your language default is English.

STEP 12:Click next again its telling you your stats about your configuration.

STEP 13:accept the agreement statement.

Click nextfirst select database (Mysql) than tell your host name most probably your will be also localhostNext select username of mysql

server exampleroot and than entered the password of your databaseserver of root and last box is of database name example joomla.

STEP 14:select yes if you want FTP support on else select no it is off.

Now enter your site configurations such as site Name your Email address and your password for administrator Admin password.click next after filling site name , email , password and confirm password and now click next pop up will come click ok tocontinue.

STEP 15:Now delete one folder from following location.

/var/www/html/mysite/installation[root@fosslab]#sudorm r/var/www/html/mysite/installation/After you have deleted installation folder just type this url on your browser.

localhost/mysiteNow the following page is displayed on your browser.

get start working type following url on browser.

localhost/mysite/administrator

Enter user name as admin and password what you choosed during installation.

Here you are done with installation and configuration of Joomla andnow you can create manage your joomla site.

RESULT:The zip packages (JOOMLA) was successfully installed in linux operating system (fedora).

Ex.No: 5Date:

INSTALLING SAMBA AND CUPSAIM:

Installsamba and share files to windows. Install Common Unix Printing System(CUPS).

STEPS FOR INSTALLING SAMBA:STEP 1: Connect to your server on the shell and install the Samba packages.

[root@fosslab]#yum install cups-libs samba samba-common

STEP 2:Edit the smb.conf file.

[root@fosslab]#vi /etc/samba/smb.conf

Make sure the following lines in the [global] section.

[...]# ----------------------- Standalone Server Options ------------------------## security = the mode Samba runs in. This can be set to user,share# (deprecated), or server (deprecated).## passdb backend = the backend used to store user informationin.# New installations should use either tdbsam or ldapsam. No# additional configuration is required for tdbsam. The"smbpasswd" # utility is available for backwards# compatibility.#[...]

security = userpassdb backend = tdbsamThis enables Linux system users to log in to the Samba server.

STEP 3:create the system startup links for Samba and start it.

[root@fosslab]#chkconfig --levels 235 smb on /etc/init.d/smb startSTEP 4:Create the directory for sharing the files and change the group to the users group.

[root@fosslab]#mkdir -p /home/shares/allusers [root@fosslab]#chown -R root:users /home/shares/allusers/ [root@fosslab]#chmod -R ug+rwx,o+rx-w /home/shares/allusers/

At the end of the file /etc/samba/smb.conf add the followinglines.

[root@fosslab]#vi /etc/samba/smb.conf

[...] [allusers]comment = All Userspath = /home/shares/allusersvalid users = @users force group = users create mask = 0660 directory mask = 0771 writable = yesIf you want all users to be able to read and write to their home directories via Samba, add the following lines to

/etc/samba/smb.conf (make sure you comment out or remove the other [homes] section in thesmb.conf file!).

[...] [homes]comment = Home Directoriesbrowseable = no valid users = %S writable = yes create mask = 0700directory mask = 0700nowrestart Samba.

[root@fosslab]#/etc/init.d/smb restart STEP 5:Adding and managing users.

Add new user sarath into samba.[root@fosslab]#user add sarath -m -G users Set a password for sarath in the Linux system user database. [root@fosslab]#passwd sarath

-> Enter the password for user sarath.Now add the user sarath to the Samba user database.

[root@fosslab]#smb passwd a sarath

-> Enter the samba password for user sarath.

Now you should be able to log in from your Windows workstation with the file explorer (address is \\192.168.0.100 or

\\192.168.0.100\sarath for sarath's home directory) using theusername sarath and the chosen password and store files on the Linux server either in tom's home directory or in the public shared directory.

STEPS FOR INSTALLING CPUS(PRINTING SYSTEM):STEP 1:Open your web browser and type http://localhost:631/ Then the following screen is displayed to you.

STEP 2:select Adding Printers and Classes form CUPS for Administrators.

STEP 3:now select Add printer from Printers.

STEP 4:select serial port #1 from Add printers.

STEP 5:click continue.

STEP 6:Now fill printer name, description, location and click continue.

The CUPS is successfully installed on your computer.

RESULT:Thus the SAMBA and CUPS was successfully installed.

Ex.No: 6Date:

USERSPACE DRIVER USING FUSEAIM:

To write userspace driver using FUSE.

STEPS TO INSTALL FUSE:STEP 1: check whether FUSE development package is installed on your computer or not.

[fosslab@fosslab]$rpm qa | grep fuseSTEP 2: if FUSE is installed in your computer then check it is possible to implement a fully functional file system in a userspace program or not.

[fosslab@fosslab]$rpm qi fuse STEP 3:Now download fuse from web. STEP 4:Extract the downloaded file.

STEP 5:change directory to fuse source directory.[fosslab@fosslab]$cd Downloads [fosslab@fosslab Downloads]$cd fuse-tutorial [fosslab@fosslab fuse-tutorial]$cd srcSTEP 6: package configuration.

[fosslab@fosslab src]$pkgconfig fuse cflags

_D_FILE_OFFSET_BITS=64 I/usr/include/fuse

[fosslab@fosslab src]$pkg-config fuse libs

-pthread L/lib64 lfuse lrt ldl

[fosslab@fosslab src]$make

STEP 7: change directory to example. [fosslab@fosslab src]$cd ../example/ [fosslab@fosslab example]$cd rootdir [fosslab@fosslab rootdir]$touch myfile [fosslab@fosslab rootdir]$mkdir fusetest [fosslab@fosslab rootdir]$mkdir fusefile [fosslab@fosslab rootdir]$touch fusefile [fosslab@fosslab rootdir]$cd ..STEP 8: now you are currently in example directory.[fosslab@fosslab example]$ls lTotal 36 files.

[fosslab@fosslab example]$ls l mountdir/Total 0 file.

[fosslab@fosslab example]$ls l rootdir/Total 12 files.

[fosslab@fosslab example]$../src/bbfs rootdir/ mountdir/ [fosslab@fosslab example]$ls l mountdir/Total 12 files.[fosslab@fosslab example]$mount [fosslab@fosslab example]$ls l mountdir/ [fosslab@fosslab example]$fusemount u mountdir [fosslab@fosslab example]$ls l mountdir/ [fosslab@fosslab example]$mount[fosslab@fosslab example]$ls l rootdir/Total 12 files.

[fosslab@fosslab example]$ls l mountdir/ [fosslab@fosslab example]$tail f bbfs.logRESULT:Thus the userspace driver using FUSE was successfully executed.Ex.No: 7Date:

GUI PROGRAMMINGAIM:

To create a simple GUI programs using gambas.

STEPS FOR CREATING SIMPLE PROGRAMMING: STEP 1: open a terminal and login to root user.

[fosslab@fosslab]$su Password: [root@fosslab]#STEP 2:Now run the gambas.

[root@fosslab]#gambas

Now following window is displayed to you.select new project from this window.

Click Next.

STEP 3:now select the type of the project.

Select create a graphical project and click next.

STEP 4: now select project title and name.

Click next.

STEP 5:now right click forms form following window then select new

FORM.

DRAW A LINE.STEP 6:create a simple form for draw a line. Select button from tool box and draw it in form. select drawing area from toolbox and draw

it in form like this.

STEP 7:Double click button1 and type following code.

PUBLIC SUB Button1_Click() Draw.Begin(DrawingArea1) Draw.Line(1, 130, 500, 400) Draw.End

ENDSTEP 8:Now run the form and click button1 then the output is displayed like this.

MOUSE TRACKING:STEP 6:create a simple form for mouse tracking. Select two textboxes from tool box and draw it in form. select drawing area from toolbox and draw it in form.

STEP 7:Double click the drawing area and type the following codes.

PUBLIC SUB Form1_MouseMove() Textbox1.text = Mouse.X Textbox2.text = Mouse.Y

ENDSTEP 8:now click mouse pointer in out of drawing area the output is displayed like this.

RESULT:The simple GUI program was successfully created and executed.

Ex.No:8Date:

VERSION CONTROL SYSTEMAIM:

To setup version control system using RCS, CVS, SVN.

STEP TO INSTALL SUBVERSION EDGE:STEP 1: First you will check subversion is installed on your computer or not.

[fosslab@fosslab]$rpm qa | grep subversion

STEP 2: next you will check JAVA /JRE has to installed along with apache web server or not for subversion edge installation.

[fosslab@fosslab]$rpm qa | grep java STEP 3: Now, download the collabnet subversion edge software

from web.STEP 4:Extract the downloaded file.it will create csvn folder.

STEP 5: login to root user. [fosslab@fosslab]$su Password: [root@fosslab]#STEP 6: open the sudo file.[root@fosslab]#vi sudo

Add a new line under defaults secure-path.

fosslab ALL=(ALL) ALL

it is used to allow fosslab user to run any commands any ware.

STEP 7: save the sudo file and exit the terminal.

STEP 8: open new terminal and set the JAVA_HOME environment variable and point it to your JAVA / JRE home.

[fosslab@fosslab]$export JAVA_HOME=/usr/

Test the variable.

[fosslab@fosslab]$$JAVA_HOME/bin java version STEP 9: change the directory to subversion edge source file.

[fosslab@fosslab]$cd csvn

STEP 10: now install the subversion edge.

[fosslab@fosslab]$sudo E bin/csvn install STEP 11: start the csvn.

[fosslab@fosslab]$bin/csvn start

STEP 12: start the csvnconsule.

[fosslab@fosslab]$bin/csvn console

Then the csvn console url is show to you copy this url and past it into your web browser. Then the following page is display to you.

STEP 13:login to collabnet subversion edge.

Note: User name and password is admin.

Now click Administrator tab then the following page is display to you.

Now fill port address, Administrator and Administrator Email. Click save button.

STEP 14:now click Status tab then the following page is display toyou.

Click start button.

It will show the message subversion server is running. Like this

RESULT:Thus the version control system was successfully installed.

Ex.No:Date:

CREATING DATABASE IN MySQLAIM:

To create a database in MySQL.

STEPS FOR DATABASE CREATION:STEP 1:login to the MySQL database.

STEP 2: create a new database called as college.

STEP 3: create one table (Student) in python database.

STEP 4:Insert some data into student table.

STEP 5:Display the student table.

DATABASE CREATION: Mysql>CREATE DATABASE college; Mysql>USE college;

Mysql>CREATE TABLE student(ID varchar(5),NAME varchar(20),DEPTvarchar(10));

Mysql>INSERT INTO student(ID,NAME,DEPT) VALUES(1,sarath,CSE); Mysql>INSERT INTO student(ID,NAME,DEPT) VALUES(2,kumar,CSE); Mysql>INSERT INTO student(ID,NAME,DEPT) VALUES(3,selva,CSE); Mysql>INSERT INTO student(ID,NAME,DEPT) VALUES(4,karthik,CSE);

Mysql>SELECT *FROM student;

----------------------------------------

| ID | NAME | DEPT || 1 | sarath | CSE |

| 2 | kumar | CSE |

| 3 | selva | CSE |

| 2 | karthik | CSE |

---------------------------------------

RESULT:The college database is successfully created in MySQL database.

Ex.No: 9Date:

MYSQL /DATABASE ACCESS PROGRAM USING perl

AIM:To fetch the data from MySQL database using perl language in

Linux platform. Databaseconnection.pl use DBI;

my$dbh=DBI->connect('DBI:mysql:database=college;host=localhost','root','admin123');my $query='select * from student ';my $sth=$dbh->prepare($query) or die "could not prepare $query\n";

$sth->execute();

while (($id,$name,$age)=$sth->fetchrow_array())

{

print "ID=$ID Name=$NAMEDept=$DEPT\n";

}

$sth->finish();

$dbh->disconnect()

OUTPUT:[root@fosslab]#Perl Databaseconnection.plID=1 Name=sarath Dept=CSE ID=2 Name=kumar Dept=CSE ID=3 Name=selva Dept=CSE ID=4 Name=karthik Dept=CSE [root@fosslab]#RESULT:Thus the above program for MySQL database connection was successfully executed.

Ex.No: 10Date:

RANDOM NUMBER GENERATION USING PHP

AIM:To write a simple program for generating random numbers in web page using PHP.

input.html

Range starting

Range end