• Home
  • WP tuts
  • Hosting talk
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • Speed up wordpress
  • Pc world
  • Services
  • About Me

RAaz Kumar .com

wordpress tutorials seo hosting etc

install lemp Linux, Nginx 1.15.12, MySQL 8, PHP fpm 7.3 on Ubuntu 18.04

 

 

Prerequisites

Already Installed Ubuntu 18.04

 

Easy Installing nginx from repo 

sudo apt update && sudo apt install nginx

 


 

Installing MySQL

 

Run the following commands

from Repo  (version may be 5.7 or 5.6)

sudo apt install mysql-server

 

 

Part 2: securing installation

sudo mysql_secure_installation

VALIDATE PASSWORD PLUGIN

password strength will be high.

Set: Root password, remove anonymous users etc(security hardening must for mysql installation.

Upgrading Mysql databases

Optional (use with caution)

mysql_upgrade u – root -p

if your migrating from old version to new ort if mysql log asks explicitly)

that’s all you done with mysql (performance tuning you need to visit this page)

 

Installing Php or Php -fpm

from repo

sudo apt install php-fpm

or

 

Php extensions for wordpress

sudo apt-get install php7.3-mysql php7.3-curl php7.3-json php7.3-cgi php7.3-xsl

or php fpm configuration with nginx and performance tuning please php installation page.

 

 

 

Semi Advanced LEMP Installation

 Installing Nginx From Source for latest 

visit http://nginx.org/en/download.html  scroll down to below prebuilt packages.

http://nginx.org/en/linux_packages.html

Select Linux distributions RHEL/Centos/ Ubuntu / debian etc

 

for Ubuntu

Ubuntu

Version Supported Platforms
14.04 “trusty” x86_64, i386, aarch64/arm64
16.04 “xenial” x86_64, i386, ppc64el, aarch64/arm64
18.04 “bionic” x86_64, aarch64/arm64
18.10 “cosmic” x86_64

 

 

1st step

Adding Repository to APT

To set up the apt repository for stable nginx packages, run the following command:

echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
    | sudo tee /etc/apt/sources.list.d/nginx.list
or

If you would like to use mainline nginx packages, run the following command instead:

echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
    | sudo tee /etc/apt/sources.list.d/nginx.list

2nd step (maybe optional if ubuntu asks)

Next, import an official nginx signing key so apt could verify the packages authenticity:

curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -

Verify that you now have the proper key:

sudo apt-key fingerprint ABF5BD827BD9BF62

The output should contain the full fingerprint 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 as follows:

pub   rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
      573B FD6B 3D8F BC64 1079  A6AB ABF5 BD82 7BD9 BF62
uid   [ unknown] nginx signing key <signing-key@nginx.com>

3rd & Final Step

To install nginx, 

sudo apt update && sudo apt install nginx

 

3.Installing PHP

 

or from launchpad repo for specific version

https://launchpad.net/~ondrej/+archive/ubuntu/php

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3-fpm

from source (Precompiled)

Install mysql 8  fro mysql

Download MySQL APT repository

Ste p1:

Go to https://dev.mysql.com/downloads/repo/apt/

(mysql-apt-config_0.8.12-1_all.deb)

Wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

Step 2

sudo dpkg -i mysql-apt-config_w.x.y-z_all.deb

ex: dpkg -i mysql-apt-config_0.8.12-1_all.deb

Step 3:

sudo apt-get update && sudo apt-get install mysql-server

 

Part 2: securing installation

sudo mysql_secure_installation

 

Sample Nginx Server Block 

server {
listen 80;
root /var/www/html;

#remove below line add this to nginx.conf (to reduce code on every block)
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;

location / {

#for wordpress not work replace with  try_files $uri $uri/ /index.php?$args;
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

# remove locat .ht block i you are not using apache2

location ~ /\.ht {
deny all;
}
}

To start services

sudo systemctl start nginx

sudo systemctl stop nginx

sudo systemctl restart nginx

sudo systemctl reload nginx  (reload config files without restarting)

sudo systemctl status nginx (checking status whether it running or not)

 

Same applies php & Mysql

sudo systemctl restart php7.3-fpm

sudo systemctl restart mysql

 

Possible errors

Database not connected

 

Related topics:

  1. phpmyadmin install / configure on nginx ubuntu 20.04 apache2 debian 10
  2. Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
  3. letsencrypt install configure on ubuntu / debian nginx
  4. install wordpress via command line apache nginx ubuntu debian
  5. Letsencrypt SSL Installation on apache/Nginx ubuntu / debian




tutorials

  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Devops Syllabus topics PDF
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
    • nginx modules list (enable, disable, upgrade, install dynamic module)
    • monitor nginx request with nginx status amplify datadog new relic
    • nginx installation on ubuntu 20.04 LTS
    • Redis performance metrics & tuning for nginx apache ubuntu & debian
    • enable brotli compression nginx brotli vs gzip
    • nginx performance tuning
    • Top 10 tips to improve nginx server security
    • letsencrypt install configure on ubuntu / debian nginx
    • what is TTFB & how to Reduce it (server response time) Google pagespeed
    • enable php fpm status page, monitor & understand the report to tweak performance
    • 2021 php fpm pool manager configuration settings based on server spike
    • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian
    • nginx rewrite rules with examples 301 redirection
    • use nginx as reverse proxy and load balancer for apache wordpress
    • nginx conf explained best config file performance tuning nginx.conf
    • nginx errors (504,502, 413, unable to start, syntax errors)
    • Pagespeed module install, configure, monitor, errors ft nginx &apache
    • Apache vs nginx (connection handling, modules, memory usage)
    • install lemp Linux, Nginx 1.15.12, MySQL 8, PHP fpm 7.3 on Ubuntu 18.04
    • nginx fastcgi cache wordpress how to configure
    • Redis / memcached installation on ubuntu 20.04 with wordpress mysql configuration
    • cloudflare timeout error 522 524 fix by increasing limit
  • Vivek Bindra Videos Transcription (business strategy)
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

About

 

raaz kumar comI am Raaz Kumar, Most Of the time in a day , I Spend on WordPress, Hosting, Server related issues, So i decided write clean posts from my personal notes, so it will be useful for every one like me. Read More,,

Please Support my work by sharing, it can helps to create free content like this.

Twitter

Facebook

Youtube

 

PUBG Mobile Tips & Tricks

free fire how to play (a-z guide) guns, tips &#038; tricks etc

Windows 10 tips & tricks

Pagespeed optimization

Pc building tips & tricks

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

Android studio tutorials

Gaming/ streaming tips

Airtel dth channel list

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2021 - All Rights Reserved Disclaimer & Privacy Policy