INSTALLING A LAMP IN UBUNTU 20.04
LAMP is a popular web server software suite. LAMP is named after the first letters of its components: Linux is the operating system, Apache is the web server, MySQL is the DBMS, PHP is the programming language used to create web applications.
In this article, we will look at how to install LAMP Ubuntu 20.04 in several ways: using the tasksel utility and manually using the package manager.
The tasksel utility allows you to literally install sets of packages of various programs into one command. It is designed for Debian, but can be used on Ubuntu as well. To install it, run the command in the terminal:
sudo apt -y install tasksel
Next, to install Lamp on Ubuntu, just run the command:
sudo tasksel install lamp-server
The installation will take some time, since the utility needs to download all the necessary packages. Once the installation is complete, you will have a fully working LAMP stack.
To check, type the IP address of the server where you installed LAMP in the address bar of the browser, localhost is selected as an example: http://localhost
PhpMyAdmin will now be available at your_server_ip / phpmyadmin. You can check if everything is working by simply opening this address in your browser: http://localhost/phpmyadmin
By default, you will not be able to log into phpMyAdmin as root, because this feature is disabled by default. For security reasons, it is not recommended to enable this option. In this case, you need to create a new user and give him root authority. To create a new user, go to the MySQL console by entering the command in the terminal:
sudo mysql -u root -p
After entering the root password for the MySQL user, enter the following commands:
CREATE USER ‘admin’ @ ‘localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON *. * TO ‘admin’ @ ‘localhost’;
FLUSH PRIVILEGES;
Using the first two commands, a new user named test was created, assigned a password and granted all possible privileges (such as creating, deleting, editing databases, tables, etc.). The third command renews the privileges set earlier.
If http://localhost/phpmyadmin/ does not open, add to the file
/etc/apache2/apache2.conf line
Include /etc/phpmyadmin/apache.conf then restart the apache
/etc/init.d/apache2 restart And you will be happy.
To install the required PHP extensions, run the command:
$ sudo apt -y install php-mysqli php-curl php-json php-cgi php-gd php-zip php-mbstring php-xml php-xmlrpc
Set a password for user Root :$ sudo passwd root
By default, root access to ubuntu is prohibited, but it can be unblocked. How to unblock root access to Ubuntu? Open the file /etc/gdm3/custom.conf. Here you will need to add AllowRoot = true in the [security] block. Like this:[security] AllowRoot = true
Then open the file /etc/pam.d/gdm-password and find a line like this:
auth required pam_succeed_if.so user! = root quiet_success
Comment it out by putting a # in front of it. Reboot the system and log in as user Root