Lamp

  • Uploaded by: Niyaman
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Lamp as PDF for free.

More details

  • Words: 1,896
  • Pages: 42
FOSS / LAMP Session - I

Revathi J Bharathidasan University Technology Park (BUTP) Bharathidasan University

Web • The WWW may seem like magic, until we understand how it works • The web is usually accessed through a browser (Netscape, Mozilla & Internet Explorer, Opera, links – text based etc)

How it works? • Type a URL into the location box, the browser makes a network connection to the server. • The URL name maps to an Internet address. • The browser connects to URL using port 80.

How the web works www.example.com N Disk Internet/ Network Data base Client

Server

•Render HTML Images, etc. •Execute JavaScript •Execute Java applets •Send data to server using CGI protocol

•Serve up content • HTML •Images •Documents, etc. •Process data received from client

Serving Up Static Data Server www.example.com

Request from Client

Disk



Content sent to client

No processing of text file

/var/www/html/ index.html

Serving Up Dynamic Data Server www.example.com

Request from Client

Disk

#1 /usr/bin/perl

Content sent to client Outputs HTML Perl

Executes a.cgi

/var/www/cgi-bin/ a.cgi

Serving Up Embedded data Server www.example.com

Request from Client

Disk



Content sent to client

Processor •mod_perl •PHP

Processes embedded HTML

/var/www/html/ a.html

Open Source Definition • Technical definition:  Source code is available to users

• Functional definition:

Usually free or cheap to acquire and use Primarily developed by volunteers Anyone can modify and customize Users have direct input into development

FLOSS

(Free/Libre & Open Source Software) • It is generic name of “Free Software” and “Open Source Software” • Open Source Software is named by Eric S. Raymond (ESR), Larry M. Augustin & others

Brief History of FLOSS 1984: 1985: 1991: 1998: 1999 :

GNU Project started Free Software Foundation was founded Linux development started Open Source Software Movement More & more software Apache, Mozilla, MySQL, PostgreSQL, PHP, Perl, Python, Ruby … 200x: Got attention by Governments

GNU Project (1) • Richard M. Stallman (RMS) started the Project • Goal: UNIX compatible replacement of Free (Free as in Freedom) Operating System • Software from GNU: - GCC (GNU Compiler Collection) - GNU Debugger - GNU Binutils - BASH …

GNU - General Public License (GPL) • Most popular open source license • Most widely used • 85% of open source software • Activities started with the first GNU Project(1)

GNU’s GPL – A Big List • Operating systems: Linux, Solaris • Web & email servers: Apache and Sendmail/Postfix/Qmail • Web & db languages: PHP/Perl and MySQL/PostgreSQL • Web content management: Drupal, Plone, Bricolage • Virus & spam protection: ClamAV, SpamAssassin • Desktop apps: Open Office, Mozilla, gAIM • Security: GPG

What is Free Open Source Software (FOSS)? It’s a free Software! ….But What is “free” ?

“Free” for “Freedom” According to GNU, • Freedom to run the software for any purpose (freedom 0) • Freedom to modify, fix and customize (freedom 1) • Freedom to redistribute (freedom 2) • Freedom to improve program and release them in public (freedom 3) Note: Not all open source software is cost-free, and not all cost-free software is open source

Free/Open Source Software (FOSS) "How can anything be good if it is free (i.e. has no monetary value attached to it)?!!!“ Cost free or License Free?

Licenses – Contract/ Agreement between users and developers of the software

Patent protection to owners but allow others to learn from it Copy right Power to exclude

Proprietary Software Vs Open Source Software • Source code availability • Source code availability ▫ Source code not provided ▫ Source code to original product always provided ▫ Source code provide ▫ Licensee can modify or  may or may not include enhance source code (create permission to create “derivative works”) modifications & enhance• Restrictions on distribution ments ▫ Licensees, subject to license • Restrictions on distribution terms, can: ▫ Licensee has no right to make and distribute share with those not copies of software defined as licensee users in build upon software to licenses create modifications or other works.

WHAT IS LAMP? LAMP stands for Linux, Apache, MySQL and PHP One of the fast growing ways to develop enterprise-level web applications All these packages are Open Source products So, you are basically free to use them as ‘U’ wish, the only limit is your own imagination

Linux • What is Linux? Open Source Operating System Freely distributed Based on Unix Being developed by programmers all over the world Very popular Unix brand

Linux • It was developed by Linus Benedict Torvalds • POSIX compatible kernel written from scratch • Together with other software, becomes Operating System • Such OS-es are called as ‘Distributions’ - Redhat, Fedora - Debian - SUSE - Ubando - Mandrake etc.

Where I can use Linux? • Server OS ▫ Linux is best suited for Server ▫ Characteristics : Stable, Robust, Secure & High performance ▫ Linux offer all characteristics + Open Source and free OS

• Stand alone OS on PC ▫ Word Processing, Graphics, Software development, internet, e-mail, chatting and personal database management system

In network environment • Linux Server with different Client OS

• Linux Server can act as Proxy/Mail/ WWW/Router Server

We can use Linux for • Web Server • Software Development Workstation • Workgroup Server • Data Center Server activities such as FTP, Telnet, SSH, Web, Mail, Proxy, Proxy Cache Appliance etc.

Graphical & Text Interfaces • Graphical ▫ Most modern desktop Linux systems provide a graphical user interface (GUI). ▫ Linux systems use the X window system to provide graphics. • Text ▫ Use Ctrl+Alt+F1 to switch to a text console — logging in works as it does in X. ▫ Use Ctrl+Alt+F2, Ctrl+Alt+F3, etc., to switch between virtual terminals — usually about 6 are provided. ▫ Use Ctrl+Alt+F7, or whatever is after the virtual terminals, to switch back to X.

Login & Logout • Login ▫ User needs an account to use a computer. ▫ The most common method used to authenticate a user is a “login” process, by entering a valid user name and password. • Logout ▫ To exit from the shell, use the exit command. ▫ Pressing Ctrl+d at the shell prompt will also quit the shell. ▫ After logging out, a new login prompt should be displayed.

Linux Command Line Command date cal clear

Purpose to display the system date and time to display the calendar clear the screen

Syntax $ date $ cal $ clear

who

to say who is on the system

$ who

whois

internet user name directory service locate a binary, source and manual page files to display short descriptions of the commands to display usage summary and argument list to display the documentation for a command it is similar to man, but often more indepth

$ whois [-h host] identifier

whereis whatis --help man info

$ whereis filename $ whatis $ --help $ man $ info

Linux Filesystem Hierarchical directory structure (tree) Every Linux filesystem has one and only one root – Hierarchical directory structure (tree) Root is always referred to as ‘/’ Every file and directory is located under this root directory

About Directories DIRECTORY /root, /home/<usrname> /boot /etc /usr /var /lost+found /media and /mnt

/dev /lib /opt /proc /tmp

TYPEOFINFORM ATIONSTORED User home directory kernel and boot loader S ystem nfigu n files M aintainco all binratio ary an d System binary files Server data related to recovery Foreign filesystem mount point /media for removable media and /mnt for non-removable media Device directory M aintain library files are pack M aintain So Sftw ystem andages kernel information Temporary files

Paths • Navigating the Linux filesystem is always done using paths • A path describes how to locate a particular file or directory • Two types – Complete or Absolute path: specifies all of the steps (directories) you need to traverse to get to the file or directory you want starting from the root – Relative path: specifies how to get from where you are now to the file or directory you want

Paths (cont.) /

home

exports

jack

data

• Complete path to my home directory: /home/jack • Relative Path from data: ../../home/jack OR ~

Examples of Relative Path • In each case the file being referenced is /usr/share/doc/HTML/index.html Current directory Relative pathname /usr/share/doc/HTML index.html /usr/share/doc HTML/index.html /usr/share doc/HTML/index.html /usr share/doc/HTML/ index.html / usr/share/doc/ HTML/index.html

Paths (cont.) • Separator between directories uses a forward slash: ‘/’ /home/jack

• To go up one directory use double dots: ‘..’ ../../home/jack

• To refer to your home directory use tilde: ~ ~jack

pwd & cd Command • pwd - Prints current working directory • (where we are right now) • Syntax : $ pwd • cd - Change current directory • Argument specifies path of • the directory you want to goto • Syntax : $ cd

Listing directory contents • $ ls : To list the content of the directory or a specified directory • $ ls -l : To list the long list details from the directory • $ ls -a : To list the hidden files and directories from the directory • $ ls -R : To list the recursive through subdirectories • $ ls -d : To list the directory names not their contents

Copying files and directories $ cp - to copy the source files and directories to the destination path. Note, the destination path must be a directory. Syntax: $ cp [option] <source file> <destination> $ cp [option] <multiple source file> <destination> Type of – option, i - interactive mode, ask before overwriting r - recursive mode, recursively copy an entire things f - force mode, force to copy a directory or file.

Moving files and Directories • The mv (move) command is used to move files and directories from source to destination. • The mv and cp functions are same, the only different is that cp results in matching identical files; with mv, the source disappears, leaving only the destination file(s). Syntax: $ mv <source> <destination>

Renaming Files and directories • rename command is used to rename the file and directorie. Syntax: $ rename $ rename

Creating files and directories • To create a empty file use the touch command. (Note, we can create multiple files in a single command) $ touch filename $ touch filename1 filename2 filename3 • To create a directory using mkdir command $ mkdir directoryname $ mkdir –p /directoryname/{dir1,dir2,dir3} ( create multiple subdirectory into /directoryname)

Removing files and directories • rm (remove) command is used to remove files and directories depending upon the option. Syntax: $ rm [option] file $ rmdir dir Type of – option, i - interactive mode, ask before overwriting r - recursive mode, recursively copy an entire things f - force mode, force to copy a directory or file.

History • The history command is used to list the entered commands with numbers. Syntax: $ history $ history –c $ !! $ !c -

//used to clear the history

to repeat the last command to repeat last command that start with ‘c’ $ !n - to repeat a command by its number in history output.

Use of Shortcut Key • The tab key can be used to complete command or a file name. • Press tab key to complete command line Example $his $history $ls -l tex $ls -l text.txt

Thank you

Related Documents

Lamp
November 2019 54
Lamp
May 2020 40
Lamp
November 2019 58
Lamp
November 2019 58
Lamp
November 2019 55
Lamp Lighting.docx
May 2020 13

More Documents from "erick apple"

Shell Scripting
November 2019 24
Lamp Chapter3
November 2019 28
Lamp Chapter2 New
November 2019 17
Lamp
November 2019 54