nguyenminh

quick install lamp on ubuntu

What is a LAMP Stack?

A LAMP (Linux, Apache, MySQL, PHP) stack is a common, free, and open-source web stack used for hosting web content in a Linux environment. Many consider it the platform of choice on which to develop and deploy high-performance web apps.

This guide shows how to install and test a LAMP stack on Ubuntu 18.04 (LTS).

    1  cd /
    2  ls
    3  sudo apt update && sudo apt upgrade
    4  sudo apt update && sudo apt upgradesudo apt install tasksel
    5  sudo apt install tasksel
    6  apt install tasksel
    7  sudo tasksel install lamp-server
    8  php -v
    9  mysql
   10  mysql -u root -p
   11  mysql_secure_installation
   12  mysql -u root -p
   13  cd /etc/apache2/sites-available/
   14  ls
   15  cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/nguyenminh.me.conf
   16  ls
   17  nano  nguyenminh.me.conf
   18  sudo mkdir -p /var/www/html/nguyenminh.me/{public_html,logs}
   19  sudo a2ensite example.com.conf
   20  a2ensite nguyenminh.me.conf
   21  systemctl reload apache2
   22  cd /var/www/html/nguyenminh.me/public_html
   23  git status
   24  cd /
   25  sudo add-apt-repository ppa:certbot/certbot
   26  apt install python-certbot-apache
   27  sudo certbot --apache -d nguyenminh.me
   28  ls
   29  cd /
   30  cd /
   31  ls
   32  cd /
   33  cd /
   34  history
   35  cd /etc/apache2/sites-available/
   36  ls
   37  nano  nguyenminh.me.conf
   38  sudo certbot --apache -d nguyenminh.me
   39  ls
   40  sudo a2dissite nguyenminh.me-le-ssl.conf
   41  cd /etc/apache2/sites-enabled/
   42  ls
   43  sudo certbot --apache -d nguyenminh.me
   44  cd /etc/apache2/sites-available/
   45  ls
   46  sudo a2dissite nguyenminh.me-le-ssl.conf
   47  rm -rf  nguyenminh.me-le-ssl.conf
   48  sudo a2dissite nguyenminh.me.conf
   49  systemctl reload apache2
   50  cd /etc/apache2/sites-available/
   51  ls
   52  nano nguyenminh.me.conf
   53  sudo certbot --apache -d nguyenminh.me
   54  ls
   55  a2ensite nguyenminh.me.conf
   56  systemctl reload apache2
   57  sudo certbot --apache -d nguyenminh.me
   58  cd /etc/apache2/sites-enabled/
   59  ls
   60  a2dissite nguyenminh.me.conf
   61  systemctl reload apache2
   62  cd /etc/apache2/sites-available/
   63  ls
   64  a2disstie nguyenminh.me.conf
   65  a2disite nguyenminh.me.conf
   66  sudo a2dissite nguyenminh.me.conf
   67  sudo a2dissite 000-default-le-ssl.conf
   68  systemctl reload apache2
   69  ls
   70  rm 000-default-le-ssl.conf
   71  rm  nguyenminh.me.conf
   72  cd /etc/apache2/sites-enabled/
   73  ls
   74  nano nguyenminh.me.conf
   75  a2ensite  nguyenminh.me.conf
   76  ls
   77  nano nguyenminh.me.conf
   78  a2ensite  nguyenminh.me.conf
   79  ls
   80  rm nguyenminh.me.conf
   81  ls
   82  nano nguyenminh.me.conf
   83  a2ensite nguyenminh.me.conf
   84  a2dissite nguyenminh.me.conf
   85  apache2 -S
   86  ls
   87  rm nguyenminh.me.conf
   88  cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/nguyenminh.me.conf
   89  ls
   90  cd /etc/apache2/sites-available/
   91  ls
   92  nano nguyenminh.me.conf
   93  a2ensite nguyenminh.me.conf
   94  sudo certbot --apache -d nguyenminh.me
   95  cd /var/www/html/nguyenminh.me/public_html/storage/framework
   96  cd ..
   97  chmod -R 777 framework/*
   98  cd ..
   99  ls
  100  php artisan config:clear
  101  php artisan view:clear
  102  php artisan config:clear
  103  php artisan cache:clear
  104  php -v
  105  sudo add-apt-repository ppa:ondrej/php
  106  sudo apt update
  107  sudo apt install php7.2-xml php7.2-fpm php7.2-gd php7.2-curl php7.2-mysql php7.2-dev php7.2-cli php7.2-common php7.2-mbstring php7.2-intl php7.2-zip php7.2-bcmath
  108  service apache2 restart
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/nguyenminh.me.conf


<VirtualHost *:80>
        ServerName nguyenminh.me
        DocumentRoot /var/www/html/nguyenminh.me/public_html/public/
        ErrorLog /var/www/html/nguyenminh.me/logs/error.log
        CustomLog  /var/www/html/nguyenminh.me/logs/access.log combined
    <Directory "/var/www/html/nguyenminh.me/public_html/public/">
        DirectoryIndex index.html index.htm index.php
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Categorised in: Tổng hợp

0 Comments for "quick install lamp on ubuntu"

One thought on “quick install lamp on ubuntu”

  1. admin says:

    So, just run following command for update php version.

    Install PHP 7.3

    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt install php7.3
    sudo apt install php7.3-common php7.3-cli php7.3-bcmath php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-readline php7.3-xml php7.3-zip php7.3-fpm
    sudo a2dismod php7.2
    sudo a2enmod php7.3
    sudo service apache2 restart

Leave a Reply

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