LinuxServerSetup

by tirsvad
38 deployments · 10 still active · last rev. 2 months ago

LinuxServerSetupScript

This script aimed goal is to set up a complete web server environment. Optional Nginx with SSL (Letsencrypt), Database (postgresql or mysql), Cpanel (ajenti)

Debian, ubuntu or compatible distribution

Features
Optional add Ajenti control panel
Optional add NGINX webserver (LEMP) with LetsEncrypt
Create a privileged user
Sshd
option ssh-key for passwordless connection
option disable root login
Firewall
Automatic configure based on choices made
Setting hostname
Update system software

RUN IT
bash StackScript

Development
Want to contribute? Great!
Find us [here](https://github.com/TirsvadCMS/LinuxServerSetup/)

Compatible with: CentOS 7, Debian 9, Ubuntu 18.04 LTS, Ubuntu 18.10
						#!/bin/bash
#<UDF name="myvar" Label="Pick version" oneOf="master" default="master" />
cd ~
# if first time run!
if [ ! -d "LinuxServerSetup" ]; then
        [[ $( which git ) ]] || {
                if [ -f /etc/os-release ]; then
                        # freedesktop.org and systemd
                        . /etc/os-release
                        OS=$NAME
                        OS_VER=$VERSION_ID
                else
                        # Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
                        OS=$(uname -s)
                        OS_VER=$(uname -r)
                fi                
        

                case "$OS" in
                        "Debian GNU/Linux"|"Ubuntu")
                                apt-get -qq install git
                                ;;
                        "CentOS Linux")
                                yum -y install git
                                ;;
                esac
        }
    case "$MYVAR" in
    'master')
        git clone https://github.com/TirsvadCMS/LinuxServerSetup.git
        cd LinuxServerSetup
        git submodule init
        git submodule update
    ;;
    esac
else
    cd LinuxServerSetup
    bash setup/start.sh
fi