Link Search Menu Expand Document

LAMP Stack - Linux, Apache, MySQL and PHP

Table of contents

Prerequisite

  1. Using SSH key, read on How to generate SSH on Mac.
  2. Knowing and change user permission, read on User & Permission.
  3. For micro image size, read on SwapFile.

Install Apache

apt-get install apache2 -y
service apache2 restart
service apache2 status

Config Apache

  1. Get SSL/TLS certificate from CF Origin Certificate
  2. Create public and private key files on the server

    certificate

     mkdir /etc/ssl
     nano /etc/ssl/cf_public.crt
    

    private key

     nano /etc/ssl/cf_private.key
    

Remove Apache

sudo apt autoremove
sudo apt remove apache2.*
dpkg -S `which apache2`
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
  # or, sudo apt-get purge apache2 apache2-utils apache2-bin apache2.2-common
sudo service apache2 start
  # if removed, returns: apache2: unrecognized service

Install LAMP using Tasksel

sudo apt install tasksel 
sudo tasksel install lamp-server 
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc