Ubuntu (and CentOS 6/7/8) server installation and configuration
Please, download all files before executing any script. There are several dependencies between them.
Ubuntu
apt update -y && apt upgrade -y
git clone https://github.com/simplyjarod/server && cd server
chmod u+x *.sh -RCentOS
sudo yum install wget unzip -y
wget https://github.com/simplyjarod/server/archive/master.zip
unzip master.zip && cd server-master && rm -rf ../master.zip
chmod u+x *.sh -RWhat you can do with these scripts
Elements with link are updated for Ubuntu compatibility.
- Install LAMP server
- Install LEMP server
- Install apache
- Install NGINX
- Add apache virtual host
- Add NGINX virtual host
- Manage HTTP traffic with IPTABLES
- Manage MySQL traffic with IPTABLES
- Generate Let's Encrypt SSL certificates
- Install PHP
- Update PHP to latest version
- Install NodeJS, NPM and PM2
- Install MariaDB
- Create MySQL DB and user
- Remove MySQL DB and user
- Install REDIS
- Install WordPress
LAMP server: Linux + apache + MySQL + php
Run ./lamp-install.sh as root from the folder this file is placed.
This will run the following scripts: Install apache, Install MariaDB, Install PHP, Add apache virtual host and Manage HTTP traffic with IPTABLES.
LEMP server: Linux + NGINX + MySQL + php
Run ./lemp-install.sh as root from the folder this file is placed.
This will run the following scripts: Install NGINX, Install MariaDB, Install PHP, Add NGINX virtual host and Manage HTTP traffic with IPTABLES.
Install apache
Run ./apache-install.sh as root from the folder this file is placed.
This will install apache2 and some basic setup.
Install NGINX
Run ./nginx-install.sh as root from the folder this file is placed.
This will install NGINX and some basic setup.
Add apache virtual host
Run ./apache-add-virtual-host.sh as root from the folder this file is placed.
This will create a new user (if not created previously) and virtual host in apache2 in interactive mode: the script will ask you for system username and domain.
Add NGINX virtual host
Run ./nginx-add-virtual-host.sh as root from the folder this file is placed.
It is mandatory to have NGINX installed previously.
This will create a new user (if not created previously) and virtual host in NGINX in interactive mode: the script will ask you for system username and domain.
Manage HTTP traffic with IPTABLES
Run ./iptables-accept-http.sh as root from the folder this file is placed.
It is mandatory to have IPTABLES installed previously (you can run iptables.sh from my system repository).
This will insert into IPTABLES a new rule for port 80 (HTTP traffic) binded to an IP or to all IPs (unrestricted).
Manage MySQL traffic with IPTABLES
Run ./iptables-accept-mysql.sh as root from the folder this file is placed.
It is mandatory to have IPTABLES installed previously (you can run iptables.sh from my system repository).
This will insert into IPTABLES a new rule for port 3306 (MySQL traffic) binded to an IP or to all IPs (unrestricted).
Install PHP
Run ./php-install.sh as root from the folder this file is placed.
This will install PHP latest available version. In CentOS, PHP is not available on latest version, so php-update.sh is executed right after the default installation. Some "basic" libraries and modules are also installed.
Install NodeJS, NPM and PM2
Run ./nodejs-install.sh as root from the folder this file is placed.
This will install NodeJS and NPM latest LTS version directly from nodesource.com.
Install MariaDB
Run ./mariadb-install.sh as root from the folder this file is placed.
This will install MariaDB (MySQL), mysql_secure_installation (interactive mode) and some basic setup.
Create MySQL DB and user
Run ./mysql-create-db-and-user.sh from the folder this file is placed. You will be asked for mysql's root password.
It is mandatory to have MySQL or MariaDB installed previously.
Remove MySQL DB and user
Run ./mysql-remove-db-and-user.sh from the folder this file is placed. You will be asked for mysql's root password.
It is mandatory to have MySQL or MariaDB installed previously.
Install WordPress
Run ./wordpress-install.sh as root from the folder this file is placed.
This will download a new WordPress copy and install it in the folder you specify, configuring (or creating if not exists) database, user and password (random names or the ones you provide).