2. LAMP TECHNOLOGY
3. Linux (operating system), 4. Apache HTTP Server, 5. MySQL (database software) and 6. PHP. 7.
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.
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
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
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?
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?
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..
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:
38. Security. 39. Choice(freedom). 40. Software. 41. Hardware. 42. DISADVANTAGES:
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 -
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..
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: < / >
61. The starting point of your directory structure. 62. Every other file and directory onsystem is under the root directory. 63.
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.
67. < /dev > 68. The devices that are available to a Linux system. 69.
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.
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.
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
84. emacs-GNU editor and fullyintegrated user environment 85. ex -Powerful line-based editor(integrated with vi) 86. SOME OF THE LINUX EDITORS continue..
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
92. Cron is a system deamon that keeps sleeping most of the time. 93. CRONTAB & CRONJOB continue..
95. CRONTAB & CRONJOB continue..
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.
100. WHAT IS APACHE?
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.
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
109. Apache also supports plug-in modules for extensibility. 110.
111. HTTP 112. IIS 113. SSL 114. The Apache Web server has been ported to Windows and other network operating systems (NOS). 115. HTTP
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.
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)
124.
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.
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
130. FTPis a simple network protocol based on Internet Protocol. 131. SSL
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
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
142. It is configured to run standalone for better performance for incoming HTTP requests from client web browsers. 143. RUNNING APACHE continue..
144. To start up Apache for the first time, just run: 145. # /usr/local/sbin/apachectl start 146. RUNNING APACHEcontinue..
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..
151. # /usr/local/sbin/apachectl graceful 152.
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?
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.
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..
166. Several different client programs, 167. Libraries, 168. Administration tools, 169. Wide range of API's. 170. WHY WE ARE USING MYSQL?
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
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..
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
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.
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.
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.
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.
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
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
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.
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:
create procedure circle_area (in r double, out a double)begin set a = r * r * pi();end //delimiter ; 220. RUNNINGMySQLPROCEDURES
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 :
225. deterministic- will always produce the same result for any given inputs 226.
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:
233. In this case (for anyone that's interested) the result would be138.23007675795 . 234. IMPORT A MySQL DATABASE
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
237. # mysqldump -u username -ppassword database_name > FILE.sql 238. PHP 239. WHAT IS PHP?
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.
244. Three main areas where PHP scripts are used: 245. Server-side scripting 246. Command line scripting 247. Writing desktop applications 248. ADVANTAGES
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..
252. Easy deployment and cost effective hosting. 253. Power ful built in functions. 254. DISADVANTAGES
255. Not good to create desktop Applications. 256. WHY WE ARE USING PHP?
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
Top Related