LEMP Laravel is automation bash script to install LEMP Stack (Linux, Nginx, MySQL and PHP).
The script also install essential services that required by Laravel like redis cache and supervisord.
Tested on AWS EC2 Ubuntu 18.04 LTS
and Ubuntu 20.04 LTS
server.
New Update: LEMP Laravel script for Centos see README_CENTOS.md
Login as root
$ sudo su -
Install essential tools
$ apt-get install screen wget curl vim
Create screen session
$ screen
Use quick bash installer with default settings:
$ curl https://raw.githubusercontent.com/yasapurnama/lemp-laravel/master/lemp-laravel.sh | bash
$ wget https://raw.githubusercontent.com/yasapurnama/lemp-laravel/master/lemp-laravel.sh
$ vim lemp-laravel.sh
Here are variables that you can change base on your need.
Variables | Default | Note |
---|---|---|
PHP_VERSION | 7.4 | Find LTS support https://www.php.net/supported-versions.php |
PHPMYADMIN_VERSION | 5.1.3 | Check latest version https://www.phpmyadmin.net/downloads/ |
NVM_VERSION | v0.39.1 | Check latest version https://github.com/nvm-sh/nvm/releases |
NODE_VERSION | v16.14.2 | Find LTS support https://nodejs.org/en/about/releases/ |
NGINX_MAX_BODY_SIZE | 64M | Nginx max body size |
PHP_MEMORY_LIMIT | 128M | PHP memory limit |
PHP_UPLOAD_MAX_FILESIZE | 5M | PHP upload max file size |
PHP_POST_MAX_SIZE | 5M | PHP post max size |
PHP_MAX_EXECUTION_TIME | 300 | PHP max execution time (in seconds) |
PHP_MAX_INPUT_TIME | 300 | PHP max input time (in seconds) |
PHP_MAX_FILE_UPLOAD | 100 | PHP max file upload |
FPM_MAX_CHILDREN | 50 | PHP FPM max children |
FPM_START_SERVERS | 20 | PHP FPM start servers |
FPM_MIN_SPARE_SERVERS | 10 | PHP FPM min spare servers |
FPM_MAX_SPARE_SERVERS | 20 | PHP FPM max spare servers |
FPM_MAX_REQUESTS | 500 | PHP FPM max requests |
REDIS_MAX_MEMORY | 128mb | Redis max memory |
$ chmod +x lemp-laravel.sh
$ ./lemp-laravel.sh
If there's Broken pipe
in ssh connection you can continue the installation.
List screen sessions and find the session id (SID)
$ screen -ls
Restore screen session
$ screen -r $SID
Contributions are always welcome!
Licensed under the MIT License, see LICENSE for more information.