-
-
Notifications
You must be signed in to change notification settings - Fork 62
Installation
LEMP/LNMP is an open-source web application stack used to develop web applications. The term LEMP/LNMP is an acronym that represents L for the GNU/Linux operating system, Nginx (pronounced as engine-x, hence the E in the acronym) web server, M for MariaDB/MySQL database, and P for PHP scripting language.
Every component of the LEMP/LNMP stack communicates with each other and required to install and run correctly. Meanwhile, installing each component manually is time-consuming and error-prone.
One of the easiest ways to install LEMP/LNMP Stack is to use an automatic installer such as LEMPer Stack. Follow this step by step guide to install LEMPer Stack on your machine.
Before you start, you need to clone the LEMPer Stack repository. To do this, open a terminal and run the following command:
git clone https://github.com/joglomedia/LEMPer.git
If you are not familiar with Git or doesn't have Git installed, you can download the repository as a zip file from the releases page. We recommend that you download the zip file from the latest version, then extract it to a directory on your machine.
mkdir -p /path/to/directory
cd /path/to/directory
wget -O lemper-stack.tar.gz https://github.com/joglomedia/LEMPer/archive/refs/tags/v3.1.0.tar.gz
tar -xvf lemper-stack.tar.gz
After those operations, you should have a directory named LEMPer-v3.1.0
in your current directory. The version number of the LEMPer Stack is v3.1.0
, its number depend on the version of the LEMPer Stack that you have downloaded. Now, cd
to the LEMPer-v3.1.0
directory.
cd LEMPer-v3.1.0
Next, make change to the LEMPer Stack installation configuration by running the following command:
cp .env.dist .env
Edit the .env
file with your favorite editor. The .env
file contains the configuration parameters for LEMPer Stack.
vim .env
Adjust all the parameters to your needs.
The .env
file contains environment variables used during installation. Each of environment variables are grouped in a section. The section names represents the software stack names.
-
AUTO_INSTALL
- If this is set totrue
, the LEMPer Stack will automatically install the software stack in unattended installation mode, otherwise you will be prompted to install the software stack in interactive mode. The valid value istrue
orfalse
, and the default value isfalse
. -
AUTO_REMOVE
- If this is set totrue
, the LEMPer Stack will automatically remove existing software stack during installation and in unattended uninstallation mode, otherwise you will be prompted to uninstall or keep the existing software. The valid value istrue
orfalse
, and the default value isfalse
. -
FORCE_REMOVE
- If this is set totrue
, the LEMPer Stack will completely remove all files and configs related to uninstalled existing software stack during installation and in unattended uninstallation mode, otherwise you will be prompted to remove or keep them. The valid value istrue
orfalse
, and the default value isfalse
. -
ENABLE_SWAP
- If this is set totrue
, the LEMPer Stack will enable swap space on the server. The valid value istrue
orfalse
, and the default value istrue
. -
DEBUG
- If this is set totrue
, the LEMPer Stack will output debug information during installation. The valid value istrue
orfalse
, and the default value isfalse
. -
LOGGING
- If this is set totrue
, the LEMPer Stack will output log information during installation to log file. The valid value istrue
orfalse
, and the default value istrue
. -
LOG_FILE
- The path to the log file. The default value is/var/log/lemper-stack.log
. -
BUILD_DIR
- The path to the directory where the software stack will be built during installation. The default value is/usr/local/src/lemper
. This build directory will be deleted after installation. -
DRY_RUN
- If this is set totrue
, the LEMPer Stack will not actually install or uninstall software stack, but will show the installation or uninstallation process. The valid value istrue
orfalse
, and the default value isfalse
.
-
ENVIRONMENT
- This is the name of the environment that you want to install. The valid values aredevelopment
andproduction
, the default value isdevelopment
. Thedevelopment
environment is used for development purposes, whileproduction
environment is used for production purposes. -
SERVER_HOSTNAME
- The hostname of the server that you want to install. The default value islocalhost
. In production environment, server hostname must be valid FQDN format (e.g. localhost.localdomain or hostname.example.com). -
SERVER_IP
- The IP address of the server that you want to install. The default value is127.0.0.1
. -
TIMEZONE
- The timezone of the server that you want to install. The default value isUTC
. For detailed timezon format reference, please refer to timezone database. -
LEMPER_USERNAME
- The default username used by LEMPer Stack. The default value islemper
. This username will be created if it doesn't exist. -
LEMPER_PASSWORD
- The password used by LEMPer Stack user. If not set (empty), the password will be created automatically during installation process. -
LEMPER_ADMIN_EMAIL
- The email address of the LEMPer Stack admin. You must set the value to valid email address. It is used for Let's Encrypt certificates and email notifications.
-
SSH_PORT
- The port number of the SSH server. For security reasons, avoid using default SSH port22
. The default LEMPer Stack ssh port is2269
and it is recommended that you change it to a different port number. If your server instance behind firewalls, you must allow inbound connections on the firewall to the SSH port. -
SSH_ALLOW_ROOT_LOGIN
- If this is set totrue
, the LEMPer Stack will allow SSH login with root user. To prevent brute-force SSH attacks that targeting root account, by default the value is set tofalse
. -
SSH_PASSWORDLESS_LOGIN
- If this is set totrue
, the LEMPer Stack will allow SSH login without password. SSH passwordless login requires public-private key pairs generated from ssh-keygen. -
RSA_PUB_KEY
- The strings value of the RSA public key file generated from ssh_keygen. Follow this tutorial SSH Passwordless Login Using SSH Keygen Authentication to setup public-private key pairs. -
RSA_HASH_LENGTH
- The length of the hash value of the RSA public key. The valid value is2048
or4096
, and the default value is2048
.
For further reading:
- [https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/]
- [https://www.ssh.com/academy/ssh/copy-id]
Not implemented yet.