Presentation is loading. Please wait.

Presentation is loading. Please wait.

NWCLUG 04/06/2010 Jared Moore L A M P.

Similar presentations


Presentation on theme: "NWCLUG 04/06/2010 Jared Moore L A M P."— Presentation transcript:

1 NWCLUG 04/06/2010 Jared Moore L A M P

2 Agenda All about LAMP How to get it L, A, M, P No LAMP? Discussion

3 What is LAMP? Application platform: OS, web server, database and scripting language Linux, Apache, MySQL and Perl/PHP/Python Term coined in German magazine c't in 1998 Term popularized by O'Reilly Technology stack was in use before the term, e.g. Slashdot

4 Overview PHP, Python, Perl (App Scripts) MySQL Apache Linux Internet

5 Why use LAMP? Free Easy of entry Everyone else is
Digg, Wikipedia, Yahoo, Slashdot, etc. Find out who else time wget -S -O /dev/null

6 What runs on LAMP? Content Management Systems
Movable Type, Drupal, Joomla, Wordpres, MediaWiki Frameworks Django, CakePHP, Symfony Other Gallery, Coppermine, phpMyAdmin, SquirrelMail

7 How to get a LAMP server Server from scratch
Select web server or LAMP server package depending on your distro Existing server Source Distro specific binaries Google for specific installation instructions Prebuilt Appliances rpath.org, turnkeylinux.org,

8 L is for Linux, duh!

9 A is for Apache

10 Apache Project officially stared in 1995
“A patchy server” -> “Apache” Most widely used web server % March according to Netcraft Modular design Abundant documentation Current stable version

11 MPM Multi-Processing Modules prefork or worker, OS specific MPM
Responsible for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests Only one can be running at a time Default is prefork

12 prefork Each request is handled by a separate process
A configurable number of processes are preforked leaving spares around Incoming requests always have a handler, as long as the max has not been reached Most common MPM for PHP on VPS or dedicated Configuration is important Too low and users complain Too high and server swaps

13 prefork configuration
Parameters StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients MaxRequestsPerChild 0

14 worker Multi-process multi-threaded
Each request is handled by a thread More requests are served using less resources worker and mod_php do not mix. Need worker and FastCGI

15 worker configuration Parameters StartServers 2 MaxClients 150
MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0

16 Apache modules Have specific functions
Static (compiled in) or shared (pluggable) Disabled/enabled as needed.

17 Module examples mod_rewrite Manipulate URLs mod_ssl
Provides SSL v2/v3 and TLS v1 support mod_alias Provides for mapping parts of the host filesystem in the document tree and for URL redirection mod_deflate Compress content before it is delivered to the client

18 M is for MySQL

19 MySQL Relational database Easy to use and administer
Small and powerful Upgrades easily because data format remains the same Current version is Now owned by Oracle. DUN-DUN-DUN! MySQL founders have forked other projects MariaDB, Drizzle

20 MySQL engines MyISAM InnoDB Non-transactional engine Lightweight Fast
Table level locking Bad for high traffic sites Indexes and data in separate files InnoDB Transactional engine Row level locking Index and data stored in same file More resource intensive

21 P is for PHP, Perl, Python

22 Scripting languages Interpreted, not compiled Easy to develop
Easy to deploy CGI, Inline, FastCGI Dynamic typing Rich libraries HTTP, file I/O, databases, string, math, etc.

23 Interpreter Modes CGI Oldest method of running dynamic content
Workflow: Request comes in Web server forks a new process New process executes an interpreter (e.g. Perl) A script is executed by interpreter, parameters passed Result is passed back Terminate the process Inline (modules) Interpreter inside the Apache process mod_php, mod_perl, mode_python

24 Interpreter Modes (Cont.)
FastCGI Similar to CGI Does not fork pre request Uses a socket to communicate with an existing process that holds the interpreter Apache runs with fewer dynamic processes mod_fastcgi or mod_fcgid

25 PHP Most widely used language on the web
Designed specifically for web development Many modes mod_php Easiest way of running PHP PHP is inside each and every Apache process Can be more memory intensive CGI FastCGI Current version is 5.3.2

26 Python mod_python FastCGI Framework Django washingtonpost.com

27 Perl Used to be popular as web site language mod_perl
Still in use by some sites (Slashdot)

28 Alternatives No LAMP

29 Operating Systems WAMP, yes the W means Windows *BSD Mac OS/X

30 Web servers Lighttpd Fast and less memory footprint Nginx
Young project Good for serving static content

31 Databases PostgreSQL Still community driven
Transactional features by default Not as easy as MySQL

32 Languages Ruby Ruby on Rails

33 Resources http://en.wikipedia.org/wiki/LAMP_(software_bundle)

34 The End Questions? Comments!


Download ppt "NWCLUG 04/06/2010 Jared Moore L A M P."

Similar presentations


Ads by Google