LAMP (software bundle)
The acronym LAMP refers to first letters of the four components of a solution stack, composed entirely of free and open-source software, suitable for building high-availability heavy-duty dynamic web sites, and capable of serving tens of thousands of requests simultaneously.
The meaning of the LAMP acronym depends on which specific components are used as part of the actual bundle:
- Linux, the operating system (i.e. not just the Linux kernel, but also glibc and some other essential components of an operating system)
- Apache HTTP Server, the web server
- MySQL, MariaDB or MongoDB, the database management system
- PHP, Perl, or Python, the scripting languages (respectively programming languages) used for dynamic web pages and web development.
The exact combination of the software included in a LAMP stack is prone to variation, for example Apache web server can be replaced by some other web server software. Though the original authors of these programs did not design them to work as a component of the LAMP stack, the development philosophy and tool sets are shared and were developed in close conjunction, so they work and scale very well together. The software combination has become popular because it is entirely free and open-source software, which means that each component can be adapted to the underlying hardware and customized to meet the specification as exactly as possible, without the slightest vendor lock-in. The complete software stack is also free of cost, maximizing the available budget for tailoring the hardware and software.
Due to the nature of free and open-source software and the ubiquity of its components, each component of the LAMP stack is very well tested regarding performance and security. At the same time, there is an abundance of experienced contractors to do the tailoring required for various customizations, or for complex setups. There is also constant development going on.
The components of the LAMP stack are present in the software repositories of most (if not all) Linux distributions, giving any end-user a simple way to install, set up and operate an initial LAMP stack out of the box. The web presence of a small company that does not have a high hit count and is not prone to frequent attacks, can therefore be administered by another small company, by a one man company or even by a student.
The LAMP bundle can be and often is combined with many other free and open-source software packages such as, for example:
- netsniff-ng for security testing and hardening
- Snort, an intrusion detection (IDS) and intrusion prevention system (IPS)
- RRDtool for diagrams
- Nagios, Collectd or Cacti, for monitoring.
Linux is a Unix-like and POSIX-compliant computer operating system assembled under the model of free and open source software development and distribution. The main form of distribution are Linux distributions, usually providing complete LAMP setups out of the box through their package management systems. Of the most widespread Linux distributions, as of 1 October 2013, 58.5% of web server market share is shared between Debian and Ubuntu, while RHEL, Fedora and CentOS together share 37.3%.
Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation. Released under the Apache License, Apache is open-source software. A wide variety of features is supported, and many of them are implemented as compiled modules which extend the core functionality of Apache. These can range from server-side programming language support to authentication schemes.
MySQL, MariaDB, MongoDB
MySQL is a multithreaded, multi-user, SQL database management system (DBMS) now owned by Oracle Corporation. MySQL has been owned by Oracle Corporation since January 27, 2010 through the purchase of Sun Microsystems. Sun had originally acquired MySQL on February 26, 2008. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements.
MariaDB is a fork of MySQL. MongoDB is a widely used open-source NoSQL database. MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (calling the format BSON), making the integration of data in certain types of applications easier and faster.
PHP, Perl, Python
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. It has also evolved to include a command-line interface capability and can be used in standalone graphical applications.
Perl is a family of high-level, general-purpose, interpreted, dynamic programming languages. The languages in this family include Perl 5 and Perl 6. The Perl languages borrow features from other programming languages including C, shell scripting (sh), AWK, and sed. They provide powerful text processing facilities without the arbitrary data-length limits of many contemporary Unix commandline tools, facilitating easy manipulation of text files. Perl 5 gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its parsing abilities.
Python is a widely used general-purpose, high-level programming language. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library. Like other dynamic languages, Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts.
Variants and equivalents on other platforms
With the growing use of LAMP, variations and retronyms appeared for other combinations of operating system, web server, database, and software language. For example the equivalent installation on a Microsoft Windows operating system is known as WAMP. An alternative running IIS in place of Apache called WIMP. Variants involving other operating systems include MAMP (Macintosh), SAMP (Solaris), FAMP (FreeBSD) and iAMP (iSeries).
The web server or database management system also vary. LEMP is a version where Apache has been replaced with the more lightweight web server Nginx. A version where MySQL has been replaced by PostgreSQL is called LAPP, or sometimes by keeping the original acronym, LAMP (Linux / Apache / Middleware (Perl, PHP, Python, Ruby) / PostgreSQL).
A server running LAMP may be colloquially known as a lamp box, punning on the type of post box. The GNU project is advocating people to use the term "GLAMP" since many distributions of what is known as "Linux" include the GNU tools as well as the Linux kernel.
High availability and load balancing
Specific solutions are required for web sites serving large numbers of requests, or providing services demanding no downtimes. Usual approach for the LAMP stack involves multiple web and database servers, with additional components providing logical aggregation of resources provided by each of the servers, and distribution of the workload across multiple servers. Such aggregation for web servers is usually provided by a form of load balancer placed in front of them, such as Linux Virtual Server (LVS). For the database servers, MySQL provides internal replication mechanisms, implementing a master/slave relationship between the original database (master) and its copies (slaves).
Such setups are improving the availability of LAMP instances by providing various forms of redundancy, making it possible for a certain number of instance's components (separate servers) to go down without causing interruptions to provided services. Also, such redundant setups allow for hardware failures resulting in data loss on separate servers, without the stored data actually becoming lost. Besides higher availability, such LAMP setups are providing almost linear improvements in performance for services where the number of internal database read operations is much higher than the number of write/update operations.
- List of Apache–MySQL–PHP packages
- LYME – a solution stack based on Erlang
- RRDtool – database tool to handle time-series data
- Nagios – monitoring tool
- Snort – intrusion detection and prevention system
- WISA software bundle
- "Debian/Ubuntu extend the dominance in the Linux web server market". W³Techs. 2013-10-21.
- "June 2013 Web Server Survey". Netcraft. Retrieved 2013-06-12.
- Top Reasons for Product Managers to Embed MySQL on [mySQL.co]
- Robin Schumacher & Arjen Lentz Dispelling the Myths
- Charles Babcock, InformationWeek Sun Locks Up MySQL, Looks To Future Web Development
- A LAPP appliance on [turnkeylinux.org]
- "Introduction: What can PHP do?". PHP Manual. Retrieved 2009-03-05.
- "GPL-Incompatible, Free Software Licenses". Various Licenses and Comments about Them. Free Software Foundation. Retrieved 2012-03-11.
- "About Perl". perl.org. Retrieved 2013-04-20. ""Perl" is a family of languages, "Perl 6" is part of the family, but it is a separate language which has its own development team. Its existence has no significant impact on the continuing development of "Perl 5"."
- Ashton, Elaine (1999). "The Timeline of Perl and its Culture (v3.0_0505)".
- Wall, Larry, Tom Christiansen and Jon Orwant (July 2000). Programming Perl, Third Edition. O'Reilly Media. ISBN 0-596-00027-8.
- Smith, Roderick W. (21 Jun 2002). Advanced Linux Networking. Addison-Wesley Professional. p. 594. ISBN 978-0-201-77423-8.
- "Programming Language Trends - O'Reilly Radar". Radar.oreilly.com. 2006-08-02. Retrieved 2013-07-17.
- "About Python". Python Software Foundation. Retrieved 24 April 2012., second section "Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files."
- "Setting up a LEMP Stack (Linux, Nginx, MySQL, PHP5) on Ubuntu 9.04". chrisjohnston.org. 2009-04-29. Retrieved 2014-01-22.
- "Featured Users". PostgreSQL. Retrieved 2014-01-22.
- "Words to Avoid (or Use with Care) Because They Are Loaded or Confusing - GNU Project - Free Software Foundation". Gnu.org. 2014-01-17. Retrieved 2014-01-22.
- Dragan Simic; Srecko Ristic; Slobodan Obradovic (April 2007). "Measurement of the Achieved Performance Levels of the WEB Applications With Distributed Relational Database" (PDF). Electronics and Energetics 20 (1). Facta Universitatis. p. 31–43. Retrieved 30 January 2014.
- Install a LAMP server on Ubuntu Linux
- Install a LAMP server on Debian GNU/Linux
- Install a LAMP server on SUSE Linux
- Install a LAMP server on Fedora Linux
- Install a LAMP server on CentOS Linux
- Install a LAMP server on FRITZ!Box