Security, PKI, sys and network admins

How to install LAMP (Linux, Apache, MySQL, PHP) web server

Install LAMP (Linux Apache, MySQL, PHP) web server

We sometimes find ourserlves in the position where we need to install a LAMP (Linux, Apache, MySQL, PHP) web server.

Ubuntu server 18.04

  1. Install basic Ubuntu 18.04 server

    If you’re not familiar with this, you can easily learn how to install Ubuntu server 18.04 LTS.

    Install LAMP (Linux Apache, MySQL, PHP) web server

    Ubuntu 18.04 LTS, basic server installation

  2. Update Ubuntu 18.04
  3. We’re going to make sure you have the latest version with all its updates by executing the code below in the terminal.
    sudo apt-get update
    sudo apt-get upgrade -y

  4. Install the Ubuntu UNZIP package:
  5. sudo apt-get install unzip -y

  6. Install Apache2 web server
  7. sudo apt-get install apache2 apache2-doc -y

  8. Install PHP
  9. sudo apt-get install mysql-server php7*-mysql -y

  10. View status web traffic for the Ubuntu server firewall
  11. sudo ufw app list
    The “Apache Full” profile shows you if you have enabled or disabled web traffic through your Ubuntu firewall.

  12. Allow web traffic through the Ubuntu server firewall

  13. sudo ufw allow in "Apache Full"

    The “Apache Full” profile allows web traffic to your HTTP port (80) and HTTPS (443).
    sudo nano /etc/apache2/mods-enabled/dir.conf
    sudo mysql
    select user, authentication_string,plugin, host from mysql.user;
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'ThisMustB3aStrongPassword';
    sudo mysql_secure_installation
    sudo apt install php libapache2-mod-php php-mysql -y
    sudo apt-get install php7.2-gd -y
    sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
    sudo apt-get autoremove -y
    sudo apt-get autoclean

Leave a Reply

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