Coder Social home page Coder Social logo

lemp's Introduction

LEMP Installer

The Linux-Nginx-MariaDB-PHP (LEMP) installer for local computer and VPS for Ubuntu / Debian derivative.

This will remove installed PHP, NginX and MariaDB then install the LEMP stack from ppa:ondrej/php desired version:

  • Latest PHP 8.1.1
  • NginX 7.18.0
  • MariaDB Ver 15.1 Distrib 10.3.32-MariaDB

Installation

sudo apt-get install ca-certificates
wget https://raw.githubusercontent.com/vpslabs/lemp/main/lemp-install.sh
chmod +x lemp-install.sh
./lemp-install.sh
rm lemp-install.sh

Domain Management Script

Add a Domain

Public Web Server

sudo /usr/bin/domain add domain.tld
  • Web Root Directory: /var/www/domain.tld
  • nginx .conf file: /etc/nginx/conf.d/domain.tld.conf
  • Configured for SSL using LetsEncrypt
  • http://domain.tld will be redirected to https://domain.tld
  • http://www.domain.tld will be redirected to https://domain.tld
  • https://www.domain.tld will be redirected to https://domain.tld

Local Web Server

sudo domain add domain.local

If you installed LEMP on your local development machine instead of a public web sever, replace .tld (.com, .net, .org, etc) with .local.

  • Web Root Directory: /var/www/domain.local
  • nginx .conf file: /etc/nginx/conf.d/domain.local.conf
  • /etc/hosts will be updated to point domain.local to 127.0.0.1
  • Not configured for SSL

Remove a Domain

Make sure to make a backup before removing a domain.

sudo domain remove domain.tld
sudo domain remove domain.local
  • Removes Web Root Directory (will not be backed up before deletion)
  • Removes nginx .conf file (will not be backed up before deletion)
  • Restarts nginx

Additional Tasks

To check installed NginX version

nginx -v

To check installed PHP version

php -v

To see available PHP installed version

update-alternatives --list php

NginX tasks to start, stop, and restart the service

sudo systemctl start nginx 
sudo systemctl stop nginx 
sudo systemctl restart nginx

MariaDB tasks to start, stop, and restart the service

systemctl start mariadb
systemctl stop mariadb
systemctl restart mariadb

Checking the service status of NginX, MariaDB, and PHP

systemctl status nginx.service
systemctl status mariadb.service
systemctl status php8.1-fpm.service

lemp's People

Contributors

vpslabs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.