CentOS 7 + LEMP

by wilk_randall
50 deployments · 5 still active · last rev. 7 months ago

New server setup + LEMP Stack.

Progress can be monitored by connecting via ssh to the server and by running: tail -f /root/stackscript.log

To setup ssh private/public keys with this script, you need to do the following:

- On your local machine, run "ssh-keygen" in the terminal
- For increased security of your key, increase the size with
the "-b" flag, like this: "ssh-keygen -b 4096"
- Follow the prompts, and be sure to enter a passphrase for the key.
- If you accepted the defaults, it will generate a private key in a ~/.ssh/id_rsa file, and a public key in a ~/.ssh/id_rsa.pub file.
- Open and copy the contents of the public key (should be something like "ssh-rsa ..." into the field for the SSH pubkey for this script.
- You will also need to import the private key into your ssh client.

Compatible with: CentOS 7, Fedora 28

# Define variables

#<UDF name="hostname" label="Enter main hostname for the new Linode server.">
#<UDF name="fqdn" label="Enter Server's Fully Qualified Domain Name (same as main hostname). Don't enter `www`">
#<UDF name="timezone" label="Server Timezone" default="America/Chicago" example="America/New_York">
#<UDF name="selinux" label="Enable SELinux?" oneOf="no,yes" default="no">
#<UDF name="ssh_pub_key" label="SSH pubkey (installed for root and shell user)" example="ssh-rsa ..." default="">
#<UDF name="password_login" label="Permit SSH Password Login" oneOf="no,yes" default="no">
#<UDF name="shell_user_name" label="Shell User Name">
#<UDF name="shell_user_password" label="Shell User Password">
#<UDF name="ssh_port" label="SSH Port" default="22">
#<UDF name="root_login" label="Permit Root SSH Login?" oneOf="no,yes" default="no">
#<UDF name="login_grace_time" label="SSH Login Grace Time" default="1m" example="2m">
#<UDF name="ftp_user_name" label="FTP User Name">
#<UDF name="ftp_user_password" label="FTP User Password">
#<UDF name="root_db_password" label="MariaDB Root Password">
#<UDF name="db_user_name" label="Database User Name">
#<UDF name="db_user_password" label="Database User Password">
#<UDF name="ssl" label="Install SSL Cert" oneOf="no,yes" default="yes">
#<UDF name="ssl_email" label="SSL Renewal and Security Notices Email" default="">

curl -o /root/init.sh -L https://raw.githubusercontent.com/rawilk/new-server-setup/master/stack-scripts/centos-7-lemp-stack.sh

. ./root/init.sh