WordPress in a (LEMP) box (Debian & Ubuntu)!
Script/s to install LEMP in a linux box. This LEMP stack is fine-tuned towards WordPress installations. It may work for other PHP based applications, too. For more details, please see the blog post at https://www.tinywp.in/wp-in-a-box/.
There are a number of similar scripts available on the internet. The unique feature of this repo is in security considerations.
Ubuntu
Debian
In sync with WordPress philosophy of “decision, not options”.
.envrc-sample
file as .envrc
and insert as much information as possiblebootstrap.sh
and execute it.# as root
apt install curl screen -y
# optional steps
# curl -LO https://github.com/pothi/wp-in-a-box/raw/main/.envrc-sample
# cp .envrc-sample .envrc
# nano .envrc
# download the bootstrap script
curl -LO https://github.com/pothi/wp-in-a-box/raw/main/bootstrap.sh
# please do not trust any script on the internet or github
# so, please go through it!
nano ~/bootstrap.sh
# execute it and wait for some time
# screen bash bootstrap.sh
# or simply
bash bootstrap.sh
# wait for the installation to get over.
# it can take approximately 5 minutes on a 2GB server
# it depends on CPU power too
# we no longer needs bootstrap.sh file
rm bootstrap.sh
# to see the credentials to log in to the server from now
# this is the important step. you can't login as root from now on
cat ~/.envrc
You may find the following details at ~/.envrc
file...
ssh_
) with sudo privileges (use it only to manage the server such as to create a new MySQL database or to create a new vhost entry for Nginx)sftp_web_
, with its home directory at /home/web
along with some common directories(such as ~/log
, ~/sites
, etc) created already. (you may give it to your developer to access the file system such as to upload a new theme, etc)root
user. This can be used to access MySQL via PhpMyAdmin, as root
user can only access MySQL via cli./home/web/sites/example.com/public
.certbot certonly --webroot -w /home/web/sites/example.com/public -d example.com -d www.example.com
. The renewal script is already in place as a cron entry. So, you don't have to create a new entry. To know more about this client library and to know more about the available options, please visit https://certbot.eff.org/ .$HOME
, but can create or upload inside other existing directories. This is a known limitation when we use SFTP capability of built-in OpenSSH server.For more documentation, information, supported/tested hosts, todo, etc, please see the WP-In-A-Box wiki.