You are on page 1of 37

R.V.S.

EDUCATIONAL TRUSTS GROUP OF INSTITUTIONS


RVS SCHOOL OF ENGINEERING & TECHNOLOGY
RVS Nagar, Dindigul !"#$$% P&'n(. N'.) $#%%* ""+"",,-$,-*&-+ Fa. N'.) $#%%* ""+"",,-$,-*&-+ website : http://rvsetgidgl.ac.in e-mail: directorrvsetgi@rvsgroup.com

DEPARTMENT OF COMPUTER AND ENGINEERING NAME BRANCH SUBJECT CODE : S.Karthik : ECE : 10144ECE33 YEAR SEM SUBJECT NAME : IV : VII : High Speed Networks

LAB MANUAL

EX.NO:1 LINUX INSTALLATION DATE: AIM : To install linu operating s!ste". Steps Inv !ve": Steps in#ol#ed in $%untu installation Step 1: The &irst thing !ou should do is head to http'((www.u%untu.)o"(download( u%untu(download and download $%untu 11.10 *i#eC+. ,ust )li)k the %ig orange Start download %o . Step #: $sing !our dis) %urning so&tware- %urn the .iso !ou downloaded to a C+. Step $: .e&ore !ou go an! &urther- ensure all i"portant data is %a)ked up in )ase o& data loss on !our dri#es. This guide assu"es !ou ha#e "edia %a)kups o& !our /indows partitioned hard dri#e and !ou are sa&e to pro)eed. Step %: Ensure !ou ha#e a network )a%le )onne)ted- restart !our )o"puter- and %oot &ro" the C+ dri#e. Step &: The *i#eC+ will load up- and !ou0ll %e presented %! the &ollowing %o '

1or the purposes o& this guide- we will assu"e !ou0#e alread! tried $%untu and want to pro)eed with an installation- so )li)k 2Install $%untu.2 Step ': 3ou0ll %e greeted %! the 24reparing to install $%untu2 s)reen- e a)tl! as %elow' I re)o""end !ou sele)t 2Install third5part! so&tware2 as I ha#e done in the s)reenshot a%o#e. I pre&er to do s!ste" updates on)e up and running- %ut i& !ou ha#e the e tra ti"e !ou )an also sele)t 2download updates while installing2 as well. Then )li)k )ontinue. 2

Step (: The ne t s)reen !ou will see is 2installation t!pe-2 what !ou see will %e dependent on whether !ou ha#e an e isting /indows installation or not. I0" going to split this into three di&&erent su%5steps- to "ake it as si"ple as possi%le. Step ()A: 1or those installing in a #irtual "a)hine or to hard disks without an 6S !ou will see the &ollowing s)reen' 3ou ha#e two )hoi)es' 1. Erase the entire disk and use all o& it &or installation 55 $%untu will auto"ati)all! partition !our disk and pro)eed with installation. 7. Sele)t 2so"ething else2 and "anuall! )reate !our partitions 8whi)h is )o#ered in detail in step 95C:. I& !ou are )hoosing the &irst option- sele)t the radio %utton and then )li)k )ontinue- pro)eeding to step ;. Step ()B: Those o& !ou that ha#e )urrent /indows installations or are going to dual5%oot with another e isting 6S will %e presented with a s)reen si"ilar to %elow' 3ou ha#e three options a#aila%le' 1. 3ou )an )hoose the &irst option and install $%untu alongside !our e isting 6S. 7. 3ou )an opt to repla)e !our /indows installation with $%untu- allowing the installer to &or"at !our )urrent partitions and auto"ati)all! )reate new ones &or *inu . 3. 3ou )an )hoose 2so"ething else2 and )reate !our own partition s)he"e and si<ing 8)o#ered in detail in step 95C:. 6n)e !ou ha#e sele)ted whi)h route !ou wish to pro)eed with )li)k )ontinue and pro)eed to step ;. Step ()C: Ha#ing sele)ted the 2so"ething else2 option !ou will %e presented with the &ollowing window' *inu re)ogni<es and assigns I+s to dri#e in a di&&erent "anner to /indows. In the a%o#e i"age- !ou )an )learl! see "! hard disk in the list. It is identi&ied %! 2(de#(sda.2 *inu re)ogni<es dri#es in the &ollowing wa!' = Sda > 1st dri#e = Sd% > 7nd dri#e = Sd) > 3rd dri#e and so on 4artitions are also shown a&ter the dri#e letters. So i& I had 7 partitions on "! &irst disk- the! would %e identi&ied as' = Sda1 ? 1st dri#e- 1st partition = Sda7 ? 1st dri#e- 7nd partition 3ou will not see the )o""on /indows C' la%el in the disk "enu in the a%o#e list. 3ou do- howe#er- ha#e ke! things to help !ou re)ogni<e !our /indows C' dri#e. .oth o& these )an %e used to identi&! whi)h is !our /indows disk. = The si<e o& the disk is shown = The na"e o& the dri#e is shown 3

This is !our )urrent partition la!out &or !our hard disks. I& !ou ha#e "ore than one disk- the! will show up as (de#(sda- (de#(sd% et). 1irstl!- identi&! !our /indows installation. In "! )ase- it0s sda1 8whi)h is "! &irst hard disk- &irst partition:. /hat !ou see depends on how !ou )reated the e tra spa)e. I @ust resi<ed the /indows partition &ro" within /indows- and le&t the &ree spa)e read! to install *inu . I re)o""end using /indows or a &ree utilit! &ro" within /indows to resi<e !our partition as "ost %eginners will understand it "ore. There&ore- we now need )reate a "ini"u" o& two partitions' Cli)k 2Add2 and the &ollowing %o will appear' 3ou will noti)e I ha#e alread! &illed out the e a"ple a%o#e to )reate a 10B. root partition. 3ou )an ha#e a "a i"u" o& 4 pri"ar! partitions- or 3 pri"ar! partitions and 1 logi)al 8whi)h allows &or another C4 partitions: The si<e a%o#e is 10.00B.. e.g 1-000 > 1B. 10-000 > 10B. 8De"e"%er to lea#e enough &ree re"aining spa)e to )reate !our S/A4 partitionE: *o)ation &or new partition' e.g. do !ou want it at the start or end o& the &ree spa)e. Sele)t %eginning. $se as' E t4 is the re)o""ended &ile s!ste" &or $%untu- "u)h the sa"e as NT1S is /indows. S/A4 is &or S/A4 spa)e. Fount point' This is where !ou want the partition to "ount. E.g. we need a root partition- whi)h in *inu is denoted %! a 2(2. Cli)k 6K on)e !ou ha#e &inished setting the partition in&or"ation and !ou will return to !our partition s)reen- now showing the root partition !ou @ust )reated. $sing the sa"e "ethods as %e&ore- )reate a S/A4 partition. I re)o""end !ou set the si<e o& !our S/A4 partition to at least the si<e o& !our a#aila%le DAF. I& !ou ha#e plent! o& hard disk )apa)it! I would suggest !ou use dou%le the si<e. So i& !ou ha#e 7B. o& DAFset it to either 7B. or 4B.. 1or %est per&or"an)e it is re)o""ended !ou ha#e !our S/A4 partition at the %eginning or end o& !our dri#e. 6n)e !ou ha#e done that- !ou should %e looking at so"ething like %elow. So to re5)ap the a%o#e- 8in "! e a"ple: we ha#e the &ollowing' = (de#(sda1 is !our /indows partition. = (de#(sda7 is !our new root partition 8/indows eGui#. o& C = (de#(sda3 is !our S/A4 spa)e.

6n)e !ou are happ! with the )hanges !ou ha#e "ade- )li)k install now and pro)eed to the ne t step. Step *: As the installation starts to )op! the reGuired &iles to the hard disk- !ou will %e presented with a s)reen to sele)t !our lo)ale. It should auto"ati)all! &ind where !ou are- as it has &or "e alread!' ,ust dou%le )he)k it is )orre)t- and then sele)t )ontinue. Step +:The ne t s)reen to appear will %e ke!%oard la!out' Ensure the )orre)t option is sele)ted- a%o#e !ou will see the )orre)t 8and de&ault $K: sele)tion has %een 4

auto"ati)all! "ade &or "e. Step 1,:3ou will now %e greeted %! the 2who are !ou2 s)reen- read! &or !ou to &ill out with !our user details'The o"puters na"e and userna"e will auto"ati)all! populate when !ou t!pe !our &ull na"e. 3ou )an howe#er edit the" as !ou please. 1ill in the details and then )li)k )ontinue. 3ou )an opt to ha#e $%untu auto"ati)all! log in &or !ou 55 e#en with a password set 55 or !ou )an )hoose the traditional option reGuiring a password to log in. 3ou reall! don0t need to )hoose the en)r!pt option unless !ou0re installing on a laptop and are dealing with highl! se)ure in&or"ation. Step 11: The installation in&or"ation s)reens will now appear as $%untu )ontinues the installation' Step 1#: 6n)e installation has &inished- !ou will %e presented with the &ollowing %o ' Sele)t 2restart now2 and when reGuested- re"o#e !our installation C+- then press enter to re%oot. >>>>>>HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH>>>>>> EX.NO:# M-S.L INSTALLATION DATE: AIM : To 4er&or" F!sGl Intallation 6n *inu 6perating S!ste" INSTALLATION PROCESS: IrootJser#er rootKL )d (root IrootJser#er rootKL "kdir (root(&iles (data (data("!sGl IrootJser#er rootKL )d &iles IrootJser#er rootKL wget http'((www.dM .net(downloads(uni ("!sGl5 4.0.17.tar.g< IrootJser#er rootKL tar <#& "!sGl54.0.17.tar.g< IrootJser#er rootKL )d "!sGl54.0.17 i& !our using 1ree.S+ use 2adduser2 instead o& 2useradd2. IrootJser#er rootKL groupadd "!sGl IrootJser#er rootKL useradd 5g "!sGl "!sGl IrootJser#er rootKL .()on&igure 55pre&i >(usr(lo)al("!sGl55datadir>(data("!sGl +ata+ir is where !our "!sGl data%ases will %e stored in)luding the data%ase whi)h )ontains all "!sGl user a))ounts- !ou )an easil! %a)kup all data%ases(users %! sa#ing the )ontents o& this &older. (data("!sGl i& !ou get a 2"odNauthNd%"2 Error Cop! the nd%".h &ile &ro" (usr(in)lude to the (usr(in)lude(d%1 dire)tor! 8or install %15de#el: i& !ou get a 2no a))epta%le C )o"piler &ound in O4ATH2 Error Install a ) )o"piler- e a"ple'g)) i& !ou get 2li%"!sGl.)'134M' warning' passing arg P o& Qgethost%!na"eNr0 &ro" in)o"pati%le pointer t!pe2 Error !ou need to install a )HH )o"piler- install' li%std)HH5de#el- g))5)HH 8sa"e #ersion as g)): IrootJser#er rootKL "ake IrootJser#er rootKL "ake install IrootJser#er rootKL .(s)ripts("!sGlNinstallNd% IrootJser#er rootKL ln 5s (usr(lo)al("!sGl(share("!sGl("!sGl.ser#er(s%in("!sGld IrootJser#er rootKL )hown 5D "!sGl'"!sGl (data("!sGl IrootJser#er rootKL )hown 5D "!sGl'"!sGl (usr(lo)al("!sGl START/ STOP 0 RESTART S.L: IrootJser#er rootKL "!sGld start IrootJser#er 5

rootKL "!sGld stop IrootJser#er rootKL "!sGld restart USING MYS.L: EXPORT DATABASE IrootJser#errootKL(usr(lo)al("!sGl(%in("!sGldu"p5uroot5pdata%aseNna"eR data%aseNna"e.sGl IMPORT DATABASE IrootJser#er rootKL(usr(lo)al("!sGl(%in("!sGl 5u root 5p data%aseNna"e Sdata%aseNna"e.sGl SET ROOT PASS1ORD IrootJser#er rootKL (usr(lo)al("!sGl(%in("!sGlad"in 5u root 5p password NE/N4ASS NOTE: /hen it pro"pts !ou to enter the password- @ust hit Enter i& !ou don0t see an error- the password was su))ess&ull! )hanged. UNINSTALLING MYS.L: IrootJser#errootKLr"5r&(usr(lo)al("!sGl IrootJser#er rootKL r" 5r& (data("!sGl IrootJser#er rootKL r" 5r& (s%in("!sGld RESULT : Thus the F3ST* was su))ess&ull! installed on linu operating s!ste". EX.NO:$ APACHE INSTALLATION DATE: AIM : To per&or" Apa)he installation. INTRODUCTION: The Apa)he /e% ser#er is argua%l! the "ost popular /e% ser#er in use on the Internet toda!. Here are so"e o& the reasons wh! Apa)he is so popularU !ou don0t ha#e to %e running /indows to run Apa)he. It was de#eloped on #arious $ni (*inu (.S+ plat&or"s- and then re)entl! ported to /in37. Internet In&or"ation Ser#er- a /e% ser#er "ade %! Fi)roso&t &or the /indows NT plat&or"- is "ade &or use in the 2/indows5onl!2 world. /hile IIS has "an! &eatures- its la)k o& porta%ilit! li"its itVs "arket share. I& !ou0re hosting a prett! plain /e% site with "ostl! stati) )ontent- Apa)he is a &ire%all. I& !ou throw tons o& CBI s)ripts at it- while "aking data%ase )alls at the sa"e ti"e- !ou0re going to slow it down. Though "u)h o& the slowdown will )o"e &ro" !our s)ripts the"sel#es- and not &ro" Apa)he. Apa)he e#ol#ed out o& the NCSA https pro@e)t to its )urrent status as one o& the &astest- "ost e&&i)ient- and "ost &un)tional we% ser#ers in e isten)e toda!. Apa)he has %een shown to %e su%stantiall! &aster- "ore sta%le- and "ore &eature5&ull than "an! other we% ser#ers. Although )ertain )o""er)ial ser#ers ha#e )lai"ed to surpass Apa)he0s speed. The de#elopers o& Apa)he &eel that it is %etter to ha#e a "ostl!5&ast &ree ser#er than an e tre"el! &ast ser#er that )osts thousands o& dollars. Apa)he is run on sites that get "illions o& hits per da!- and the! ha#e e perien)ed no per&or"an)e di&&i)ulties. Apa)he is run on o#er 10 "illion Internet ser#ers 8as o& Fa! 7007:. It has %een tested thoroughl! %! %oth de#elopers and users. The Apa)he Broup "aintains rigorous standards %e&ore releasing new #ersions o& their ser#er- and their ser#er runs without pro%le"s on o#er one hal& o& all /// ser#ers a#aila%le on the Internet. /hen %ugs do show up- the! release pat)hes and new #ersions as soon as the! are a#aila%le. INSTALLATION OPTIONS: IVll )o#er three "ethods o& installing Apa)he under *inu . The three "ethods are' .inar! installation $sing an D4F 8Ded Hat 4a)kage Fanager: ? re)o""ended &or people running Ded Hat *inu .uilding &ro" sour)e APACHE INSTALLATION GUIDE: 6

/e re)o""end using the D4F installation "ethod. This is the easiest wa! to install Apa)he &or people that are new to *inu . DO1NLOAD THE SOFT1ARE: 3ou )an download Apa)he &ro" the Apa)he So&tware 1oundation we% site lo)ated at 2ttp:33444.5p562e. 78- in sour)e and %inar! &or"s. /hile !our downloading Apa)he- !ou "a! want to %rowse o#er the do)u"entation. 1HAT YOU NEED: To install Apa)he- !ou will need the &ollowing things' 1. A )o"puter running *inu 7. Doot a))ess on this )o"puter 3. 1or %inar! and sour)e installations- the tar and gun<ip $ni utilities BINARY INSTALLATION: A %inar! is pre5)on&igured- whi)h "eans so"eone else has gone to the trou%le o& )on&iguring and %uilding the so&tware &or !ou. There are- howe#er- a &ew things !ou should keep in "ind' .inaries are )o"piled &or a parti)ular operating s!ste". In other words- !ou "ust use a %inar! %uilt spe)i&i)all! &or 1ree.S+ on !our 1ree.S+ "a)hine and a *inu %inar! on !our *inu "a)hine. 3ou need to %e sure to gra% the )orre)t %inar!U i& !ou don0t see a %inar! &or !our parti)ular operating s!ste"- !ou "ust )hoose a di&&erent "ethod o& installation. Apa)he %inaries are usuall! a #ersion or two %ehind the )urrent sour)e distri%ution. his "eans !ou don0t reap the %ene&its o& the latest %ug &i es and &eature nhan)e"ents. .e)ause %inaries are pre5)on&igured- !ou don0t ha#e "u)h opportunit! to alter the wa! the so&tware works. I& !ou0re a new)o"er- !ou "a! not )are a%out this loss o& &le i%ilit!. 1ortunatel! "ost Apa)he %inaries in)lude a &ull sour)e distri%ution- pro#iding !ou with the %est o& %oth worlds 55 pla! now- learn later. Now let0s install a %inar!. 4oint !our %rowser at 2ttp:33444.5p562e. 783"9st32ttp"3:9n579es3 +ownload the %inar! &or !our operating s!ste" 8in our )ase- *inu :. 3ou0ll "ost likel! %e presented with a dire)tor! )ontaining "ultiple #ersions o& Apa)he in #arious )o"pressed &or"s. 1or the purposes o& this guide- I0ll assu"e !ou0#e downloaded the g<ip0d &or" o& the latest 7.0. Apa)he %inar! 8)urrentl! that0s httpd57.0.3P5iC;C5p)5linu 5rh97.tar.g<:. I& there is a DEA+FE asso)iated with the &ile !ou0re downloading- !ou "a! want to re#iew it &or an! interesting installation tid%its or possi%le %ugs. I& !ou )an0t &ind a %inar! &or !our operating s!ste"- )hoose either the D4F Installation 8i& !ou are running Ded Hat *inu : or .uild &ro" Sour)e "ethod. Now let0s un)o"press the ar)hi#e using the hand! )o"%ination o&gun<ip and tar. 3ou should repla)e the ;2ttp")#.,.$&) 9'*')p6)!9n<=) 72(#.t57.8>; te t %elow with the na"e o& the g<ip0d &ile !ou downloaded. 8<n>9p ? 2ttp")#.,.$&)9'*')p6)!9n<=)72(#.t57.8> @ t57 =vA ? So"e o& !ou "a! %e lu)k! enough to ha#e a #ersion o& tar that is )apa%le o& taking )are o& %oth tasks. t57 =v>A 2ttp")#.,.$&)9'*')p6)!9n<=)72(#.t57.8> Either wa!- !ou should end up with an httpd57.0. dire)tor!- with x %eing the parti)ular su%#ersion o& Apa)he !ou downloaded. Fo#e into the newl! )reated dire)tor!. 6" 2ttp")#.,.= As o& Apa)he 1.3.11- %inar! distri%utions )ontain an install s)ript )alled install.%indist.sh. I& !our %inar! does not see" to )ontain su)h an install s)ript- take a look at the DEA+FE.%indist and(or INSTA**.%indist do)u"ents &or &urther in&or"ationU i& these do)u"ents don0t outline a si"ple installation "ethod- !ou0ll pro%a%l! want to use one o& the other "ethods I )o#er in this guide. I& !ou0#e not alread! done so- !ou0ll need to %e)o"e root. 3ou )an %e)o"e root %! t!ping suthen the root password. Then go ahead and run the install s)ript .39nst5!!.:9n"9st.s2 This )o""and should install the #arious %its o& the Apa)he distri%ution into the appropriate lo)ationsU the de&ault is usuall! to install e#er!thing under (usr(lo)al(apa)he 8)on&ir" this %! )onsulting !our DEA+FE.%indist and(or INSTA**.%indist do)u"ents:. That0s all there is to it on installing %inaries. RPM INSTALLATION: 7

Those o& !ou running Ded Hat *inu "a! want to take ad#antage o& Ded Hat0s D4F 82DedHat 4a)kage Fanager2: s!ste". Al"ost identi)al to a %inar!- an D4F is &urther )usto"i<ed to pla! ni)el! with other D4Fs and pro#ide a )onsistent inter&a)e to installing- updating- and re"o#ing %inaries.1or *inu new)o"ers or when installing a s"all standard )o"ponent- D4Fs are si"ple and relia%le. .ear in "ind that an Apa)he D4F "a! alread! %e installed on !our s!ste" depending on how *inu was originall! installed on !our )o"puter. To &ind out- at the shell pro"pt- t!pe' 7pB )C5 @ 87ep 5p562e I& !ou see so"ething like apa)he51.3.M - an Apa)he D4F has alread! %een installed. 3ou )an also t!pe that )o""and t!ping httpd instead o& apa)he to see i& itVs installed. I& !ou don0t ha#e an Apa)he D4F- !ou "ust o%tain one. Ded Hat 9.3 ships apa)he51.3.735 11.sr).rp" in the DedHat(D4FS dire)tor! on the installation C+. 6r- point !our %rowser at &tp'((&tp.redhat.)o"(pu%(redhat(redhat59.35en(os(i3;C(DedHat(D4FS and ownload it.I& !ou0#e not alread! done so- !ou0ll need to %e)o"e root. Na#igate to the sa"e dire)tor! as the .rp" &ile !ou o%tained- and then t!pe the &ollowing )o""and- su%stituting the na"e o& the .rp" !ou0re using &or e a"ple' apa)he51.3.73511.sr).rp". 7pB )9v2 5p562e)1.$.#$)11.s76.7pB D4F should grind awa!- displa!ing its progress with a pri"iti#e LLLLLLL progress %ar. .arring an! errors- !ou0re done. BUILD FORM SOURCE: .uilding Apa)he &ro" sour)e "a! see" like a daunting task to new)o"ers- %ut the Apa)he de#elopers ha#e done a wonder&ul @o% o& "aking the task a%out as si"ple as )ould %e. ,ust three "ore )o""ands than a %inar! installation and !ou skip the arduous task o& &iguring out whi)h %inar! is the right one &or !our parti)ular operating s!ste". 4oint !our %rowser at http'((www.apa)he.org(dist(httpd( and download the g<ip0d &or" o& the )urrent #ersion o& Apa)he 87.0.3C at the ti"e o& this writing:. Now let0s un)o"press that ar)hi#e using gun<ip and tar. 3ou should repla)e the httpd5 7.0.3C.tar.g< %elow with the na"e o& the g<ip0d &ile !ou downloaded. 8<n>9p ? 2ttp")#.,.$'.t57.8> @ t57 =vA D Q3ou should end up with an httpd57.0. dire)tor!- %eing the parti)ular su%5 #ersion o& Apa)he !ou downloaded. Fo#e into the newl! )reated dire)tor!. 6" 2ttp")#.,.= Now we0ll use the the )on&igure and "ake )o""ands to )on&igure- "ake- and install Apa)he. I& !ou0#e not alread! done so- now would %e the ti"e to %e)o"e root. .36 nA98<7e 3our s)reen should look so"ething like' E .36 nA98<7e 62e6F9n8 A 7 62 sen !5- <t... Ap562e 62e6F9n8 A 7 4 7F9n8 BF"97 )p... -es 62e6F9n8 :<9!" s-steB t-pe... 9'*')p6)!9n<=)8n< 62e6F9n8 2 st s-steB t-pe... 9'*')p6)!9n<=)8n< 62e6F9n8 t578et s-steB t-pe... 9'*')p6)!9n<=)8n< C nA98<79n8 Ap562e P 7t5:!e R<nt9Be !9:757- ... 6 nA98.st5t<s: e=e6<t9n8 "eA5<!t 6 BB5n"s $nless errors were reported 8not warnings:- !our Apa)he installation is now )on&igured and we )an "o#e on. This is where things get a %it ugl!. Fake0ing Apa)he produ)es s)reen&ulls o& output. M5Fe 3our s)reen should look so"ething like' E B5Fe M5F9n8 5!! 9n s76!9: B5FeG1H: Ente79n8 "97e6t 7- I32 Be37-5n3"!35p562eJ8<9"e32ttp") #.,.$'3s76!9:K M5F9n8 5!! 9n 5p7 8

B5FeG#H: Ente79n8 "97e6t 7- I32 Be37-5n3"!35p562eJ8<9"e32ttp") #.,.$'3s76!9:35p7K ... B5FeG1H: Le5v9n8 "97e6t 7- I32 Be37-5n3"!35p562eJ8<9"e32ttp")#.,.$'KE 1inall!- !ou0re read! to install !our Apa)he %uild. E B5Fe 9nst5!! Now Apa)he is installed. STARTING APACHE: *et0s take !our new Apa)he installation out &or a spin. I& !ou installed Apa)he using a %inar! or &ro" s)rat)h- as root- t!pe' 3<s73! 65!35p562e3:9n35p562e6t! st57t I& !ou used an D4F- as root- t!pe' 3s:9n3se7v96e 2ttp" st57t 4oint !our %rowser at !our %rand new /e% ser#er- http'((lo)alhost(. I& e#er!thing worked !ou should see the de&ault ho"e page. CUSTOMILE: Apa)he uses so"e rather eas! to understand te t &iles &or )on&iguration. 6n a Ded Hat s!ste"-!ou0ll &ind the" in (et)(httpd()on&. Tuite a &ew *inu distri%utions pla)e the" in this sa"e pla)e- %ut i& !ou )an0t &ind su)h a dire)tor!- do a sear)h &or 2httpd.)on&2. 6n)e !ou &ind these- !ou0#e &ound the "ain )on&ig &iles. I& !ou0re new to *inu - and need help &inding this &ile- here0s how !ou )an &ind it. 1.L 89n 5s 7 t #.T-pe: 6" 3 $.T-pe: A9n" )n5Be 2ttp".6 nA Now !ou should see where the &ile is lo)ated. /hen !ou "o#e into the dire)tor! )ontaining 2ttp".6 nA/ !ou should see these three &iles' Mhttpd.conf ? This has the settings &or the o#erall )on&iguration &or the ser#er. Waccess.conf D This &ile )ontains all the se)urit! settings &or Apa)he. Msrm.conf ? This &ile )ontains the FIFE de&initions and de&ault do)u"ent na"es &or &iles RESTARTING APACHE: /he#e#er !ou "ake )hanges to the ser#er )on&iguration &iles- su)h as httpd.)on&- the! won0t take e&&e)t until the ser#er is restarted. In *inu - Apa)he )an %e restarted depending on how !ou installed it. I& !ou installed Apa)he using a %inar! or &ro" s)rat)h- as root- t!pe' 3<s73! 65!35p562e3:9n35p562e6t! st57t I& !ou used an D4F- as root- t!pe' 3s:9n3se7v96e 2ttp" st57t A&ter %eing restarted the )hanges will ha#e taken e&&e)t. RESULT : Thus the apa)he ser#er was su))ess&ull! installed on linu operating s!ste". EX.NO:%N5O PALINDROME OR NOT DATE: AIM: To write a 4H4 progra" &or palindro"e. ALGORITHEM: STEP 1: Start the progra". STEP #: Create the &un)tion &or palindro"e as palin. STEP $: Che)k the )ondition &or the gi#en String. STEP %: I& the )ondition is true "eans- displa! as the gi#en String is a X4alindro"eY. STEP &: 6therwise displa! as- the gi#en string is Xnot a 4alindro"eY. STEP ': Stop the progra". PROGRAM: Sht"lRS%od!R SZphp 9

1un)tion palin8Ostring: [ OstringNre#ersed>strre#8Ostring:U I&8Ostring>>OstringNre#ersed: [ e)ho XOstring is a palindro"eYU \ Else [ e)ho XOstring is not a palindro"eYU \ \ 4alin8X"ada"Y:U ZR S(%od!R S(ht"lR OUTPUT: Fada" is a palindro"e. RESULT: Thus the 4H4 progra" &or palindro"e has %een e e)uted and output is #eri&ied su))ess&ull!. EX.NO:%N:O MULTIPLICATION TABLE DATE: AIM: To write a 4H4 progra" &or the "ultipli)ation ta%le. ALGORITHM: STEP 1: Start the progra". STEP #: Create the title as F$*TI4*IATI6N TA.*E %! using the ne)essar! tags. STEP $: Create the ta%le %order. STEP %: To )reate the parti)ular nu"%er o& rows and )olu"ns. STEP &: .! using StdR the data ele"ents are added in the )ell. STEP ': Then per&or" the "ultipli)ation &or the data o& rows and )olu"ns. STEP (: Stop the progra". PROGRAM: Sht"lR SheadR StitleRF$*TI4*ICATI6N TA.*ES(titleR S(headR S%od!R SZphp e)ho XF$*TI4*ICATI6N TA.*EY e)ho XSta%le %order>]Y1]YRYU &or8Orow>1UOrowS>PUOrowHH: [ E)ho XStrRYU 1or8O)ol>1UO)olS>PUO)olHH: [ O >O >O)ol^OrowU E)ho XStdRO S(tdRYU \ E)ho XS(trRYU \ E)ho XS(ta%leRYU ZR 10

S(%od!R S(ht"lR OUTPUT: 1 7 3 4 P 7 4 C ; 10 3 C M 17 1P 4 ; 17 1C 70 P 10 1P 70 7P

RESULT: Thus the 4H4 progra" &or the "ultipli)ation ta%le has %een e e)uted and output is #eri&ied su))ess&ull!. EX.NO:%N6O ADD USER INPUT TO ARRAY DATE: AIM: To write a 4H4 progra" to add user input to an arra!. ALGORITHM: STEP 1: Start the progra". STEP #: Create the title as X$ser Input Added to Arra!Y %! using the ne)essar! tags. STEP $: Create the &or" . STEP %: To )reate an arra! with string ele"ents. STEP &: Add the ele"ents to an arra!. STEP ': Stop the progra". PROGRAM: SheadR StitleR$ser Input Added to Arra!S(titleR S(headR S%od!R Sh7RHow Are 3ou Tra#elingZS(h7R SZphp ((I& &or" not su%"itted- displa! &or". i& 8Eisset8ON46STI0su%"it0K::[ Otra#el>arra!8 2Auto"o%ile2- 2,et2- 21err!2- 2Su%wa!2:U ZR SpRTra#el takes "an! &or"s- whether a)ross town- a)ross the )ountr!- or around the world. Here is a list o& so"e )o""on "odes o& transportation'S(pR SulR SZphp &orea)h 8Otra#el as Ot:[ e)ho 2SliROtS(liR]n2U \ ZR S(ulR 11

S&or" "ethod>2post2 a)tion>2!our&ile.php2R SpR4lease add !our &a#orite- lo)al- or e#en i"aginar! "odes o& tra#el to the list- separated %! )o""as'S(pR Sinput t!pe>2te t2 na"e>2added2 si<e>2;02 (R Sp (R SZphp ((Send )urrent tra#el arra! as hidden &or" data. &orea)h 8Otra#el as Ot:[ e)ho 2Sinput t!pe>]2hidden]2 na"e>]2tra#elIK]2 #alue>]2Ot]2 (R]n2U \ ZR Sinput t!pe>2su%"it2 na"e>2su%"it2 #alue>2Bo2 (R S(&or"R SZphp ((I& &or" su%"itted- pro)ess input. \else[ ((Detrie#e esta%lished tra#el arra!. Otra#el>8ON46STI0tra#el0K:U ((Con#ert user input string into an arra!. Oadded>e plode80-0-ON46STI0added0K:U ((Add to the esta%lished arra!. arra!Nspli)e8Otra#el- )ount8Otra#el:- 0- Oadded:U ((This )ould also %e written Otra#el>arra!N"erge8Otra#el- Oadded:U ((Deturn the new list to the user. e)ho 2SpRHere is the list with !our additions'S(pR]nSulR]n2U &orea)h8Otra#el as Ot:[ ((The tri" &un)tions deletes e tra spa)es the user "a! ha#e entered. e)ho 2SliR2.tri"8Ot:.2S(liR]n2U \ e)ho2S(ulR2U ZR SpRAdd "oreZS(pR S&or" "ethod>2post2 a)tion>2!our&ile.php2R Sinput t!pe>2te t2 na"e>2added2 si<e>2;02 (R Sp (R SZphp ((Send )urrent tra#el arra! as hidden &or" data. &orea)h 8Otra#el as Ot:[ e)ho 2Sinput t!pe>]2hidden]2 na"e>]2tra#elIK]2 #alue>]2Ot]2 (R]n2U \ ZR Sinput t!pe>2su%"it2 na"e>2su%"it2 #alue>2Bo2 (R S(&or"R SZphp \ ZR S(%od!R S(ht"lR RESULT: Thus the 4H4 progra" &or the addition o& ele"ents to the arra! has %een e e)uted and output is #eri&ied su))ess&ull!. EX.NO:&N5O FINDING GREATEST PALUE DATE: AIM: To write a si"ple progra" in p!thon &or &inding the greatest #alue a"ong three nu"%ers. ALGORITHM: STEP 1: Start the progra". 12

STEP #: To get the three input #alues &ro" the user. STEP $: Che)k the _i&V )ondition and i& it is true- print XNu"%er 1 is greaterY. STEP %: 6therwise )he)k _eli&V )ondition and i& it is true- print XNu"%er 7 is greaterY. STEP &: .oth the )ondition is &ailed "eans- print XNu"%er 3 is greaterY. STEP ': Stop the progra". PROGRAM LE (usr(%in(p!thon L progra" to &ind greatest a"ong three nu"%ers no1 > rawNinput82Enter the 1irst Nu"%er 2: no7 > rawNinput82Enter the Se)ond Nu"%er 2: no3 > rawNinput82Enter the Third Nu"%er 2: i& no1 R no7 and no1 R no3' print 2Nu"%er 1 is greater 2 eli& no7 R no3' print 2 Nu"%er 7 is greater 2 else' print 2 N$"%er 3 is greater 2 OUTPUT: rootJlo)alhost si#aKL .(i&stat.p! Enter the 1irst Nu"%er 30 Enter the Se)ond Nu"%er 70 Enter the Third Nu"%er 10 Nu"%er 1 is greater IrootJlo)alhost si#aKL .(i&stat.p! Enter the 1irst Nu"%er 10 Enter the Se)ond Nu"%er 30 Enter the Third Nu"%er 70 Nu"%er 7 is greater IrootJlo)alhost si#aKL .(i&stat.p! Enter the 1irst Nu"%er 10 Enter the Se)ond Nu"%er 70 Enter the Third Nu"%er 30 Nu"%er 3 is greater IrootJlo)alhost si#aKL RESULT: Thus the p!thon progra" &or &inding the greatest #alue a"ong the three nu"%ers has %een e e)uted su))ess&ull! EX.NO:&N:O FINDING FIBONACCI SERIES AND FACTORIAL DATE: PALUES AIM: To write a p!thon progra" &or generating 1i%ona))i series and &ind &a)torial o& a nu"%er using looping state"ents. ALGORITHM: STEP 1: Start the progra". STEP #: To )al)ulate &a)torial #alue o& a nu"%er using &a)t>&a)t^i. STEP $: +e&ine the input as 0 and 1 to generate the 1i%ona))i series upto 10 nu"%ers. STEP %: 4rint the result. STEP &: Stop the progra". PROGRAM: LE (usr(%in(p!thon L progra" to de"onstrate &or loop and range L progra" to &ind the &a)torial o& a nu"%er and generate 1i%ona))i series 13

&a)t > 1 &or i in range81-P:' &a)t > &a)t ^ i print 21a)torial o& P is 2- &a)t a-% > 0- 1 print 2 The &irst 10 &i%ona))i nu"%ers are 2 &or i in range810:' )>aH% print ) a>% %>) OUTPUT IrootJlo)alhost si#aKL .(loop.p! 1a)torial o& P is 74 The &irst 10 &i%ona))i nu"%ers are 1 7 3 P ; 13 71 34 PP ;M IrootJlo)alhost si#aKL RESULT: Thus the p!thon progra" &or generating 1i%ona))i series and &a)torial o& a nu"%er has %een e e)uted su))ess&ull!. EX.NO:&N6O STRING OPERATIONS DATE: AIM: To write a p!thon progra" to per&or" string operation. ALGORITHM: STEP 1: Start the progra". STEP #: Bet the input string &ro" the user. STEP $: .! using str.upper 8: and str.lower 8: &un)tions to displa! the gi#en string in upper and lower )ases respe)ti#el!. STEP %: .! using strI'K to displa! the parti)ular )hara)ter &ro" the string. STEP &: .! using )ount 8: and len 8: &un)tions displa! the )ount #alue o& the parti)ular and length o& the string. STEP ': Stop the progra" PROGRAM: LE (usr(%in(p!thon str > rawNinput82Enter the String 2: print 2$pper Case o& the Bi#en String is 2 print str.upper8: print 2*ower Case o& the Bi#en String is 2 print str.lower8: print 2The 1irst 1i#e Chara)ters o& the String is 2 H strI'PK print 2The last 1i#e )hara)ter o& the String is 2 H strI'5CK print 2The )hara)ters a&ter the si th lo)ation 2 H strIC'K 14

print 2The )hara)ters %etween 3 and ; is 2 H strI3';K print 2The Nu"%er o& 0e0 in the String is 2- str.)ount80e0: print 2The *ength o& the String is 2 - len8str: OUTPUT: IrootJlo)alhost si#aKL )h"od aH stropr.p! IrootJlo)alhost si#aKL .(stropr.p! Enter the String /el)o"e to 4!thon 4rogra""ing $pper Case o& the Bi#en String is /E*C6FE T6 43TH6N 4D6BDAFFINB *ower Case o& the Bi#en String is wel)o"e to p!thon progra""ing The 1irst 1i#e Chara)ters o& the String is /el)o The last 1i#e )hara)ter o& the String is /el)o"e to 4!thon 4rogr The )hara)ters a&ter the si th lo)ation e to 4!thon 4rogra""ing The )hara)ters %etween 3 and ; is )o"e The Nu"%er o& 0e0 in the String is 7 The *ength o& the String is 7M IrootJlo)alhost si#aKL RESULT: Thus the p!thon progra" &or per&or"ing string operation has %een e e)uted su))ess&ull! and output is #eri&ied. EX.NO:&N"O COPYING FILE BY USING EXCEPTION HANDLING DATE: AIM: To write a progra" &or )op!ing )ontent o& one &ile to another &ile $sing e )eption handling in p!thon. ALGORITHM: STEP 1: Start the progra". STEP #: Create the e )eption %lo)k. STEP $: Create the sour)e &ile as _rV and destination &ile as _wV. STEP %: Bet the input in sour)e &ile and output in destination &ile. STEP &: .! using the write 8line: &un)tion the sour)e &ile is )opied to the destination &ile _wV. STEP ': Then print the result as X1ile )opied su))ess&ull!Y. STEP (: Stop the progra". PROGRAM: L Cop!ing )ontent o& one &ile to another s&ilena"e > rawNinput82Sour)e 1ilena"e 2: d&ilena"e > rawNinput82+estination 1ilena"e 2: tr!' input > open8s&ilena"e- 0r0: e )ept' print 2$na%le to open &ile 2 output > open8d&ilena"e-2w2: &or line in input.readlines8:' output.write8line: print 2&ile )opied su))ess&ull!2 input.)lose8: output.)lose8: OUTPUT: IrootJlo)alhost si#aKL p!thon &ile .p! Sour)e 1ilena"e stropr.p! +estination 1ilena"e str.p! &ile )opied su))ess&ull! 15

IrootJlo)alhost si#aKL )at str.p! LE (usr(%in(p!thon str > rawNinput82Enter the String 2: print 2$pper Case o& the Bi#en String is 2 print str.upper8: print 2*ower Case o& the Bi#en String is 2 print str.lower8: print 2The 1irst 1i#e Chara)ters o& the String is 2 H strI'PK print 2The last 1i#e )hara)ter o& the String is 2 H strI'5CK print 2The )hara)ters a&ter the si th lo)ation 2 H strIC'K print 2The )hara)ters %etween 3 and ; is 2 H strI3';K print 2The Nu"%er o& 0e0 in the String is 2- str.)ount80e0: print 2The *ength o& the String is 2 - len8str: RESULT: Thus the p!thon progra" &or )op!ing the )ontent o& sour)e &ile to destination &ile using e )eption handling has %een e e)uted su))ess&ull! and output is #eri&ied. EX.NO:&NeO DATE: FUNCTIONS IN LIST

AIM: To write a progra" &or per&or"ing &un)tions in lists using p!thon. ALGORITHM: STEP 1: Start the progra". STEP #: Create the list with the #alues o& #arious data t!pes. STEP $: Then per&or" the list operations su)h as print the whole list and also print the ele"ent with starting and ending #alues-list )on)atenatio and "odi&i)ation on the listappending operation on the list and deleting ele"ent on the list. STEP %: 4rint all the result. STEP &: Stop the progra". PROGRAM: L4!thon *ists LE(usr(%in(p!thon print82]t ]t ]t 4!thon *ists2:U list > I 0a%)d0- 9;C - 7.73- 0@ohn0- 90.7 K tin!list > I173- 0@ohn0K print824rints )o"plete list'2-list:U print824rints &irst ele"ent o& the list ' 2-listI0K:U print824rints ele"ents starting &ro" 7nd to 4th'2-listI1'3K:U print824rints ele"ents starting &ro" 3rd ele"ent'2-listI7'K:U print824rints list two ti"es'2-tin!list ^ 7:U print824rints )on)atenated lists' 2- list H tin!list :U EB "9A- t2e %t2 e!eBents 9n t2e !9st print82.e&ore "odi&!ing the 4th ele"ent in list '2-listI4K:U listI4K>0e&gh0U print824th ele"ent in list '2-listI4K:U print82 )o"plete list'2-list:U EAppen"9n8 ne4 e!eBents list.append80i@kl0:U print82A&ter appending list'2-list:U E"e!et9n8 5n e!eBent 9n !9st del listI7KU print82*ist '2-list:U 16

OUTPUT: IrootJlo)alhost`KLp!thon pgC.p! 4!thon list 4rints )o"plete list' I_a%)dV- 9;C- 7.73-V@ohnV- 90.70000000000003K 4rints &irst ele"ent o& the list' a%)d 4rints ele"ent starting &ro" 7nd and 4th' I9;C- 7.73K 4rints ele"ent starting &ro" 3rd ele"ent'I7.73-V@ohnV-90.7000000000003K 4rints )on)atenated list' I _a%)dV- 9;C- 7.73-V@ohnV- 90.70000000000003- 173-V@ohnVK .e&ore "odi&!ing the 4th ele"ent in list' 90.7 1ourth ele"ent in the list' e&gh Co"plete list' I_a%)dV- 9;C- 7.73-V@ohnV-Ve&ghVK A&ter appending list' I_a%)dV- 9;C- 7.73-V@ohnV-Ve&ghV-Vi@klVK *ist1' I_a%)dV- 9;C- V@ohnV-Ve&ghV-Vi@klVK IrootJlo)alhost`KL

RESULT: Thus the p!thon progra" &or )reating the list and per&or"ing &un)tions in the list has %een e e)uted su))ess&ull! and output is #eri&ied. EX.NO:&NAO DATE: AIM: To write a p!thon progra" &or the gi#en nu"%er is pri"e or not. ALGORITHM: STEP 1: Start the progra". STEP #: .! using the _&orV loop we "a! gi#e the range o& the nu"%er. STEP $: In the _i&V )ondition we )he)k the re"ainder #alue gi#en %! the "odulo operation. STEP %: I& it is <ero "eans then print the reason as _nV eGuals _ ^n( V. STEP &: Stop the progra". PROGRAM: LE(usr(%in(p!thon &or n in range87- 10:' &or in range87- n:' i& n a >> 0' print n- 0eGuals0- - 0^0- n( %reak else' print n- 0is a pri"e nu"%er0 OUTPUT: 7 is a pri"e nu"%er 3 is a pri"e nu"%er 4 eGuals 7 ^ 7 P is a pri"e nu"%er C eGuals 7 ^ 3 9 is a pri"e nu"%er ; eGuals 7 ^ 4 17 PRIME OR NOT

M eGuals 3 ^ 3 RESULT: Thus the p!thon progra" &or )he)king pri"e nu"%er has %een e e)uted su))ess&ull! and output is #eri&ied. EX.NO:'N5O DATE: AIM: To write a perl progra" &or &inding the "a i"u" #alues using &un)tion. ALGORITHM: STEP 1: Start the progra". STEP #: Create the &un)tion as su%"a 8:. STEP $: Shi&t &un)tion is used to re"o#e the &irst ele"ent in the arra!. STEP %: Then )o"pare ea)h ele"ent in the arra! and &ind the "a i"u" #alue with the help o& _&orea)hV state"ent. STEP &: 4rint the "a i"u" #alue. STEP ': Stop the progra". PROGRAM: LEusr(%in(perl su% "a 8: [ O"a >shi&t JNU &orea)h O# 8JN: L O# is the se)ond #alues in the JN [ O"a >O# i& O"a SO#U \ return O"a U \ Od>b"a 810- 79;- 10P0- 9C- ;00- 74C- 9C- 34P:U print 2The "a i"u" #alue is Od]n2U OUTPUT: Ilinu pertJlo)alhost `KO perl &un)tionpara".pl The "a i"u" #alue is 10P0 RESULT: Thus the perl progra" &or &inding the "a i"u" #alue using &un)tion has %een e e)uted su))ess&ull! and output is #eri&ied. EX.NO:'N:O DATE: AIM: To write a perl progra" to )he)k the greatest nu"%er a"ong three. ALGORITHM: STEP 1: Start the progra". STEP #: Bet the three nu"%ers at runti"e. STEP $: Then %! using _i&V and _elsi&V )ondition )he)k the greatest nu"%er. STEP %: 4rint the result. STEP &: Stop the progra". 18 GREATEST AMONG THREE NUMBERS FIND MAXIMUM PALUES USING FUNCTION

PROGRAM: LBreatest a"ong 3 nu"%er print 2Enter A #alue ' 2U Oa>SRU print 2Enter % #alue ' 2U O%>SRU print 2Enter ) #alue ' 2U O)>SRU i&88Oa R O%:bb8Oa R O):: [ print 2A is greater2U \ elsi&88O% R O):bb8O% R Oa:: [ print 2. is greater2U \ else [ print 2C is greater2U \ OUTPUT: IrootJlo)alhost`KLperl pl7.pl Enter A #alue '100 Enter . #alue 'P0 Enter C #alue '30 A is greater IrootJlo)alhost`KL RESULT: Thus the perl progra" &or )he)king the greatest nu"%er a"ong three has %een e e)uted su))ess&ull! and the output is #eri&ied. EX.NO:'N6O DATE: AIM: To write a perl progra" to get the user details in runti"e. ALGORITHM: STEP 1: Start the progra". STEP #: Bet the student in&or"ation at runti"e using the )ho"p8:. STEP $: 4rint the student in&or"ation STEP %: Stop the progra". PROGRAM: LE usr(%in(perl print 2Enter the Student In&or"ation2U print 2]n enter na"e2U )ho"p8Ona"e > SR:U print 2]nenter do%2U )ho"p8Odo%>SR:U print 2]n enter registerno.2U )ho"p8Oregistern0.>SR:U 19 GET DETAILS IN RUNTIME

print 2]n enter edu)ation2U )ho"p8OEdu)ation>SR:U print 2]n Student In&or"ation2U print 2]n Na"e' Ona"e2U print 2]n +ate 6& .irth 'Odo%2U print 2]n Degister no.'Oregistern0.2U print 2]nTuali&i)ation 'OEdu)ation2U OUTPUT: IrootJlo)alhost`KLpg.pl Enter the student in&or"ation Enter na"e' Enter +6.' 1M.10.1MM0 Enter register no' 10040P309014 Enter edu)ation' .E Student in&or"ation Na"e' +ate o& %irth' 1M.10.1MM0 Degister no' 10040P309014 Tuali&i)ation' .E RESULT: Thus the perl progra" &or getting user details at runti"e has %een e e)uted su))ess&ull! and the output is #eri&ied. EX.NO:'N"O DATA MANIPULATION DATE: AIM: To write a perl progra" &or per&or"ing the "anipulation on date. ALGORITHM: STEP 1: Start the progra". STEP #: .! using the %uiltNin &un)tions su)h as a%s8:- int a%s8:- sGrt8:- and also using the string &un)tion su)h as l)8:- u)8:- su%str8: "anipulate the string. STEP $: 4rint the result. STEP %: Stop the progra". PROGRAM: L +ata Fanipulation in 4erl print 2 a%solute #alue o& 51.7MP49C is 2- a%s851.7MP49C:-2]n2U print 2Integer eGui#alent o& the a%o#e is 2- int a%s851.7MP49C:-2]n2U print 2 SGuare root o& 1C3;4 is2- sGrt81C3;4:-2]n2U print 2 String )ase )on#ersion 2-2]n2U Ostring > 2All that glitters are not gold2-2]n2U print Ostring-2]n2U print 2*ower )ase eGui#alent ' 2- l)8Ostring:-2]n2U print 2$pper )ase eGui#alent ' 2- u)8Ostring:-2]n2U print 2Inde o& glitters is ' 2 U print inde 8Ostring-0glitters0:-2]n2U print 21irst three )hara)ters o& the string is ' 2- su%str8Ostring-3:-2]n2U print 2*ast 10 )hara)ters o& the string is ' 2- su%str8Ostring- 59:-2]n2U OUTPUT: O perl d"an.pl a%solute #alue o& 51.7MP49C is 1.7MP49C Integer eGui#alent o& the a%o#e is 1 20

SGuare root o& 1C3;4 is17; String )ase )on#ersion All that glitters are not gold *ower )ase eGui#alent ' all that glitters are not gold $pper )ase eGui#alent ' A** THAT B*ITTEDS ADE N6T B6*+ Inde o& glitters is ' M 1irst three )hara)ters o& the string is ' All *ast 10 )hara)ters o& the string is ' not gold RESULT: Thus the perl progra" &or per&or"ing the data "anipulation has %een e e)uted and the output is #eri&ied su))ess&ull!. EX.NO:'NeO PERL SCRIPT TO DETECT 1EB BRO1SER DATE: AIM: To write a perl progra" to dete)t the we% %rowser. ALGORITHM: STEP 1: Start the progra". STEP #: Create a s)ript in the perl. STEP $: Create the #aria%le user agent as Oua. STEP %: To sele)t and dete)t the we% %rowser using _i&V )ondition. STEP &: +epends upon the )ondition print result. STEP ': Stop the progra". PROGRAM: LE(usr(%in(perl 5wT use CBI Gw8'standard:U use CBI''Carp Gw8warningsTo.rowser &atalsTo.rowser:U use stri)tU print headerU print startNht"l82.rowser +ete)t2:U "!8Oua: > OENV[HTT4N$SEDNABENT\U print 2$ser5agent' OuaSpR]n2U i& 8inde 8Oua- 2FSIE2: R 51: [ print 23our %rowser is Internet E plorer.SpR]n2U \ elsi& 8inde 8Oua- 2Nets)ape2: R 51: [ print 23our %rowser is Nets)ape.SpR]n2U \ elsi& 8inde 8Oua- 2Sa&ari2: R 51: [ print 23our %rowser is Sa&ari.SpR]n2U \ elsi& 8inde 8Oua- 26pera2: R 51: [ print 23our %rowser is 6pera.SpR]n2U \ elsi& 8inde 8Oua- 2Fo<illa2: R 51: [ print 23our %rowser is pro%a%l! Fo<illa.SpR]n2U 21

\ else [ print 2I gi#e up- I )an0t tell what %rowser !ou0re usingESpR]n2U \ print endNht"lU OUTPUT: $ser5agent' Fo<illa(4.0 8)o"pati%leU FSIE C.0U /indows NT P.1U SV1U AskT%ADS(P.;.0.17304: 3our %rowser is Internet E plorer. RESULT: Thus the perl progra" &or dete)ting the /E. .D6/SED has %een e e)uted su))ess&ull!. EX.NO:(N5O SIMPLE GUI PROGRAMMING DATE: AIM: To write a TT progra" to displa! XHello /orldY ALGORITHM: STEP 1: Start the progra". STEP #: Create a new dire)tor! &or the progra". "kdir Gthello )d Gthello STEP $: )reate the &ile in the Gthello dire)tor!. gedit Gthello.)pp STEP %: 6n)e the &ile has %een sa#ed- use the &ollowing )o""ands to )o"pile and e e)ute the progra".. R G"ake5Gt4 5pro@e)t R G"ake5Gt4 R "ake R .(Gthello STEP &: Stop the progra". PROGRAM: ((Gthello.)pp ((In)lude &ile &or Tt Lin)lude STtBuiR int "ain8int arg)- )har ^arg#IK: [ TAppli)ation app8arg)- arg#:U T/idget windowU ((resi<e window to 370 740 window.resi<e8370- 740:U window.set/indowTitle8XHello /orldEY:U ((Show the window window.show8:U ((Start the e#ent loop return app.e e)8:U \ OUTPUT:

22

RESULT: Thus the si"ple TT progra" is has %een e e)uted su))ess&ull!. EX.NO:(N:O SIMPLE GUI PROGRAMMING D BUTTON CREATION DATE: AIM: To write a TT progra" to )reate /indow with %utton ALGORITHM: STEP 1: Start the progra". STEP #: Create a new dire)tor! &or the progra". "kdir Gt%utton )d Gt%utton )reate the &ile in the Gt%utton dire)tor!. gedit Gt%utton.)pp STEP %: 6n)e the &ile has %een sa#ed- use the &ollowing )o""ands to )o"pile and e e)ute the progra".. R G"ake5Gt4 5pro@e)t R G"ake5Gt4 R "ake R .(Gt%utton STEP &: Stop the progra". PROGRAM: Lin)lude STtBuiR int "ain8int arg)- )har ^arg#IK: [ TAppli)ation app8arg)- arg#:U T/idget windowU STEP $:

23

window.resi<e8370- 740:U window.set/indowTitle8X/indow with a %uttonY:U window.show8:U ((Create a %utton with the te t X4ress "eY ((as a )hild o& the "ain window T4ush.utton ^%utton > new T4ush.utton824ress "e2- bwindow:U (("o#e the %utton into position %utton5 R"o#e8100- 100:U %utton5Rshow8:U return app.e e)8:U \ OUTPUT:

RESULT: Thus the si"ple TT progra" is has %een e e)uted su))ess&ull!. EX.NO:(NCO SIMPLE GUI PROGRAMMING) LAYOUT CREATION DATE: AIM: To write a TT progra" to )reate /indow with %utton ALGORITHM: STEP 1: Start the progra". STEP #: Create a new dire)tor! &or the progra". "kdir Gtla!out )d Gtla!out )reate the &ile in the Gtla!out dire)tor!. gedit Gtla!out.)pp STEP %: 6n)e the &ile has %een sa#ed- use the &ollowing )o""ands to )o"pile and e e)ute the progra".. R G"ake5Gt4 5pro@e)t R G"ake5Gt4 R "ake R .(Gtla!out STEP &: Stop the progra". 24 STEP $:

PROGRAM: ((Gtla!out.)pp Lin)lude STtBuiR int "ain8int arg)- )har ^arg#IK: [ TAppli)ation app8arg)- arg#:U T/idget windowU ((Create a la%el an a single line te t %o T*a%el ^la%el > new T*a%el82Na"e'2:U T*ineEdit ^lineEdit > new T*ineEdit8:U ((Create a la!out. Add the la%el and the lineedit to it. TH.o *a!out ^la!out > new TH.o *a!out8:U la!out5Radd/idget8la%el:U la!out5Radd/idget8lineEdit:U ((Appl! the la!out to the "ain window. ((Sin)e the widgets are part o& the la!out((the! are now )hildren o& the window. window.set*a!out8la!out:U window.set/indowTitle82/indow la!out2:U window.show8:U return app.e e)8:U \ OUTPUT:

RESULT: Thus the si"ple TT progra" is has %een e e)uted su))ess&ull!. EX.NO:(NCO SIMPLE GUI PROGRAMMING) SIGNALS AND SLOTS DATE: AIM: To write a TT progra" to )reate /indow with Signals and slots ALGORITHM: STEP 1: Start the progra". STEP #: Create a new dire)tor! &or the progra". "kdir Gtsignals )d Gtsignals )reate three &iles in the Gtsignals dire)tor!. )o""uni)ate.h )o""uni)ate.)pp "ain.)pp STEP %: 6n)e the &ile has %een sa#ed- use the &ollowing )o""ands to )o"pile and e e)ute the progra".. R G"ake5Gt4 5pro@e)t R G"ake5Gt4 R "ake R .(Gtsignals STEP &: Stop the progra". 25 STEP $:

PROGRAM: R gedit )o""uni)ate.h (()o""uni)ate.h Lin)lude ST/idgetR Lin)lude STAppli)ationR Lin)lude ST4ush.uttonR Lin)lude ST*a%elR )lass Co""uni)ate ' pu%li) T/idget [ ((The TN6.,ECT "a)ro )auses the "o) tool to initialise (()ode &or signals and slots- run ti"e t!pe in&or"ation ((and d!na"i) propert! s!ste" TN6.,ECT pu%li)' Co""uni)ate8T/idget ^parent > 0:U ((add a lot whi)h allows widget )o""uni)ations pri#ate slots' #oid add8:U pri#ate' T*a%el ^la%elU \U c)reate the &ile in the Gtsignals dire)tor!. R gedit )o""uni)ate.)pp (()o""uni)ate.)pp Lin)lude 2)o""uni)ate.h2 Lin)lude ST+esktop/idgetR Co""uni)ate''Co""uni)ate8T/idget ^parent: ' T/idget8parent: [ resi<e81;0- 140:U T4ush.utton ^plus > new T4ush.utton82H2- this:U plus5RsetBeo"etr!8P0- 40- P0- 30:U la%el > new T*a%el8202- this:U la%el5RsetBeo"etr!8170- 40- 70- 30:U ((Conne)t the )li)ked e#ent o& the %utton to ((the add "ethod o& the )lass )onne)t8plus- SIBNA*8)li)ked8::- this- S*6T8add8:::U \ #oid Co""uni)ate''add8: [ ((Change the te t displa!ed in the la%el int #al > la%el5 Rte t8:.toInt8:U #alHHU la%el5RsetTe t8TString''nu"%er8#al::U \ c)reate the &ile in the Gtsignals dire)tor!. R gedit "ain.)pp

26

("ain.)pp Lin)lude 2)o""uni)ate.h2 int "ain8int arg)- )har ^arg#IK: [ TAppli)ation app8arg)- arg#:U Co""uni)ate windowU window.set/indowTitle82Co""uni)ate2:U window.show8:U return app.e e)8:U \ OUTPUT:

RESULT: Thus the si"ple TT progra" is has %een e e)uted su))ess&ull!. Ed.N6'; VIDT$A*ISATI6N ENVID6NFENT DATE: AIM : To de#elop Virtualisation en#iron"ent 8e.g.- en- kGe"u or lguest: to test an appli)ations- new kernels and isolate appli)ations. ALGORITHM: Steps &or Virtuali<ation using TEF$ and 1ree+6S 1. +ownload the &d%ase)d.iso &ro" www.&reedos.org 8or: &ro" &ossla% ser#er The &ollowing steps should %e &ollowed &ro" the dire)tor! where &d%ase)d.iso is stored 7. )reate #irtual "a)hine ' L #irt"anager b 3. Cli)k on &ile )onne)t to )onne)t to lo)alhost

27

4. In the %ase "enu- please right)li)k on the lo)alhost 8TEF$: to )reate a new VF. 4lease na"e the VF as per !our )hoi)e

P. In the ne t s)reensele)t the $se IS6 i"age option then )li)k the .rowse option.

C. In the ne t s)reen )li)k the .rowse *o)al option on the %otto"le&t se)tion o& the s)reen.

9. In the ne t s)reen please sele)t the IS6 i"age &ile o& !our own )hoi)e 8$%untu- )entos&edora et):

28

;. A&ter sele)ting the IS6 &ile please sele)t 6S T!pe as *inu and Version as Beneri) 7.C. kernel. M. In the ne t s)reen- please sele)t the C4$ and DAF li"its &or the VF. .! de&ault the! are P17F and one C4$

10. In the ne t s)reen- please sele)t the reGuired si<e &or the VF 8.! de&ault ;B.:

11. In the ne t s)reen- %! de&ault no networking is sele)ted without using a %ridge.I& reGuired networking )an %e ena%led &or the VF %! )reating a %ridge. 4lease )li)k on 1inish to start )reating the "a)hine. 6n)e the "a)hine is )reated- the sa"e would %e displa!ed on #irt"anager s)reen and the VF )an %e startedstopped %! sele)ting the VF and right)li)king to sele)t options. 29

Desult' Thus Virtuali<ation is learnt %! installing FS5+6S in #irtual "a)hine. EX.NO:+ SETTING UP OF COMPLETE NET1ORQ INTERFACE DATE: AIM : To set up Network Inter&a)e using 0i&)on&ig0 )o""and and the related s!ste" &iles. PROBLEM DESCRIPTION: A Network inter&a)e is the point o& inter)onne)tion %etween a )o"puter and a pri#ate or pu%li) network. A network inter&a)e is generall! a network inter&a)e )ard 8NIC:. Batewa! is a node that allows !ou to gain entran)e into a network and #i)e #ersa. 6n the Internet the node whi)h is the stopping point )an %e a gatewa! or a host node. A )o"puter that )ontrols the tra&&i) !our network or !our IS4 8Internet Ser#i)e 4ro#ider: re)ei#es is a node. DNS ND B59n n5Be se7ve7O/ the s!ste" that auto"ati)all! translates Internet addresses to the nu"eri) "a)hine addresses that )o"puters use. Ipt5:!es is a user spa)e appli)ation progra" pro#ided %! the *inu kernel &irewall 8i"ple"ented as di&&erent Net&ilter "odules: -that allows us to )on&igure the ta%les and the )hains and rules it stores. PROCEDURE: 1. Con&iguring the network =Assign an I4 address &or the )o"puter # ifconfig eth0 192.168.x.y netmask 255.255.255.0 up = Adding a hu% to the "a)hine # route add net 192.168.0.0 netmask 255.255.255.0 eth0 = To )onta)t hosts outside the network i& a "a)hine with I4 address 1M7.1C;. .! is the gatewa! # route add default g 192.168.x.y eth0

30

7. Con&iguring an inter&a)e &or "ultiple I4 addresses = To use "ultiple I4 address on one Ethernet )ard )op! the &ile na"ed i&)&g5eth0 lo)ated in (et)(s!s)on&ig(network5s)ripts dire)tor! +EVICE>2eth02 I4A++D>21M7.1C;.7.1002 NETFASK>27PP.7PP.0.02 6N.66T>2!es2 .66T4D6T6>2none2 Create a new &ile na"ed i&)&g5eth0'0 in the sa"e dire)tor! and paste the )ontent. Fodi&! the &ile as the &ollowing +EVICE>2eth0'02 I4A++D>21M7.1C;.7.1012 NETFASK>27PP.7PP.0.02 6N.66T>2!es2 .66T4D6T6>2none2 To add "ore I4 address repla)e '0 with '1- '7- '3 Now restart the s!ste" to "ake it e&&e)ti#e 31

= =

= =

#ser!ice net ork restart 3. Con&iguring the +NS = Edit the network &ile present in the (et)(s!s)on&ig( dire)tor! NET/6DKINB>!es 16D/AD+NI4V4>&alse H6STNAFE>!ourna"e.)ollegena"e.)o" +6FAINNAFE>)ollegena"e.)o" BATE/A3>1M7.1C;. .! BATE/A3+EV>eth0 /here BATE/A3+EV is the network inter&a)e )ard that is atta)hed to the network. The BATE/A3 is the a)tual I4 address o& the gatewa! "a)hine

4. Fanaging I4TA.*ES = Start-stop and restart the ipta%les using the &ollowing )o""ands' #ser!ice ipta"les start #ser!ice ipta"les stop #ser!ice ipta"les restart = To "ake ipta%les )on&igured to start on %oot- use the &ollowing )o""and' 32

# chkconfig ipta"les on = Che)k the status o& the ipta%les #ser!ice ipta"les status

DES$*T' Thus setting up o& Network Inter&a)e using 0i&)on&ig0 )o""and and the related s!ste" &iles is done su))ess&ull!.

33

EX.NO:1, COMPILING SOFT1ARE FROM SOURCE DATE: AIM : To learn a%out the )o""on %uild s!ste"s a#aila%le in *inu and to use the". PROCEDURE: 1. M5Fe e Create a new dire)tor! R "kdir gnu"ake R )d gnu"ake e Create a new &ile in the Gthello dire)tor!. R gedit sGuareroot.) (( sGuareroot.) (( A si"ple progra" that )o"putes the sGuare root o& a nu"%er Lin)lude Sstdio.hR Lin)lude Sstdli%.hR Lin)lude S"ath.hR int "ain 8int arg)- )har ^arg#IK: [ i& 8arg) S 7: [ &print&8stdout-2$sage' as nu"%er]n2-arg#I0K:U return 1U \ dou%le inputValue > ato&8arg#I1K:U dou%le outputValue > sGrt8inputValue:U &print&8stdout-2The sGuare root o& ag is ag]n2-inputValue-outputValue:U return 0U \ e Test the progra" %! )o"piling it on)e' R g)) sGuareroot.) 5o sGuareroot 5l" R .(sGaureroot 4M R The sGuare root o& 4M is 9 e Create a "ake&ile to )o"pile the progra" Rgedit Fake&ile L Co""ands start with TA. not spa)es e Test the Fake&ile = Create a "ake&ile to )o"pile the progra" Rgedit Fake&ile 34

L Co""ands start with TA. not spa)es CC > g)) C1*ABS> 5g *+1*ABS > 5l" all' sGuareroot sGuareroot' sGuareroot.o sGuareroot.o' sGuareroot.) )lean'r" 5& sGuareroot sGuareroot.o = Test the Fake&ile R "ake "ake' Nothing to %e done &or Qall0. R "ake )lean r" 5& sGuareroot sGuareroot.o R "ake g)) 5g 5) 5o sGuareroot.o sGuareroot.) g)) 5l" sGuareroot.o 5o sGuareroot R .(sGuareroot 4M The sGuare root o& 4M is 9

#.Ap562e Ant e Create a new dire)tor! R )d ..(..( R "kdir ant R )d ant R "kdir 5p sr)(hello R gedit sr)(hello(Hello/orld.@a#a The Code' pa)kage helloU pu%li) )lass Hello/orld [ pu%li) stati) #oid "ain8StringIK args: [ S!ste".out.println82Hello /orld2:U 35

\ \ e Co"pile the progra" R "kdir 5p %uild()lasses R @a#a) 5sour)epath sr) 5d %uild()lasses( sr)(hello(Hello/orld.@a#a R @a#a 5)p %uild()lasses hello.Hello/orld Hello /orld

Create a Ant %uild s)ript R gedit %uild. "l The Code' Spro@e)tR Starget na"e>2)lean2R Sdelete dir>2%uild2(R S(targetR Starget na"e>2)o"pile2R S"kdir dir>2%uild()lasses2(R S@a#a) sr)dir>2sr)2 destdir>2%uild()lasses2(R S(targetR Starget na"e>2@ar2R S"kdir dir>2%uild(@ar2(R S@ar dest&ile>2%uild(@ar(Hello/orld.@ar2 %asedir>2%uild()lasses2R S"ani&estR Sattri%ute na"e>2Fain5Class2 #alue>2hello.Hello/orld2(R S("ani&estR S(@arR S(targetR Starget na"e>2run2R S@a#a @ar>2%uild(@ar(Hello/orld.@ar2 &ork>2true2(R S(targetR S(pro@e)tR e Now )o"pile and run the progra" 36

Rant )lean Rant )o"pile @ar run

http://csetube.tk/

RESULT: Thus the )o""on %uild s!ste"s a#aila%le in *inu is learnt to use and %uild su))ess&ull!.

37