Deepa ppt about lamp technology

download Deepa ppt about lamp technology

If you can't read please download the document

Transcript of Deepa ppt about lamp technology

  • 1. LAMP TECHNOLOGY PRESENTATIONBY P.DEEPA

2. LAMP TECHNOLOGY

  • L A M Pis an acronym for a solution stack offree, open source software, originally coined from the first letters of

3. Linux (operating system), 4. Apache HTTP Server, 5. MySQL (database software) and 6. PHP. 7.

  • Linux

8. Unix-like computer operating system ,open-source softwarewhere source code is provided with operating system, which can be edited according to specific needs. 9. Apache 10. free software/open source web server 11.

  • MySQL

12. multithreaded, multi-user, SQL database management system 13. PHP 14. reflective programming language originally designed for producing dynamic web pages 15. ADVANTAGES OF LAMP

  • Easy to code with PHP and MySQL.

16. Easy to deploy a PHP app. Once youve got MySQL running, simply upload your .php files. 17. Develop locally 18. Cheap and ubiquitous hosting 19. INSTALLATION OF LAMP

  • Downloadlatest version of xampp for linux.

20. Extract the downloaded archive file to/opt: 21. tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt 22. start XAMPP simply calling the command : 23. /opt/lampp/lampp start 24. Test by typing in the following URL at web browser :http://localhost 25. LINUX( OPERATING SYSTEM ) 26. WHAT IS LINUX?

  • It is an operating system.

27. It is designed for to provide personal computer users a free orat very low-cost . 28. It has a reputation as a very efficient & fast performing systems. 29. Linux was developed by Linux Torvalds at the University of Helsinki in Finland. 30. WHY WE ARE USING LINUX?

  • We dont have to buy the office system requirements separately.

31. No need to buy costly hardwares for the basic need(like RAM,Processor). 32. We are free from viruses no need to buy the antivirus softwares separately.. 33. WHY WE ARE USING LINUX? Continue..

  • We can update everthing on our system with just one update manager.

34. It is free from pirated software so that we can share it with others is legal. 35. It wont get slow like windows operating system. 36. It upgrades all installation automatically. 37. ADVANTAGES:

  • Cost.

38. Security. 39. Choice(freedom). 40. Software. 41. Hardware. 42. DISADVANTAGES:

  • Understanding.

43. Compatibility. 44. Alternative Programs. 45. BASIC LINUX COMMANDS: 1. Show who is logged on and what they aredoing. $ w 2.Show who is logged on. $ who 46. 3.Create empty file of 0 byte $ touch 4.Remove file $ rm 5. List files. $ ls 47. 6. Create/Make a new directory. $ mkdir 7. Clear the terminal screen. $clear 8.Display information on free used memory. $ free 48. 9.Check current date and time. $ date 10.Compare two files. $ cmp file1 file2 11.To save and exit. Ctrl -d 49. 12.Short listing of directory contents $ls -

  • -a list hidden files.

50. -dlist the name of the current directory. 51. -Fshow directories with a trailing '/' 52. executable files with a trailing '*'. 53. -tsort by time modified instead of name. 54. Short listing of directory contents $ls- continue..

  • -g show group ownership of file in longlisting

55. -iprint the inode number of each file 56. -llong listing giving details about filesand directories 57. 13.Prints a calendar for the specified month ofthe specified year. $cal month year14.It will show you the full path to the directoryyou are currently in. $pwd ( print working directory) 58. 15.Type mv followed by the current name of adirectory and the new name of thedirectory. $mv( change the name of a directory) 59. LINUX DIRECTORY STRUCTURE 60. LINUX DIRECTORIES: < / >

  • The root directory where the Linux system begins contains only subdirectories..

61. The starting point of your directory structure. 62. Every other file and directory onsystem is under the root directory. 63.

  • < /boot >
  • The place where Linux keeps information that it needs when booting up.

64. < /bin > 65. Itcontains the most important programs that the system needs to operate, such as the shells, ls, grep, and other essential things. 66.

  • < /usr/bin >
  • /usr/bin in turn contains applications for the system's users.

67. < /dev > 68. The devices that are available to a Linux system. 69.

  • < /etc >
  • The configuration files for the Linux system.

70. Most of these files are text files and can be edited by hand. 71. < /home > 72. This is where users keep their personal files are allowed to write files. 73.

  • < /lib >
  • The shared libraries for programs that are dynamically linked.

74. < /mnt > 75. This directory is used for mount points. 76. < /sbin, /usr/sbin > 77. Most system administration programs are stored in these directories. 78.

  • < /usr >
  • It contains user applications andsource codes, and pictures, docs, or config files .

79. /share> 80. Config files and graphics for many user apps. 81. < /usr/local > 82. This is where you install apps and other files for use on the local machine. 83. SOME OF THE LINUX EDITORS

  • ed-Original UNIX line-basededitor, useful inscripts

84. emacs-GNU editor and fullyintegrated user environment 85. ex -Powerful line-based editor(integrated with vi) 86. SOME OF THE LINUX EDITORS continue..

  • gawk -GNU awk, powerful text editorfor records containing fields.

87. sed -Stream-oriented (non-interactive) line-based editor 88. vi-Classic screen-based editorfor UNIX 89. vim-Vi IMproved, enhancedsupport for programmers 90. CRONTAB & CRONJOB

    • The termcronis derived from the wordchronograph .
  • 91. TheCron, at, batchCommand is used for Scheduling Execution of Command according to requirements.

92. Cron is a system deamon that keeps sleeping most of the time. 93. CRONTAB & CRONJOB continue..

    • I t typicallywakes up every one minuteand checks it crontab file for any jobs to be executed during this minute.
  • 94. The name of this crontab file will be the user's login name .

95. CRONTAB & CRONJOB continue..

  • TheScheduled jobs will be present in theCrontab files.

96. Cron tab fileswill be present in the 97. /var/ spool/ cron/ crontabs directory . 98. It Should be executed periodically at aspecific day, date and time . 99.

  • APACHE ( HTTP SERVER )

100. WHAT IS APACHE?

  • An open source web server used mostly for Unix, Linux and Solaris platforms.

101. It is very secure, fast, and reliable. 102. The name "Apache" derives from the word "patchy" that the Apache developers used todescribe early versions of their software. 103.

  • IMPLEMENTATION:
  • DBM databases for authentication

104. Customized responses to errors and problems 105. Virtual Hosts 106. Multiple DirectoryIndex directives 107. It has been tested thoroughly by both developers and users. 108. APACHE WEB SERVER

  • It provides a full range of Web server features, including CGI, SSL, and virtual domains.

109. Apache also supports plug-in modules for extensibility. 110.

  • The Apache WebServer has

111. HTTP 112. IIS 113. SSL 114. The Apache Web server has been ported to Windows and other network operating systems (NOS). 115. HTTP

  • HTTP is an Hypertext Transfer Protocol.

116. It provides a standard for Web browsers and servers to communicate. 117. It is a technical specification of a network protocol that software must implement. 118. HTTP is an application layer network protocol built on top of TCP. 119.

  • HTTPclients (such as Web browsers) and servers communicate viaHTTPrequest and response messages.

120. The three main HTTP message types are 121. GET, POST,andHEAD. 122. HTTPutilizes TCP port 80 by default. 123. *Though other ports such as 8080 canalternatively be used.*TheHTTPalso includes. ARP-(Address Resolution Protocol)

  • DHCP-(Dynamic Host Configuration Protocol) FTP(File Transfer Protocol)

124.

  • ARP
  • ARPconverts an Internet Protocol ( IP ) address to its corresponding physical network address.

125. It is implemented in the device drivers of networkoperating systems . 126. It is most commonly seen onEthernet networks, ATM, Token Ring , and otherphysical networks . 127.

  • DHCP
  • DHCPallows a computer to join anIP -based network without having a pre-configuredIPaddress.

128. DHCPis a protocol that assigns uniqueIPaddresses to devices, then releases and renews these addresses as devices leave and re-join the network. 129. FTP

  • FTPallows you to transfer files between two computers on the Internet.

130. FTPis a simple network protocol based on Internet Protocol. 131. SSL

  • Secure Sockets Layer.

132. SSL security technology helps to improve the safety of Internet communications. 133. SSL is a standard for encrypted client/server communication between network devices. 134. A network protocol, SSL runs on top of TCP/IP. 135. CONFIGURATION Instead of using a point-and-click graphic user interface (GUI) or Windows Registry keys as most other modern software packages, Apache generally relies on simple text files for its configuration settings. 136. CONFIGURING FILES

  • It uses a systemtext files for managing its configuration data.

137. These filesappear in Apache's./confdirectory and are designed to be edited by system administrators: 138. httpd.conf for general settings 139. srm.conf for resource settings 140. access.conf for security settings 141. RUNNING APACHE

  • Apache does not run from the inetd super server as many other network servers do.

142. It is configured to run standalone for better performance for incoming HTTP requests from client web browsers. 143. RUNNING APACHE continue..

  • A shell script wrapper is included to make starting, stopping, and restarting the server as simple as possible.

144. To start up Apache for the first time, just run: 145. # /usr/local/sbin/apachectl start 146. RUNNING APACHEcontinue..

  • You can stop the server at any time by typing:

147. # /usr/local/sbin/apachectl stop 148. After making changes to the configuration file for any reason, you will need to restart the server: 149. # /usr/local/sbin/apachectl restart 150. RUNNING APACHEcontinue..

  • To restart Apache without aborting current connections, run:

151. # /usr/local/sbin/apachectl graceful 152.

  • The family of.conf filessupports most,

153. but not all of Apache's configuration options. 154. Other important mechanisms for managingan Apache Web server include the 155. .htaccess file, the mime.types file, 156. andthe family of log files . 157. MySQL(DATABASE SOFTWARE) 158. WHAT IS MySQL?

  • The most popular open source SQLdatabase management system.

159. It is used to add,access and process data stored in a computer database. 160. It is aRDBMSstore in a separate tables rather than putting all the data in one big store room.It adds speed and flexibility. 161.

  • It is very fast,reliable and easy to use,

162. due to theconnectivity,speed ,security. 163. It works in Client/Server or embedded system. 164. A large amount of contributed MySQL software is available. WHAT IS MySQL? continue.. 165. WHAT IS MySQL? continue..

  • It consists of multithreaded SQL server that support:
  • Different backends,

166. Several different client programs, 167. Libraries, 168. Administration tools, 169. Wide range of API's. 170. WHY WE ARE USING MYSQL?

  • It is free .

171. It is fast comparing to other Database system such as PostgreSQL,mSQL. 172. It is light weight yet offers a rich and highly useful function set. 173. It is supported well by users community. 174. BASIC QUERIES

  • CREATECommand - is used to create a database/table.

175. SELECTCommand - is used to retrieve data from the database. 176. DELETECommand - is used to delete data from the database. 177. BASIC QUERY COMMANDS IN MySQL continue..

  • INSERTCommand - is used to insert data into a database.

178. UPDATECommand - is used to update the data in a table. 179. DROPCommand - is used to delete or drop the database/table. 180. SYNTAX FOR QUERY COMMANDS1. CREATECommand : The Create command is used to create a table by specifying the tablename, fieldnames and constraints as shown below:Syntax: $createSQL=("CREATE TABLE tblName"); 181. 2. SELECTCommand : It is used to select the records from a table using its field names, '*' is used to select all the fields in a table. Syntax: $selectSQL=("SELECT field_names FROM tablename"); 182. 3 .DELETECommand : The Delete command is used to delete the records from a table using conditions as shown below: Syntax: $deleteSQL=("DELETE * FROM tablename WHERE condition"); 183. 4. INSERTCommand : The Insert command is used to insert records into a table. The values are assigned to the field names as shown below: Syntax: $insertSQL=("INSERT INTO tblname(fieldname1,fieldname2..) VALUES(value1,value2,...) "); 184. 5. UPDATECommand : It is used to update the field values using conditions. This is done using 'SET' and the fieldnames to assign new values to them.Syntax: $updateSQL=("UPDATE Tblname SET (fieldname1=value1,fieldname2=value2,...) WHERE fldstudid=IdNumber"); 185. 6. DROPCommand: The Drop command is used to delete all the records in a table using the table name as shown below:Syntax: $dropSQL=("DROP tblName"); 186. ADVANCED QUERIES

  • INNER JOIN :

187. It is used to retrieve the data from all tables listed. 188. REPLACE: 189. It searches a character string and replaces characters found in search string. 190.

  • LTRIM:

191. It removes any leading (left-hand) spaces in a character string. 192. RTRIM : 193. It works like LTRIM, but it removes trailing spaces. 194.

  • SIGN:

195. It takes in a numeric expression and returns one of the following values based on the sign of the input number: 196. 1 -Input number is negative. 197. 0 -Input number is zero. 198. 1 -Input number is positive. 199. Null -Input number is null. 200.

  • SQRT:

201. It takes in a single numeric expression and returns its square root. 202. CEILING (CEIL): 203. It rounds up to the next nearest whole number. 204. F LOOR: 205. It rounds down to the next nearest whole number. 206.

  • DATE and TIME:
  • ADD_MONTHS :

207. Adds the supplied number of months to the supplied date. 208. CURRENT_DATE : 209. Returns the current date in the time zone set for the DB session. 210. EXTRACT : Extracts the specified date field from the supplied date. LAST_DAY : Returns of supplied date with the day shifted to the last day of the month. 211. PROCEDURES AND FUNCTIONS

  • Subroutines and functions can be made available to a single program or many; and that, of course, is what stored procedures and stored functions are - they are procedures (or subroutines) and functionsstoredin the database .

212. WHY USEPROCEDURES ANDFUNCTIONS? The real advantage to using stored procedures and stored functions is that they provide functionality which is platform and application independant. 213. WHY USEPROCEDURES &FUNCTIONS?continue.. For example, a team of developers may provide: a Visual Basic application on Windows

  • a Gambas application on Linux

214. a PHP application on a web server Withprocedures andfunctions the functionality only has to be developed once. 215. CREATING MySQL PROCEDURES A stored procedure is the same as a subroutine in that it cannot directly return a result, however it can receive variables that can be modified by the procedure. 216.

  • Thesevariablesare defined as:
  • in- the variable can only be used as an input to the procedure.

217. out- the variable can only be used as an output from the procedure. 218. inout- this is both an input to, and an output from, the procedure. 219. Procedures are always declared as:

  • Define the procedure name, inputs and outputs,body of the procedure. For example: delimiter //

create procedure circle_area (in r double, out a double)begin set a = r * r * pi();end //delimiter ; 220. RUNNINGMySQLPROCEDURES

  • A MySQL stored procedure is run by using thecallmethod:

221. callcircle_area(22, @a) ; 222. select@a ; 223. In this example1520.5308443375would be displayed on the screen. 224. CREATING MYSQL FUNCTIONS Unlike stored procedures stored functions always return a result, they will also be one oftwo types :

  • not deterministic- may produce different results for the same inputs .

225. deterministic- will always produce the same result for any given inputs 226.

  • Like procedures, all functions are created :
  • define the function name,

227. declare any inputs, 228. define the data type to be returned by the function, 229. state whether or not the function is deterministic, 230. define the body of the function . 231. For example : delimiter // create function circumference (r double) returns double deterministic begin declare c double; set c = 2 * r * pi();return c; end // delimiter ; 232. RUNNING MySQL FUNCTIONS Unlike stored procedures stored functions are used as part of a select statement:

  • selectcircumference(22);

233. In this case (for anyone that's interested) the result would be138.23007675795 . 234. IMPORT A MySQL DATABASE

  • This to restore data from a backup or toimport from another MySQL server.

235. Start by uploading the FILE.sql file to theserver where we will be running thiscommand. # mysql -u username -ppassword database_name < FILE.sql 236. EXPORT A MySQL DATABASE

  • Replace username, password and database_name with your MySQL username, password and database name.File FILE.sql now holds a backup of your database, download it to your computer.

237. # mysqldump -u username -ppassword database_name > FILE.sql 238. PHP 239. WHAT IS PHP?

  • PHP:Hypertext Preprocessor

240. It is an open source softwareand free to download to use. 241. It is a server-side scripting language, likeASPandscripts are executed on the server. 242. It supports many databases ( MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc .) 243.

  • The PHP is very simple for a beginner, but offers many advanced features for a professional script writer.

244. Three main areas where PHP scripts are used: 245. Server-side scripting 246. Command line scripting 247. Writing desktop applications 248. ADVANTAGES

  • It Support for both structural and Oopsprogramming.

249. It can plugin with most of the databasesand use of variables $$var. 250. Itsupport services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) 251. ADVANTAGES continue..

  • PHP has extremely useful text processingfeatures, from the POSIX Extended or Perlregular expressions to parsing XML documents.

252. Easy deployment and cost effective hosting. 253. Power ful built in functions. 254. DISADVANTAGES

  • Security flaws due to unknown vulnerabilities .

255. Not good to create desktop Applications. 256. WHY WE ARE USING PHP?

  • It enables programmers to create applications that will run on just about any computer, regardless of operating system.

257. If the computer can run web server software, the PHP application is portable across operating systems and environments ... PC, Mac, Linux,Windows, Internet, Intranet, etc. 258. BASIC PHP SYNTAX

  • * A PHP scripting block always starts with* For maximum compatibility, it isrecommendedthat to use the standardform (