0% found this document useful (0 votes)
224 views

Foss / Lamp Session - I

The document discusses the LAMP stack, which stands for Linux, Apache, MySQL, and PHP. It provides an overview of each component: Linux is an open-source operating system; Apache is a popular web server; MySQL is a database management system; and PHP is a scripting language commonly used to build dynamic web applications. The LAMP stack is one of the most common ways to develop enterprise-level web applications as all the components are open-source and free to use.

Uploaded by

Niyaman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
224 views

Foss / Lamp Session - I

The document discusses the LAMP stack, which stands for Linux, Apache, MySQL, and PHP. It provides an overview of each component: Linux is an open-source operating system; Apache is a popular web server; MySQL is a database management system; and PHP is a scripting language commonly used to build dynamic web applications. The LAMP stack is one of the most common ways to develop enterprise-level web applications as all the components are open-source and free to use.

Uploaded by

Niyaman
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 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. •Serve up content
•Execute JavaScript • HTML
•Execute Java applets •Images
•Send data to server •Documents, etc.
using CGI protocol •Process data received
from client
Serving Up Static Data
Server
www.example.com Disk

Request
from Client <html>
/var/www/html/
index.html
</html>
Content sent
to client No processing
of text file
Serving Up Dynamic Data
Server
www.example.com Disk

Request
from Client
#1 /usr/bin/perl
/var/www/cgi-bin/
a.cgi

Content sent
to client

Outputs
HTML Executes
Perl a.cgi
Serving Up Embedded data
Server
www.example.com Disk

Request
from Client <html>
/var/www/html/
a.html
</html>
Content sent
to client
Processes
embedded
HTML
Processor
•mod_perl
•PHP
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: GNU Project started
1985: Free Software Foundation was founded
1991: Linux development started
1998: Open Source Software Movement
1999 : 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 Licenses –
good if it is free Contract/ Agreement
(i.e. has no monetary between users and
value attached to developers of the
it)?!!!“ software
Patent -
Cost free protection to owners
or but allow others to
License Free? 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
▫ Source code provide product always provided
 may or may not include ▫ Licensee can modify or
permission to create enhance source code (create
modifications & enhance- “derivative works”)
ments • Restrictions on distribution
• Restrictions on distribution ▫ Licensees, subject to license
▫ Licensee has no right to terms, can:
share with those not make and distribute
defined as licensee users in copies of software
licenses build upon software to
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 • Linux Server can act as
different Client OS 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 Purpose Syntax
date to display the system date and time $ date
cal $ cal
to display the calendar
clear $ clear
clear the screen
who to say who is on the system $ who
whois internet user name directory service $ whois [-h host] identifier
whereis locate a binary, source and manual $ whereis filename
page files
whatis to display short descriptions of the $ whatis <cmd>
commands
--help to display usage summary and $ <cmd> --help
argument list
man to display the documentation for a $ man <cmd>
command
info it is similar to man, but often more in- $ info <cmd>
depth
Linux Filesystem
Hierarchical directory
structure (tree)

Every Linux filesystem


has one and only
– Hierarchical one root
directory structure (tree)

Root is always referred to


as ‘/’

Every file and directory is


located under this root
directory
About Directories
DIRECTORY TYPEOFINFORM ATIONSTORED
/root, /home/<usrname> User home directory
/boot kernel and boot loader
/etc S
M ystem
aintainco nfigu
all binratio
ary ann files
d System
/usr binary files
/var Server data
/lost+found related to recovery
/media and /mnt Foreign filesystem mount point
/media for removable media
and /mnt for non-removable
media
/dev Device directory
/lib M aintain library files
/opt M aintain SoSftware pack
ystem andageskernel
/proc information
/tmp 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 jack

exports 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 <changing directory>
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 <oldfile> <newfile> <oldfile>
$ rename <olddirectory> <newdirectory>
<olddirectory>
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 //used to clear the history

$ !! - to repeat the last command


$ !c - 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<tab>
$history

$ls -l tex<tab>
$ls -l text.txt
Thank you

You might also like