Plate - What is a LAMP stack? Special Cloud VDS images for quick server deployment LAMP Lamp stack description of its components

The LAMP stack is an open source software suite that is typically installed on a server to display dynamic websites and web applications. This abbreviation stands for Linux (operating system) with Apache web server installed, MySQL (database) for storing data and PHP with the help of which dynamic content is processed.

This manual will describe the steps to install LAMP on a VPS server with Ubuntu 16.04 server installed. Ubuntu - suitable for LAMP, as it is a Linux-based operating system.

Before continuing, we must have a server, virtual server or VPS with the Ubuntu 16.04 Server distribution installed, as well as the ability to connect to the server via SSH for a user with administrative (sudo) privileges. Actually the user himself with sudo privileges.

Instructions for setting up the LAMP stack (linux, apache, mysql, php) on Ubuntu 16.04 server

Step # 1 Installing Apache Web Server

The Apache web server is currently the most popular and easier to learn for beginners than Nginx. It is well described and there are enough examples on the Internet to configure and optimize it.

This is a great choice for website hosting.

To install Apache on Ubuntu 16.04, use the apt package manager. Package Manager allows you to install most of the software from the Ubuntu repositories

To start the installation, execute the commands:

sudo apt update sudo apt install apache2

sudo apt update

sudo apt install apache2

Since we use the sudo command, a password will be requested to elevate the user privileges to sudo and the commands will be executed with root privileges.

Setting Apache ServerName global variable

After installation, we need to add /etc/apache2/apache2.conf to the configuration file to eliminate the syntax error warning. It is necessary to configure the ServerName variable so that you do not receive a warning every time you check the Apache configuration:

Open the configuration file with the command:

sudo nano /etc/apache2/apache2.conf

We check the installation result by typing in the browser localhost or the public IP address of the server (if it is for example VPS).

http: // domain_or_IP_server_address

the browser should open the standard Apache web server page, as in the example:

If you see this page, your web server is installed and working correctly.

Step 2 - Install MySQL

Apache web server is installed and running. We install MySQL database management system. MySQL will provide work and access to the databases in which the website information will be stored.

Install MySQL with the following command:

sudo apt install mysql-server

The system will ask for the MySQL root (administrator) password. And offers to enable the validation module

VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin?

VALIDATE PASSWORD PLUGIN can be used to test passwords

and improve security. It checks the strength of password

and allows the users to set only those passwords which are

secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Click No and skip this step.

If you select Yes passwords that do not meet the specified criteria, MySQL will reject the error. This will cause problems if you use a weak password in programs that automatically configure MySQL user credentials (e.g. PhpMyAdmin). It is safer to disable this option and use strong unique passwords.

The next step is removing the ability to create databases as an anonymous user (used in test environments for products not suitable)

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y | Y for Yes, any other key for No):

By default, a MySQL installation has an anonymous user,

allowing anyone to log into MySQL without having to have

a user account created for them. This is intended only for

testing, and to make the installation go a bit smoother.

You should remove them before moving into a production

environment.

Remove anonymous users? (Press y | Y for Yes, any other key for No):

Click Yes

Disable the ability to connect to MySQL as root user remotely.

Disallow root login remotely? (Press y | Y for Yes, any other key for No):

Disallow root login remotely? (Press y | Y for Yes, any other key for No):

Click Yes

Delete test databases

By default, MySQL comes with a database named "test" that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y | Y for Yes, any other key for No):

By default, MySQL comes with a database named "test" that

anyone can access. This is also intended only for testing,

and should be removed before moving into a production

environment.

Remove test database and access to it? (Press y | Y for Yes, any other key for No):

Click Yes

MySQL is installed and general security settings are made.

Step 3 - Install PHP

PHP is a component that will process code to display dynamic content. It can run scripts, connect to our MySQL databases for information, and transfer processed content to a web server for display.

To install PHP, execute the following command:

sudo apt install php libapache2-mod-php php-mcrypt php-mysql

The contents of the file should look like this (added index.php):

   DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

The LAMP stack is the foundation for Linux hosted websites is the Linux, Apache, MySQL and PHP (LAMP) software stack.

LAMP Stand for: -

  1. L (Linex OS)
  2. A (Apache [ Local client server])
  3. M (MySQL Database)
  4. P (PHP)

A LAMP Stack is a set of open-source software that can be used to create websites and web applications. LAMP is an acronym, and these stacks typically consist of the Linux operating system, the Apache HTTP Server, the MySQL relational database management system, and the PHP programming language.

    Linux:  The operating system (OS) makes up our first layer. Linux sets the foundation for the stack model. All other layers run on top of this layer. Linux is the lowest-level layer and provides the operating system. Linux actually runs each of the other components. You are not specifically limited to Linux, however; you can easily run each of the other components on Microsoft®; Windows® ;, Mac OS X, or UNIX® if you need to.

    Apache: The second layer consists of web server software, typically Apache Web Server. This layer resides on top of the Linux layer. Web servers are responsible for translating from web browsers to their correct website. Apache provides the mechanics for getting a Web page to a user. Apache is a stable, mission-critical-capable server, and it runs more than 65 percent of all Web sites on the Internet. The PHP component actually sits inside Apache, and you use Apache and PHP together to create your dynamic pages.

    MySQL:  Our third layer is where databases live. MySQL stores details that can be queried by scripting to construct a website. MySQL usually sits on top of the Linux layer alongside Apache / layer 2. In high-end configurations, MySQL can be offloaded to a separate host server. MySQL provides the data-storage side of the LAMP system. With MySQL, you have access to a very capable database suitable for running large and complex sites. Within your Web application, all your data, products, accounts, and other types of information will reside in this database in a format that you can easily query with the SQL language.

    PHP:  Sitting on top of them all is our fourth and final layer. The scripting layer consists of PHP and / or other similar web programming languages. Websites and Web Applications run within this layer. PHP is a simple and efficient programming language that provides the glue for all the other parts of the LAMP system. You use PHP to write dynamic content capable of accessing the data in the MySQL database and some of the features that Linux provides.

In this article, we will consider a free and almost free set of software called LAMP. How is this abbreviation deciphered correctly? It consists of 4 popular technologies that consist in this bundle:Linux  - operating system;  - web server;MySQL  - DBMS;   - a programming language with which to create web resources.

This set of software is installed on the server to display dynamic websites and web applications. This platform allows you to install (deploy) most types of websites and network software on your server.

The LAMP combination is:

  1. linux server OS to perform the necessary tasks;
  2. apache web server, for which many additional modules have been created that solve the issue of collaboration between the web server and scripts written in various programming languages;
  3. pHP dynamic script server language (or Perl);
  4. MySQL DBMS, which demonstrates excellent SQL query execution speed and is ideal for small and medium-sized projects. MySQL runs on and is particularly usable.

Why might you need LAMP?

  • if necessary, an environment for web development and testing of applications that are written for LAMP. This is both for your own applications, and for any CMS you need. You can work on Windows and on Ubuntu;
  • if you need to make a productive web server on or on a dedicated server to host your projects;
  • if you need a server for version control systems;
  • for self-learning administration;
  • for economic purposes, to create your own server.

How weighty advantage of this assembly : It is great for quickly deploying an application due to its simple configuration, but still it offers few features in terms of scalability and isolation of components.

Among disadvantages of such an assembly   the following should be highlighted:

The application and the database use the same server resources (CPU, memory, I / O, etc.), which results in poor performance and makes it difficult to determine the source (application or database) of this problem. There is also interference in the implementation of horizontal scaling.

LAMP installation (Linux + Apache + MySQL + PHP / Perl / Python)   is a fairly widely used option for configuring servers with Ubuntu. There are a large number of applications that are open source and written using the LAMP application stack. Popular LAMP applications include wiki encyclopedias, content management systems (CMS), and management applications such as phpMyAdmin.

An important advantage of LAMP is its flexibility in selecting databases, web servers and scripting languages. Actual replacement for MySQL are PostgreSQL and SQLite. Python, Perl, and Ruby can be replaced by PHP. And Nginx, Cherokee, and Lighttpd are an alternative to Apache.

For quick installation of LAMP tasksel is used. Tasksel is a Debian / Ubuntu tool that installs several dependent packages on your system as a single task.

If you need  set up LAMP on our VPS servers , contact our round-the-clock technical support! Company Hyper Host ™  wishes you a pleasant work!

Technologies that HyperHost Hosting supports in more detail.

9946 times 2 Today viewed times

By a web application stack we mean a lot of open source software products: an operating system, a web server, a database server, and an executable code environment. The most famous and everyday stack is LAMP. This is an acronym for the web application stack based on free open source solutions.

Lamp- an acronym denoting a set (complex) of server software that is widely used on the World Wide Web. LAMP is named after the first letters of its constituent components:

    Linux-operating system Linux;

    A pache-web server;

    MariaDB / MySQL-DBMS;

    PHP is a programming language used to create web applications (in addition to PHP, other languages \u200b\u200bmay be implied, such as Perl and Python).

The acronym LAMP can be used to mean:

    Web server infrastructure

    Programming paradigms

    Software package

Although initially these software products were not developed specifically for working with each other, such a bundle has become very popular because of its flexibility, performance and low cost (all of its components are open and can be downloaded free of charge from the Internet). LAMP is part of most Linux distributions and is provided by many hosting companies.

Linux provides the reception / transmission of requests (controls the hardware) and is the core for everything higher - server, DBMS, language support.

Installation on Ubuntu

The following packages must be installed:

After running the apt-get update command to update the local list of packages, you can install these packages with a single apt-get install command:

After executing the above command, you will be asked to install these packages and some other dependencies. Press y and then ENTER to continue, and follow the rest of the instructions for setting the administrative password for MySQL.

This will allow you to install the minimum set of PHP extensions required to use PHP with MySQL.

Linux OS Features and Benefits

Free of charge.

Reliability.  Correct operation of the hardware of your PC will allow Linux to work for years without rebooting and freezes. And the Reset button will never be needed at all.

Security.  There are virtually no viruses on Linux. The construction of the operating system itself eliminates the work of malware.

Open source. This makes it possible to use and modify the code as you wish.

The main strengths of Apache are reliability and configuration flexibility. It allows you to connect external modules to provide data, use DBMS  for authentication  users, modify error messages, etc.

The flexibility of MySQL DBMS is provided by the support of a large number of table types: users can choose as table type Myisamsupporting full-text search and tables Innodbthat support transactions at the individual record level. Moreover, MySQL DBMS comes with a special EXAMPLE table type, which demonstrates the principles of creating new table types. Thanks to the open architecture and GPL licensing, new types of tables are constantly appearing in the MySQL DBMS.

Php - scripting language   general purpose, heavily used for developing web applications. Currently supported by the vast majority hosting providers  and is one of the leaders among the languages \u200b\u200bused to create dynamic websites .

They offer their users great opportunities for creating websites, storing them on the server and testing. Many probably heard that the correct configuration of Apache and MySQL makes it convenient to work with servers. It's time to get acquainted with LAMP, which unites them all, as well as understand how to install and configure the LAMP server in Ubuntu.

Installing LAMP allows you to create a web server.

LAMP is not a program, as you might think at first, and not a server. Behind this abbreviation is a stack or a set of server-side programs: Apache, MySQL, PHP. Hence the name - the first letters of each of these programs. The first letter is taken from Linux.

Learn more about the components.

  • Apache is a free HTTP server.
  • MySQL is a powerful, also free database management system. Used on many sites.
  • PHP is a programming language. Various web applications are often written on it.

All this software is useful and almost indispensable for hosting websites on the network. It remains to learn how to install it and use it.

LAMP Installation

LAMP is installed in several ways. Since this is a set of programs, you can download each of them individually, but it is more convenient to do this together. It’s easier to use Tasksel:

sudo tasksel install lamp-server

Tasksel is a special tool installed on Ubuntu, with which it is easy to load various software packages into the system. During installation, the system will ask you to enter a password for MySQL. It is necessary to do this.

Delete

You can also delete the stack completely with one command:

sudo tasksel remove lamp-server

All components will be installed: PHP 7, Apache, MySQL. For more convenient work, programs are added to startup. If you want to change this, do it through the settings: System - Settings - Launched applications. There, simply remove the LAMP components.

Installation and setup

Still, most probably would like to immediately get at least a test, but configured production server. Then follow the further instructions.


We set up the server and add the website

Setting up a LAMP server is the most important part, since installing MySQL, Apache, PHP 7 on Ubuntu is not difficult. Next, you will need to work with the program code.

sudo ln -s / etc / phpmyadmin / var / www

Open and then edit the server configuration:

sudo nano /etc/apache2/apache2.conf

Add the line to the end:

ServerName localhost: 80

Open the hosts file:

Add the line:

We make the configuration file for the new site:

‹VirtualHost *: 80›
ServerAlias \u200b\u200btestsite.ru www.testsite.ru
DocumentRoot /home/server/testsite.ru
‹Directory home / server / testsite.ru /›
AllowOverride All
‹/Directory›
‹/VirtualHost›

We put this file with root rights here: / etc / apache2 / sites-available /

We activate the site:

sudo a2ensite testsite.ru

Restart the server:

sudo /etc/init.d/apache2 restart

Creating a page for a website

We make the first page - the index.php file in the folder with the site (home / server / testsite.ru).

Enter there:

‹?
echo ‘Hello !!!’;
?›

In general, you can enter anything; you only need this to check the server’s performance.

Open our page through the browser: enter the web address in the line.

After that, we should see the cherished "Hello !!!". If this happens, then everything is configured correctly. Now in this folder you can place a full website that will be tested on LAMP. The folder, as well as the site address, of course, can be changed.

Now you know that installing and configuring MySQL, Apache, PHP (LAMP) on Ubuntu is not as scary as it seems. These are just the basic features of software. Over time, you will learn to use the full power of programs.

Devices