8 Commits

11 changed files with 47 additions and 29 deletions

View File

@@ -109,8 +109,8 @@ if [ $IMODE = l ]; then
done done
read -p "Set sitename to ${domain//./_}? (y/n)" choice read -p "Set sitename to ${domain//./_}? (y/n)" choice
case "$choice" in case "$choice" in
y|Y ) sitename=${domain//./_};; y*|Y* ) sitename=${domain//./_};;
n|N ) echo ""; n*|N* ) echo "";
while true; do while true; do
echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename
if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ] if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ]

View File

@@ -25,8 +25,6 @@ define('FS_METHOD','direct');
#$table_prefix = 'DBName'; #$table_prefix = 'DBName';
$table_prefix = 'wp'; $table_prefix = 'wp';
WPsalty
define('WP_DEBUG', false); define('WP_DEBUG', false);
if ( !defined('ABSPATH') ) if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/'); define('ABSPATH', dirname(__FILE__) . '/');
@@ -39,4 +37,4 @@ if ( !defined('ABSPATH') )
#define('WP_REDIS_HOST', '127.0.0.1'); #define('WP_REDIS_HOST', '127.0.0.1');
#define('WP_REDIS_PASSWORD', '<RedisPassword>'); #define('WP_REDIS_PASSWORD', '<RedisPassword>');
#define('WP_REDIS_PORT', '6379'); #define('WP_REDIS_PORT', '6379');
require_once(ABSPATH . 'wp-settings.php');

View File

@@ -29,7 +29,8 @@ rm /var/www/"$domain"/html/wp-config-sample.php
#Configuring WordPress #Configuring WordPress
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/WordPress-unconfigured -o /var/www/"$domain"/html/wp-config.php curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/WordPress-unconfigured -o /var/www/"$domain"/html/wp-config.php
sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' -e 's/DBName/'$db_name'/' -e 's/DOMAINname/'$domain'/' /var/www/"$domain"/html/wp-config.php sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' -e 's/DBName/'$db_name'/' -e 's/DOMAINname/'$domain'/' /var/www/"$domain"/html/wp-config.php
printf '%s\n' "g/WPsalty/d" a "$WPSalts" . w | ed -s /var/www/"$domain"/html/wp-config.php printf '%s\n' "$WPSalts" >> /var/www/"$domain"/html/wp-config.php
printf '%s\n' "require_once(ABSPATH . 'wp-settings.php');" >> /var/www/"$domain"/html/wp-config.php
#PHP Pool #PHP Pool
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -o /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf

View File

@@ -0,0 +1 @@
cron

View File

@@ -0,0 +1 @@
cronie

View File

@@ -1 +1 @@
htop ufw nload fail2ban htop ufw nload fail2ban sudo bash-completion

View File

@@ -30,6 +30,12 @@ timedatectl set-timezone Europe/Amsterdam > $OUTPUT 2>&1
sed -i -e '/Port 22/c\Port 4242' -e 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config > $OUTPUT 2>&1 sed -i -e '/Port 22/c\Port 4242' -e 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config > $OUTPUT 2>&1
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then
sed -i -e '/XKBLAYOUT=/c\XKBLAYOUT=us' -e '/XKBVARIANT=/c\XKBVARIANT="intl"' /etc/default/keyboard > $OUTPUT 2>&1
elif [ "$osrel" = "cent8" ]; then
localectl set-keymap us-int
fi
##----------## ##----------##
# Swap # # Swap #
##----------## ##----------##

View File

@@ -1,26 +1,37 @@
# Getting/using the Normal installer (installer.sh): # Getting/using the Normal installer (installer.sh):
Using curl
``` ```
#Get installer.sh from the repo and store it at: /tmp/installer.sh curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
bash /tmp/installer.sh
```
Using wget
```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
bash /tmp/installer.sh bash /tmp/installer.sh
``` ```
# Getting/using the Legacy installer (installer.sh): # Getting/using the Legacy installer (installer.sh):
Using curl
``` ```
#Get installer.sh from the repo and store it at: /tmp/installer.sh curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
``` ```
Using wget
```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
```
# Adding a Domain (AppendCMS.sh): # Adding a Domain (AppendCMS.sh):
The script wil get most information it need from stored config, only the new domain and the mysql root password need to be entered. The script wil get most information it need from stored config, only the new domain and the mysql root password need to be entered.
``` ```
#Get the AppendCMS.sh from the repo and store it at: /tmp/AppendCMS.sh bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendCMS.sh)
bash /tmp/AppendCMS.sh
``` ```
# Adding a Module/Option (AppendModule.sh): # Adding a Module/Option (AppendModule.sh):
The script wil get most information it need from stored config The script wil get most information it need from stored config
``` ```
#Get the AppendCMS.sh from the repo and store it at: /tmp/AppendModule.sh bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendModule.sh)
bash /tmp/AppendModule.sh
``` ```

View File

@@ -1,5 +1,6 @@
# Web-V2 # Web-V2
**Get Started with the graphical installer**: ## Geting started
**Default/Graphical installer**:
Using curl Using curl
``` ```
curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
@@ -24,6 +25,15 @@ Using wget
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
bash /tmp/installer.sh -l 2>&1 | tee ~/output.log bash /tmp/installer.sh -l 2>&1 | tee ~/output.log
``` ```
## Adding extra CMS/Site after instalation
```
bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendCMS.sh)
```
## Adding extra Module after instalation
```
bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendModule.sh)
```
### This script uses the following repo's as dependencies: ### This script uses the following repo's as dependencies:
``` ```

View File

@@ -29,18 +29,15 @@ dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release") dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
echo "Ubuntu 18.04 Detected"
PKGM="$APTMODE" PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
shortdist=ubu1804 shortdist=ubu1804
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
echo "Ubuntu 20.04 Detected" echo "Ubuntu 20.04 is not yet fully tested, not recommended for production server"
PKGM="$APTMODE" PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
echo "This OS is not supported"
exit
shortdist=ubu2004 shortdist=ubu2004
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
echo "Debian 10 Detected" echo "Debian 10 Detected"
@@ -48,8 +45,6 @@ elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
shortdist=deb10 shortdist=deb10
echo "This OS is not supported"
exit
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
echo "Centos 8 Detected" echo "Centos 8 Detected"
PKGM="dnf" PKGM="dnf"

View File

@@ -37,18 +37,15 @@ dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release") dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
echo "Ubuntu 18.04 Detected"
PKGM="$APTMODE" PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
shortdist=ubu1804 shortdist=ubu1804
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
echo "Ubuntu 20.04 Detected" echo "Ubuntu 20.04 is not yet fully tested, not recommended for production server"
PKGM="$APTMODE" PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
echo "This os in not supported"
exit
shortdist=ubu2004 shortdist=ubu2004
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
echo "Debian 10 Detected" echo "Debian 10 Detected"
@@ -56,8 +53,6 @@ elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
PKGI="${PKGM} install -y --no-install-recommends" PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt" PKGLIST="apt"
shortdist=deb10 shortdist=deb10
echo "This os in not supported"
exit
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
echo "Centos 8 Detected" echo "Centos 8 Detected"
PKGM="dnf" PKGM="dnf"
@@ -284,8 +279,8 @@ while true; do
done done
read -p "Set sitename to ${domain//./_}? (y/n)" choice read -p "Set sitename to ${domain//./_}? (y/n)" choice
case "$choice" in case "$choice" in
y|Y ) sitename=${domain//./_};; y*|Y* ) sitename=${domain//./_};;
n|N ) echo ""; n*|N* ) echo "";
while true; do while true; do
echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename
if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ] if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ]