Linux

Ubuntu install lamp stack last version






LAMP is a group of Server hosting that can be run Dynamic website and web application models. It is known as open-source software model for using to manage and run online website with your server machine.

How to install LAMP ( Apache, MySQL, PHP)? The easy way, you need to install Ubuntu LTS last version and follow below steps:

Step 1: Ubuntu install Apache and upgrade Ubuntu system. First, you have to update and upgrade Ubuntu System and install Apcache2.

$ sudo apt update && sudo apt install apache2

Step 2: Ubuntu adjust the firewall to allow wave traffic. You need to enable the UFW firewall on Ubuntu System and make sure your firewall can use HTTP and HTTPS.

$ sudo ufw app list

Step 3: Enalbe port 80 and 443

$ sudo ufw app info “Apache Full”

Step 4: allowing income your website HTTP and HTTPS.
After you done, you can testing with web browser or IP Address, after that it will be shown default picture.

$ sudo ufw allow in “Apache Full”

Open http://your_server_ip on web browser.

Step 5: Ubuntu install MySQL. You need to MySQL to manage data, so you can install by below way.

$ sudo apt install mysql-server

Note: When you install MySQL you do not have to run sudo apt update,  and you need input more info following by picture on the below.

Ubuntu add MySQL security

$ sudo mysql_secure_installation

$ sudo mysql

mysql>SELECT user,authentication_string,plugin,host FROM mysql.user;

mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘mypassword’;

mysql> FLUSH PRIVILEGES;

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;

mysql> edit

Step 6: Ubuntu install PHP. PHP is an important program in order to processing code and it will be shown code of website to form of dynamic content. You can install PHP by guid below.

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

$ sudo nano /etc/apache2/mods-enabled/dir.conf

default
<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
You need change to 

Change to

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

$ sudo systemctl restart apache2

$ sudo systemctl status apache2

$ apt search php- | less

$ apt show php-cli

$ sudo apt install php-cli

The last of how to install LAMP. So you can test your web server by guid below.

$ sudo nano /var/www/html/info.php

add code on info.php

<?php
phpinfo();
?>

Open your browser type: http://your_server_ip/info.php

When test work all you don’t forget delete code test

$ sudo rm /var/www/html/info.php

Conclusion The way of install LAMP stack which bunch of Apache, MySQL, and PHP for for processing web server. This is the first program that you need to do to manage your website.

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

To Top