Installing Lamp in Ubuntu

Anonim

Installing Lamp in Ubuntu

The software package called LAMP includes the OS on the Linux kernel, the Apache web server, the MYSQL database and PHP components used for the site engine. Next, we describe in detail the installation and primary setting of these additions, taking the latest version of Ubuntu for the example.

Install Lamp Programs Set in Ubuntu

Since the format of this article already implies that you have the installed Ubuntu on your computer, we will skip this step and go to other programs immediately, however, you can find instructions on the topic of interest to you, having familiarized yourself with our other articles on the following links.

Read more:

Installing Ubuntu on VirtualBox

Step-by-step Linux installation guide from flash drive

Step 1: Install Apache

Let's start with the installation of an open web server called Apache. It is one of the best option, so it becomes a choice of many users. In Ubuntu, it is placed through the "Terminal":

  1. Open the menu and start the console or click Ctrl + Alt + T. key combination.
  2. Run the terminal in the Ubuntu operating system

  3. First, update the system repositories to make sure all the necessary components are available. To do this, write the Sudo APT-Get Update command.
  4. Check for updates in Ubuntu OS

  5. All actions through Sudo runs with root access, so be sure to specify your password (it is not displayed when entering).
  6. Enter password to access Ubuntu

  7. Upon completion, enter Sudo APT-Get Install Apache2 to add Apache to the system.
  8. Start the Apache Installation Team in Ubuntu

  9. Confirm the addition of all files by selecting the D. response option
  10. Confirm Adding Files for Apache in Ubuntu

  11. We will test the web server work, running Sudo Apache2ctl ConfigTest.
  12. Run APACHE Syntax Check in Ubuntu

  13. The syntax must be normal, but sometimes a warning is about the need to add ServerName.
  14. APACHE Syntax Check Information in Ubuntu

  15. Add this global variable to the configuration file to avoid the appearance of warnings in the future. Run the file itself through sudo nano /etc/apache2/apache2.conf.
  16. Open Apache configuration file in Ubuntu

  17. Now run the second console, where you execute the IP Addr Show Eth0 command | Grep inet | awk '{print $ 2; } '| Sed 'S /\/.*_$ //' to find out your IP address or server domain.
  18. Find out information about IP address or domain in Ubuntu

  19. In the first "terminal", go down to the bottom of the opened file and enter the servername + domain name or the IP address that you have just learned. Save the changes through Ctrl + O and close the configuration file.
  20. Add a global variable for Apache in Ubuntu

  21. Testing again to make sure there is no error, and then restart the web server through the Sudo SystemCTL Restart Apache2.
  22. The second check of Apache syntax in Ubuntu

  23. Add Apache to autoload, if necessary, so that it starts with the SUDO SystemCTL Enable Apache2 operating system.
  24. Add Apache to Ubuntu autoload

  25. It remains only to start a web server to check the stability of its work, use the Sudo SystemCTL Start Apache2 for this.
  26. Run the apache web server in Ubuntu

  27. Run the browser and go to Localhost. If you hit the Apache's main page, then everything functions correctly, proceed to the next step.
  28. Go to the standard Apache page through the browser in Ubuntu

Step 2: Install MySQL

The second action will be the addition of MySQL database, which is also performed through the standard console using the commands available in the system.

  1. Write a Sudo Apt-Get Install MySQL-Server in the Terminal and click on ENTER.
  2. A command to install the database in Ubuntu

  3. Confirm Adding new files.
  4. Confirm Adding Database Setup Files to Ubuntu

  5. It is necessary to secure the use of the MYSQL environment, so provide protection using a separate add-on, which is installed via sudo mysql_secure_installation.
  6. Install database protection in Ubuntu

  7. Setting the plug-in settings for password requirements does not have a single instruction, since each user is repelled from its own solutions in terms of validation. If you want to install requirements, enter in the C console y when requesting.
  8. Start setting up password requirements in Ubuntu

  9. Next, you need to choose the level of protection. First, familiarize yourself with the description of each parameter, and then select the most suitable.
  10. Select Password Requirements in Ubuntu

  11. Install a new password to provide root access.
  12. Install a new password for database in Ubuntu

  13. Further, you will display various security settings, read them and accept or refuse if you consider it necessary.
  14. Advanced database security settings in Ubuntu

With the description of another method of installation, we advise you to get acquainted in a separate article, which you will find at the following link.

On this installation procedure and PHP settings for Lamp can be considered successfully completed.

READ ALSO: PHP Installation Guide in Ubuntu Server

Today we touched on the installation and basic setting of LAMP components for the Ubuntu operating system. Of course, this is not all the information that can be provided on this topic, there are many nuances associated with the use of several domains or databases. However, thanks to the above instructions, you can easily prepare your system for the correct functioning of this software package.

Read more