28 Commits

Author SHA1 Message Date
2c4e5cf324 SubModule php-fpm: Relocated setup of php repo
Relocated it from generic CoreModule to the php-fpm SubModule
2023-07-02 21:47:12 +02:00
6e7761effe Submodule PHP-FPM: Added module only installer and fixed PhpUpdater for debian 12 2023-07-02 21:37:51 +02:00
c272df8109 Submodule PHP-FPM: Added inital debain 12 support 2023-07-02 21:05:03 +02:00
6922ea61b2 Update references to new git location
Changed Web-V2 config location to /etc/WebV2
2023-07-02 20:43:33 +02:00
be98df66a9 Main: Updated way DB names are generated
Switch from geting folder count in /var/www
to using SiteCount variable stored in /etc/ICTM/sites.count,
installer.sh has static 1, AppendCMS gets the file an increments it by one.
Fallback is build in for systems without sites.count
2022-04-21 15:17:28 +02:00
9222904ab2 CMS-Nextcloud: Update nginx config for beter Talk compatibility 2022-04-21 14:39:14 +02:00
Bram Prieshof
e583fa7357 CMS-Nextcloud: update opchache config php pool 2022-02-16 21:59:50 +00:00
459d61b348 PhpUpdater: Fixed mistake and cleaned up promts 2022-01-20 14:40:33 +01:00
296a68dc2e CMS:Nextcloud, fixed first-run video 2021-11-26 19:56:32 +01:00
39724043fe Fixed php session save permission problem 2021-11-25 14:20:16 +01:00
9b448938bf Sync 'Debian11Testing' to master 2021-09-08 14:54:55 +02:00
429f75e5e3 Main, Prepair for sync to master branch 2021-09-08 14:42:29 +02:00
c512a70477 Main:Inst added var:sshservice for el8 using sshd
and deb based ssh
2021-09-08 13:54:33 +02:00
50c3561710 Main:Inst updated ssh service name sshd->ssh
Since in Debian 11  `ssh` is more reliable then 'sshd'
2021-09-08 10:35:21 +02:00
668da644f3 Main, MariaDB & Deb11; CMS:Backend
Main, MariaDB:
Switched form MariaDB back to MySQL since it is available for Deb11

Main, Debian 11
Enabled Debian 11  support, and removed warnings

CMS:Backend increased limits
PHP: post_max to 256M
Nginx: client_max_body to 256m and fcgi_timeout to 10 minutes
2021-09-03 14:02:06 +02:00
bbd91b4e9a Mod:php-fpm update script new version detection
Updated detection for latested php version in repo for deb based
now using apt package list repo file instead of apt list command
2021-08-27 15:21:18 +02:00
4238e78ac1 Mod:Postfix Added basic SSL/TLS support 2021-08-26 15:20:31 +02:00
98c5429f00 Added fix from #10 to all php versions 2021-08-19 14:54:47 +02:00
c9abe992e0 Main: Added inital support for Debian 11
Added Debian 11 as supported os
Added deb11 to all places were deb10 was in a if statement

Temporarily replaced MySQL with MariaDB,
since the MySQL repo is not yet avalible
2021-08-19 12:47:01 +02:00
02e644ba60 CMS:Nextcloud added missing semicolon 2021-08-11 13:20:41 +02:00
b911388b85 Added fix for Nextcloud php8.x (see #10) 2021-08-11 13:05:17 +02:00
Bram Prieshof
ad5411b8cb Update 'CMS/none/conf.sh' 2021-05-27 12:49:17 +02:00
b94a84bb84 CMS:Nextcloud added config option for trash clean 2021-05-06 11:55:11 +02:00
Bram Prieshof
73e168ff44 CMS:Nextcloud nginx added missing line
Signed-off-by: Bram Prieshof <bprieshof@noreply@ictmaatwerk.com>
2021-04-15 22:30:20 +02:00
6ffae91431 CMS:Nextcloud Init.sh fixed typo 2021-04-15 13:46:13 +02:00
dabb32845d CMS:Nextcloud fixes related to #15 2021-04-14 14:54:05 +02:00
f27c55336e Main:AppendCMS added fix for #12, Forgotten this 2021-03-25 12:17:05 +01:00
dda74005f5 Main: Added fix SSL issue described #12 2021-03-24 15:06:54 +01:00
55 changed files with 530 additions and 181 deletions

View File

@@ -12,24 +12,29 @@ ScriptCompat=2
# Fetching Vars # # Fetching Vars #
##-----------------## ##-----------------##
if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
source /etc/ICTM/selopts.list source /etc/WebV2/selopts.list
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
if [ -z ${CompatVer} ] || [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi if [ -z ${CompatVer} ] || [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi
if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi
if [ $webserv != nginx_nonphp ]; then if [ $webserv != nginx_nonphp ]; then
if [ ! -f "/etc/ICTM/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi if [ ! -f "/etc/WebV2/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi
source /etc/ICTM/phpvar.list source /etc/WebV2/phpvar.list
fi fi
if [ $webserv = apache ]; then if [ $webserv = apache ]; then
if [ ! -f "/etc/ICTM/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi if [ ! -f "/etc/WebV2/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi
source /etc/ICTM/apachevar.list source /etc/WebV2/apachevar.list
fi fi
rm /tmp/pkg.list > $OUTPUT 2>&1 rm /tmp/pkg.list > $OUTPUT 2>&1
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list)
#SiteCount
if [ ! -f "/etc/WebV2/sites.count" ]; then SiteCount=`expr $(ls -l /var/www | grep -c ^d) - 1` ; else source /etc/WebV2/sites.count; fi
if [ -z ${SiteCount+x} ] ; then SiteCount=`expr $(ls -l /var/www | grep -c ^d) - 1` ; fi
SiteCount=$(($SiteCount+1))
#Setting Menulist to webserver #Setting Menulist to webserver
declare -n CMSL="$webserv"CMSL declare -n CMSL="$webserv"CMSL
declare -n options="$webserv"Options declare -n options="$webserv"Options
@@ -173,7 +178,8 @@ CMS="${CMS//:}" && CMS="${CMS,,}"
# Storeing vars # # Storeing vars #
##-----------------## ##-----------------##
touch /etc/ICTM/sites/"$sitename" touch /etc/WebV2/sites/"$sitename"
echo "SiteCount=$SiteCount" > /etc/WebV2/sites.count
##-----------## ##-----------##
@@ -272,6 +278,8 @@ msg " Setting up SSL"
if test $certsatus -eq 0 if test $certsatus -eq 0
then then
site_ext="ssl" site_ext="ssl"
mkdir -p /etc/acmesh/inst/$domain
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --install-cert --ecc --domain $domain --cert-file /etc/acmesh/inst/$domain/cert.pem --key-file /etc/acmesh/inst/$domain/key.pem --ca-file /etc/acmesh/inst/$domain/ca.cer --fullchain-file /etc/acmesh/inst/$domain/fullchain.pem --reloadcmd 'systemctl reload $(cat /etc/WebV2/SslServices)'
else else
site_ext="nossl" site_ext="nossl"
rm -rf /etc/acmesh/certs/$domain* rm -rf /etc/acmesh/certs/$domain*

View File

@@ -12,20 +12,20 @@ ScriptCompat=2
# Fetching Vars # # Fetching Vars #
##-----------------## ##-----------------##
if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
source /etc/ICTM/selopts.list source /etc/WebV2/selopts.list
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
if [ -z ${CompatVer} ] || [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi if [ -z ${CompatVer} ] || [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi
if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi
if [ $webserv != nginx_nonphp ]; then if [ $webserv != nginx_nonphp ]; then
if [ ! -f "/etc/ICTM/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi if [ ! -f "/etc/WebV2/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi
source /etc/ICTM/phpvar.list source /etc/WebV2/phpvar.list
fi fi
if [ $webserv = apache ]; then if [ $webserv = apache ]; then
if [ ! -f "/etc/ICTM/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi if [ ! -f "/etc/WebV2/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi
source /etc/ICTM/apachevar.list source /etc/WebV2/apachevar.list
fi fi
rm /tmp/pkg.list rm /tmp/pkg.list
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list)
@@ -151,7 +151,7 @@ done
option="${option%"${option##*[![:space:]]}"}" option="${option%"${option##*[![:space:]]}"}"
fi fi
echo 'SelectedOptions+=('$option')' >> /etc/ICTM/selopts.list echo 'SelectedOptions+=('$option')' >> /etc/WebV2/selopts.list
#Cleaning options from menu #Cleaning options from menu

View File

@@ -5,10 +5,11 @@ listen = /var/run/php/phpPHPver-fpm-Backend.sock
listen.owner = www-data listen.owner = www-data
listen.group = www-data listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_value[session.save_path] = /var/lib/php/sessions
php_admin_value[opcache.enable] = 0 php_admin_value[opcache.enable] = 0
php_admin_value[max_input_vars] = 5000 php_admin_value[max_input_vars] = 5000
php_admin_value[upload_max_filesize] = 256M php_admin_value[upload_max_filesize] = 256M
php_admin_value[post_max_size] = 16M php_admin_value[post_max_size] = 256M
php_admin_value[max_input_time] = 15 php_admin_value[max_input_time] = 15
php_admin_value[cgi.fix_pathinfo] = 0 php_admin_value[cgi.fix_pathinfo] = 0
php_admin_value[allow_url_fopen] = Off php_admin_value[allow_url_fopen] = Off

View File

@@ -3,6 +3,8 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backen
sed -i 's/PHPver/'$phpver'/' "$phpPoolDir"/Backend.conf sed -i 's/PHPver/'$phpver'/' "$phpPoolDir"/Backend.conf
groupadd Backend groupadd Backend
useradd -g Backend Backend useradd -g Backend Backend
usermod -a -G www-data Backend
#PHPMyAdmin configuration #PHPMyAdmin configuration
touch /var/log/PhpMyAdmin/PhpMyAdmin_auth.log touch /var/log/PhpMyAdmin/PhpMyAdmin_auth.log
chown Backend:Backend -R /usr/share/phpmyadmin chown Backend:Backend -R /usr/share/phpmyadmin

View File

@@ -24,12 +24,14 @@ location = /backend/netdata {
location /backend/database { location /backend/database {
deny all; #enables/disables PHPMyadmin deny all; #enables/disables PHPMyadmin
index index.php index.html; index index.php index.html;
client_max_body_size 256m;
alias /usr/share/phpmyadmin; alias /usr/share/phpmyadmin;
location ~ \.php$ { location ~ \.php$ {
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/phpPHPver-fpm-Backend.sock; fastcgi_pass unix:/var/run/php/phpPHPver-fpm-Backend.sock;
fastcgi_read_timeout 10m;
fastcgi_index index.php; fastcgi_index index.php;
} }
} }

View File

@@ -6,6 +6,7 @@ listen.owner = www-data
listen.group = www-data listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log
php_value[session.save_path] = /var/lib/php/sessions
; OPCACHE SETTINGS ; OPCACHE SETTINGS
php_admin_value[opcache.memory_consumption] = 256 php_admin_value[opcache.memory_consumption] = 256

View File

@@ -1,7 +1,6 @@
#Creating DB #Creating DB
db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1` db_name="fc_$SiteCount"
db_name="fc_$db_suffix" db_user="fc_$SiteCount"
db_user="fc_$db_suffix"
db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo) db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo)
#Storing DB Credentials #Storing DB Credentials
@@ -27,6 +26,7 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/frontc
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/' "$phpPoolDir"/$sitename.conf sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/' "$phpPoolDir"/$sitename.conf
groupadd "$sitename" groupadd "$sitename"
useradd -g "$sitename" "$sitename" useradd -g "$sitename" "$sitename"
usermod -a -G www-data "$sitename"
systemctl reload $phpFPMService systemctl reload $phpFPMService

View File

@@ -6,6 +6,8 @@ listen.owner = www-data
listen.group = www-data listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,system php_admin_value[disable_functions] = exec,passthru,system
php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log
php_value[session.save_path] = /var/lib/php/sessions
; OPCACHE SETTINGS ; OPCACHE SETTINGS
php_admin_value[opcache.memory_consumption] = 256 php_admin_value[opcache.memory_consumption] = 256
php_admin_value[opcache.enable] = 0 php_admin_value[opcache.enable] = 0
@@ -14,6 +16,8 @@ php_admin_value[opcache.max_accelerated_files] = 50000
php_admin_value[opcache.max_wasted_percentage] = 5 php_admin_value[opcache.max_wasted_percentage] = 5
php_admin_value[opcache.revalidate_freq] = 0 php_admin_value[opcache.revalidate_freq] = 0
php_admin_value[opcache.validate_timestamps] = 1 php_admin_value[opcache.validate_timestamps] = 1
php_admin_value[opcache.interned_strings_buffer] = 64
; PERFORMANCE LIMITS ; PERFORMANCE LIMITS
php_admin_value[max_input_vars] = 1000 php_admin_value[max_input_vars] = 1000

View File

@@ -20,7 +20,7 @@ gzip_vary on;
gzip_comp_level 4; gzip_comp_level 4;
gzip_min_length 256; gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
location = /robots.txt { location = /robots.txt {
allow all; allow all;
@@ -28,13 +28,14 @@ location = /robots.txt {
access_log off; access_log off;
} }
location = /.well-known/carddav { location ^~ /.well-known {
return 301 $scheme://$host:$server_port/remote.php/dav; location = /.well-known/carddav { return 301 /remote.php/dav/; }
} location = /.well-known/caldav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { location ^~ /.well-known { return 301 /index.php$uri; }
return 301 $scheme://$host:$server_port/remote.php/dav; try_files $uri $uri/ =404;
} }
location / { location / {
rewrite ^ /index.php; rewrite ^ /index.php;
} }
@@ -66,7 +67,7 @@ location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
index index.php; index index.php;
} }
location ~ \.(?:css|js|woff2?|svg|gif|map)$ { location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
try_files $uri /index.php$request_uri; try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463"; add_header Cache-Control "public, max-age=15778463";
add_header Referrer-Policy "no-referrer" always; add_header Referrer-Policy "no-referrer" always;
@@ -74,10 +75,30 @@ location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always; add_header X-Robots-Tag "none" always;
access_log off; access_log off;
location ~ \.wasm$ {
default_type application/wasm;
}
} }
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { location ~ \.woff2?$ {
try_files $uri /index.php$request_uri;
expires 7d;
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ {
try_files $uri /index.php$request_uri; try_files $uri /index.php$request_uri;
access_log off; access_log off;
} }
## Reverse proxy Config for 'Files High Performance Back-end'
#FHPBlocation ^~ /push/ {
#FHPB proxy_pass http://127.0.0.1:7867/;
#FHPB proxy_http_version 1.1;
#FHPB proxy_set_header Upgrade $http_upgrade;
#FHPB proxy_set_header Connection "Upgrade";
#FHPB proxy_set_header Host $host;
#FHPB proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#FHPB}
#endConf #endConf

View File

@@ -3,6 +3,7 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcl
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' "$phpPoolDir"/$sitename.conf sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' "$phpPoolDir"/$sitename.conf
groupadd "$sitename" groupadd "$sitename"
useradd -g "$sitename" "$sitename" useradd -g "$sitename" "$sitename"
usermod -a -G www-data "$sitename"
mkdir -p /var/www/"$domain"/html/data mkdir -p /var/www/"$domain"/html/data
#Getting Nextcloud #Getting Nextcloud
@@ -12,9 +13,8 @@ cp -a /tmp/nextcloud/. /var/www/"$domain"/html
touch /var/www/"$domain"/html/data/nextcloud.log > $OUTPUT 2>&1 touch /var/www/"$domain"/html/data/nextcloud.log > $OUTPUT 2>&1
#Creating DB #Creating DB
db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1` db_name="nextcloud_$SiteCount"
db_name="nextcloud_$db_suffix" db_user="nextcloud_$SiteCount"
db_user="nextcloud_$db_suffix"
db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo) db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo)
mysql -u root -p"$password" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" > $OUTPUT 2>&1
mysql -u root -p"$password" -e "CREATE USER '"$db_user"'@'localhost' IDENTIFIED BY '"$db_pass"';" > $OUTPUT 2>&1 mysql -u root -p"$password" -e "CREATE USER '"$db_user"'@'localhost' IDENTIFIED BY '"$db_pass"';" > $OUTPUT 2>&1
@@ -45,6 +45,19 @@ if [ "$shortdist" = "el8" ]; then
restorecon -r /var/www/ > $OUTPUT 2>&1 restorecon -r /var/www/ > $OUTPUT 2>&1
fi fi
#Enable PHP-ACPU on CLI
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
if ! grep -Fxq "apc.enable_cli=1" /etc/php/${phpver}/mods-available/apcu.ini; then
echo "apc.enable_cli=1" >> /etc/php/${phpver}/mods-available/apcu.ini
fi
elif [ "$shortdist" = "el8" ]; then
sed -i "/apc.enable_cli/c\apc.enable_cli=1" /etc/opt/remi/php${phpver//.}/php.d/40-apcu.ini
fi
#PHP 8.0 Settings
if [ "$phpVerBranch" = "8x" ]; then
sed -i "/opcache.enable/c\php_admin_value[opcache.enable] = 1" "$phpPoolDir"/"$sitename".conf
fi
#Makeing nextcloud Finalize script and setting login Notice #Makeing nextcloud Finalize script and setting login Notice
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/nextcloud-init.sh -o ~/NextcloudInit-"$sitename".sh curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/nextcloud-init.sh -o ~/NextcloudInit-"$sitename".sh

View File

@@ -4,16 +4,32 @@ sudo -u SITEname php /var/www/DOMAINname/html/occ app:disable firstrunwizard
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_language --value=nl sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_language --value=nl
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_locale --value=nl sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_locale --value=nl
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set default_phone_region --value=nl
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set skeletondirectory --value= sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set skeletondirectory --value=
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.local --value='\OC\Memcache\APCu' sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.local --value='\OC\Memcache\APCu'
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set trashbin_retention_obligation --value=30,30
if [ "$(systemctl is-active redis-server)" = "active" ] || [ "$(systemctl is-active redis)" = "active" ]; then if [ "$(systemctl is-active redis-server)" = "active" ] || [ "$(systemctl is-active redis)" = "active" ]; then
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.distributed --value='\OC\Memcache\Redis' sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.locking --value='\OC\Memcache\Redis' sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set memcache.locking --value='\OC\Memcache\Redis'
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis host --value=localhost sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis host --value=localhost
sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis port --value=6379 sudo -u SITEname php /var/www/DOMAINname/html/occ config:system:set redis port --value=6379
while true; do
read -p "Prepair for Files High Performance Back-end (Only for nginx) -> yes/no?" yn
case $yn in
[Nn]* )
break;;
[Yy]* )
sudo -u SITEname php /var/www/DOMAINname/html/occ app:install notify_push
sed -i --follow-symlinks 's/#FHPB//g' /etc/nginx/sites-enabled/SITEname
systemctl reload nginx
echo -e "\e[96m Run: sudo -u SITEname php /var/www/DOMAINname/html/occ notify_push:setup\e[39m"
break;;
* )echo "Choose yes or no.";;
esac
done
else else
echo "Redis running on this system" echo "Redis is not running on this system"
fi fi
echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab

View File

@@ -6,6 +6,8 @@ listen.owner = www-data
listen.group = www-data listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log
php_value[session.save_path] = /var/lib/php/sessions
; OPCACHE SETTINGS ; OPCACHE SETTINGS
php_admin_value[opcache.memory_consumption] = 256 php_admin_value[opcache.memory_consumption] = 256
php_admin_value[opcache.enable] = 0 php_admin_value[opcache.enable] = 0

View File

@@ -12,12 +12,13 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/F
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/' "$phpPoolDir"/$sitename.conf sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/' "$phpPoolDir"/$sitename.conf
groupadd "$sitename" groupadd "$sitename"
useradd -g "$sitename" "$sitename" useradd -g "$sitename" "$sitename"
usermod -a -G www-data "$sitename"
systemctl reload $phpFPMService systemctl reload $phpFPMService
fi
#Setting Permsissions #Setting Permsissions
chown "$sitename":"$sitename" -R /var/www/"$domain"/html chown "$sitename":"$sitename" -R /var/www/"$domain"/html
fi
if [ "$shortdist" = "el8" ]; then if [ "$shortdist" = "el8" ]; then
#Setting SeLiux perms for centos #Setting SeLiux perms for centos

View File

@@ -6,6 +6,8 @@ listen.owner = www-data
listen.group = www-data listen.group = www-data
php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log php_admin_value[error_log] = /var/log/php-fpm/error-SITEname.log
php_admin_value[disable_functions] = exec,passthru,shell_exec,system php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_value[session.save_path] = /var/lib/php/sessions
; OPCACHE SETTINGS ; OPCACHE SETTINGS
php_admin_value[opcache.memory_consumption] = 256 php_admin_value[opcache.memory_consumption] = 256
php_admin_value[opcache.enable] = 0 php_admin_value[opcache.enable] = 0

View File

@@ -6,9 +6,8 @@ if [ ! -f /usr/local/bin/wp ]; then
fi fi
#Creating DB #Creating DB
db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1` db_name="wp_$SiteCount"
db_name="wp_$db_suffix" db_user="wp_$SiteCount"
db_user="wp_$db_suffix"
db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo) db_pass=$(tr -dc 'A-Za-z0-9!#%()*+,-.:;<=>?@[]^_{|}~' </dev/urandom | head -c 30 ; echo)
WPSalts=$(curl --retry 7 --retry-delay 5 -s https://api.wordpress.org/secret-key/1.1/salt/) WPSalts=$(curl --retry 7 --retry-delay 5 -s https://api.wordpress.org/secret-key/1.1/salt/)
@@ -37,6 +36,7 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpr
sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' "$phpPoolDir"/$sitename.conf sed -i -e 's/PHPver/'$phpver'/g' -e 's/SITEname/'$sitename'/g' -e 's/DOMAINname/'$domain'/g' "$phpPoolDir"/$sitename.conf
groupadd "$sitename" groupadd "$sitename"
useradd -g "$sitename" "$sitename" useradd -g "$sitename" "$sitename"
usermod -a -G www-data "$sitename"
systemctl reload $phpFPMService systemctl reload $phpFPMService

View File

@@ -2,10 +2,10 @@ sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html core update
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html theme update --all sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html theme update --all
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install wp-fail2ban --activate sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install wp-fail2ban --activate
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install all-in-one-wp-migration --activate sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install all-in-one-wp-migration --activate
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install https://git.ictmaatwerk.com/downloads/wp/migrate.zip --activate #sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin install https://mirror.lan/downloads/wp/migrate.zip --activate
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html cron event run wp_update_plugins sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html cron event run wp_update_plugins
sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin update --all sudo -u SITEname /usr/local/bin/wp --path=/var/www/DOMAINname/html plugin update --all
echo -e "\e[96m Please update all-in-one-wp-migration-unlimited plugin manually\e[39m" #echo -e "\e[96m Please update all-in-one-wp-migration-unlimited plugin manually\e[39m"
sn2=SITEname sn2=SITEname
rm -f /etc/update-motd.d/51-wpnotice-${sn2//_} rm -f /etc/update-motd.d/51-wpnotice-${sn2//_}

View File

@@ -4,7 +4,7 @@ systemctl stop $apacheService > $OUTPUT 2>&1
# Apache # # Apache #
############## ##############
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
a2dissite 000-default > $OUTPUT 2>&1 a2dissite 000-default > $OUTPUT 2>&1
a2dismod mpm_prefork > $OUTPUT 2>&1 a2dismod mpm_prefork > $OUTPUT 2>&1
a2enmod actions fcgid alias proxy_fcgi proxy_http ssl headers http2 setenvif socache_shmcb rewrite > $OUTPUT 2>&1 a2enmod actions fcgid alias proxy_fcgi proxy_http ssl headers http2 setenvif socache_shmcb rewrite > $OUTPUT 2>&1
@@ -66,9 +66,11 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/to
sed -i -e 's#MONITCONF#'$monitconf'#' -e 's/APASRV/'$apacheService'/' -e 's#APADIR#'$apacheConfDir'#' /opt/toggle/toggle-MonitWebui.sh sed -i -e 's#MONITCONF#'$monitconf'#' -e 's/APASRV/'$apacheService'/' -e 's#APADIR#'$apacheConfDir'#' /opt/toggle/toggle-MonitWebui.sh
unset monitconf unset monitconf
# custom Welcome page # custom Welcome page
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /var/www/html/index.html echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /var/www/html/index.html
#Add Apache as SSL service
echo "$apacheService" >> /etc/WebV2/SslServices
systemctl start $apacheService > $OUTPUT 2>&1 systemctl start $apacheService > $OUTPUT 2>&1
systemctl enable $apacheService > $OUTPUT 2>&1 systemctl enable $apacheService > $OUTPUT 2>&1

View File

@@ -6,8 +6,8 @@
<VirtualHost *:443> <VirtualHost *:443>
ServerName DOMAINname ServerName DOMAINname
SSLEngine on SSLEngine on
SSLCertificateFile /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer SSLCertificateFile /etc/acmesh/inst/DOMAINname/fullchain.pem
SSLCertificateKeyFile /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key SSLCertificateKeyFile /etc/acmesh/inst/DOMAINname/key.pem
Include snippets/apa-ssl.conf Include snippets/apa-ssl.conf
#ConfHere #ConfHere

View File

@@ -6,8 +6,8 @@
<VirtualHost *:443> <VirtualHost *:443>
ServerName www.DOMAINname ServerName www.DOMAINname
SSLEngine on SSLEngine on
SSLCertificateFile /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer SSLCertificateFile /etc/acmesh/inst/DOMAINname/fullchain.pem
SSLCertificateKeyFile /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key SSLCertificateKeyFile /etc/acmesh/inst/DOMAINname/key.pem
Include snippets/apa-ssl.conf Include snippets/apa-ssl.conf
Redirect permanent / https://DOMAINname/ Redirect permanent / https://DOMAINname/
</VirtualHost> </VirtualHost>

View File

@@ -1,5 +1,5 @@
if [ ! -f "/etc/ICTM/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi if [ ! -f "/etc/WebV2/apachevar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GenerateApacheList.sh) ; fi
source /etc/ICTM/apachevar.list source /etc/WebV2/apachevar.list
for f in $apacheConfDir/sites-available/*; do for f in $apacheConfDir/sites-available/*; do
if [ $IMODE = n ] && [ $PhpPurge = 0 ]; then if [ $IMODE = n ] && [ $PhpPurge = 0 ]; then

View File

@@ -1,4 +1,4 @@
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
# Debian/Ubunbtu apache variables # Debian/Ubunbtu apache variables
apacheConfDir=/etc/apache2 apacheConfDir=/etc/apache2
apacheService=apache2 apacheService=apache2
@@ -11,7 +11,7 @@ fi
#Storing vars to config #Storing vars to config
for storeme in apacheService apacheConfDir; do for storeme in apacheService apacheConfDir; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/apachevar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/apachevar.list
done done
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=apache osrel=$shortdist bash > $OUTPUT 2>&1 > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=apache osrel=$shortdist bash > $OUTPUT 2>&1 > $OUTPUT 2>&1

View File

@@ -1,4 +1,4 @@
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
######################## ########################
# Debian/Ubunbtu # # Debian/Ubunbtu #
######################## ########################
@@ -6,7 +6,7 @@ if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist
# Repositories # # Repositories #
##--------------## ##--------------##
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=universe osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=universe osrel=$shortdist bash > $OUTPUT 2>&1
##------------## ##------------##
# System # # System #
##------------## ##------------##
@@ -39,7 +39,7 @@ elif [ "$shortdist" = "el8" ]; then
# Repositories # # Repositories #
##--------------## ##--------------##
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=epel osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=epel osrel=$shortdist bash > $OUTPUT 2>&1
##------------## ##------------##
# System # # System #
@@ -65,13 +65,7 @@ fi
# Prerequisite packages # # Prerequisite packages #
##-----------------------## ##-----------------------##
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1
##--------------##
# Repositories #
##--------------##
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=php osrel=$shortdist bash > $OUTPUT 2>&1
##------------## ##------------##

View File

@@ -42,7 +42,7 @@ mkdir -p /opt/toggle
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -o /opt/toggle/toggle-Netdata.sh curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -o /opt/toggle/toggle-Netdata.sh
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -o /opt/toggle/toggle-PhpMyAdmin.sh curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -o /opt/toggle/toggle-PhpMyAdmin.sh
##monit toggle ##monit toggle
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
monitconf=/etc/monit/monitrc monitconf=/etc/monit/monitrc
elif [ "$shortdist" = "el8" ]; then elif [ "$shortdist" = "el8" ]; then
monitconf=/etc/monitrc monitconf=/etc/monitrc
@@ -51,9 +51,11 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/to
sed -i -e 's#MONITCONF#'$monitconf'#' /opt/toggle/toggle-MonitWebui.sh sed -i -e 's#MONITCONF#'$monitconf'#' /opt/toggle/toggle-MonitWebui.sh
unset monitconf unset monitconf
# custom Welcome page # custom Welcome page
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html
#Add Nginx as SSL service
echo "nginx" >> /etc/WebV2/SslServices
systemctl start nginx > $OUTPUT 2>&1 systemctl start nginx > $OUTPUT 2>&1
systemctl enable nginx > $OUTPUT 2>&1 systemctl enable nginx > $OUTPUT 2>&1

View File

@@ -13,9 +13,9 @@ server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name DOMAINname; server_name DOMAINname;
ssl_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer; ssl_certificate /etc/acmesh/inst/DOMAINname/fullchain.pem;
ssl_certificate_key /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key; ssl_certificate_key /etc/acmesh/inst/DOMAINname/key.pem;
ssl_trusted_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer; ssl_trusted_certificate /etc/acmesh/inst/DOMAINname/fullchain.pem;
include snippets/ngx-ssl.conf; include snippets/ngx-ssl.conf;

View File

@@ -11,9 +11,9 @@ server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name www.DOMAINname; server_name www.DOMAINname;
ssl_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer; ssl_certificate /etc/acmesh/inst/DOMAINname/fullchain.pem;
ssl_certificate_key /etc/acmesh/certs/DOMAINname_ecc/DOMAINname.key; ssl_certificate_key /etc/acmesh/inst/DOMAINname/key.pem;
ssl_trusted_certificate /etc/acmesh/certs/DOMAINname_ecc/fullchain.cer; ssl_trusted_certificate /etc/acmesh/inst/DOMAINname/fullchain.pem;
include snippets/ngx-ssl.conf; include snippets/ngx-ssl.conf;
return 301 https://DOMAINname$request_uri; return 301 https://DOMAINname$request_uri;
} }

View File

@@ -1 +1 @@
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1

View File

@@ -28,5 +28,8 @@ sed -i -e 's/DOMAINname/'$domain'/g' /etc/nginx/sites-available/"$sitename"_ssl
# custom Welcome page # custom Welcome page
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html
#Add Nginx as SSL service
echo "nginx" >> /etc/WebV2/SslServices
systemctl start nginx > $OUTPUT 2>&1 systemctl start nginx > $OUTPUT 2>&1
systemctl enable nginx > $OUTPUT 2>&1 systemctl enable nginx > $OUTPUT 2>&1

View File

@@ -1,4 +1,4 @@
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash > $OUTPUT 2>&1
#Disable PhpMyadmin and Backend cms #Disable PhpMyadmin and Backend cms
disbackendcms=1 disbackendcms=1

View File

@@ -1 +1 @@
# Source files for https://git.ictmaatwerk.com/docs/Web-V2/ # Source files for Web-V2 Documentation

View File

@@ -60,4 +60,4 @@ add to the “`<WebserverName>`Options” variable after the last entry
Make sure the the entry is quoted, otherwise the installer will break Make sure the the entry is quoted, otherwise the installer will break
### Extra step for external modules ### Extra step for external modules
For external modules the raw git url shoud be added to “extModules.list” For external modules the raw git url shoud be added to “extModules.list”
Example: https://git.ictmaatwerk.com/`<user>`/`<reponame>`/raw/branch/master/ Example: https://git.bprieshof.nl/`<user>`/`<reponame>`/raw/branch/main/

View File

@@ -2,36 +2,36 @@
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.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
bash /tmp/installer.sh bash /tmp/installer.sh
``` ```
Using wget Using wget
``` ```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh wget https://git.bprieshof.nl/Work_Archive/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 Using curl
``` ```
curl https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh curl https://git.bprieshof.nl/Work_Archive/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 Using wget
``` ```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh wget https://git.bprieshof.nl/Work_Archive/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 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.
``` ```
bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendCMS.sh) bash <(curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/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
``` ```
bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/AppendModule.sh) bash <(curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/AppendModule.sh)
``` ```

View File

@@ -1,7 +1,7 @@
site_name: Web-V2 site_name: Web-V2
theme: slate theme: slate
repo_name: 'Git Repo' repo_name: 'Git Repo'
repo_url: https://git.ictmaatwerk.com/VPS-scripts/Web-V2/src/branch/master repo_url: https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/src/branch/master
nav: nav:
- User: 'User-MainInfo.md' - User: 'User-MainInfo.md'
- Development: - Development:

View File

@@ -1,14 +1,21 @@
#sysCheck #sysCheck
if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
rm /tmp/pkg.list rm /tmp/pkg.list
#Getting variables #Getting variables
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi
if [ ! -f "/etc/ICTM/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi if [ ! -f "/etc/WebV2/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi
source /etc/ICTM/phpvar.list source /etc/WebV2/phpvar.list
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ]; then
# Ubuntu Php variable
apt update apt update
RepoVersion=`apt list |grep php | grep deb.sury.org| cut -f1 -d"-"| tail -1 |sed 's/php//'` if ! ls /var/lib/apt/lists/ppa.launchpad.net_ondrej_php*_Packages > /dev/null 2>&1 ; then echo 'PHP(Sury) repo not installed' && echo 'Install using: curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=php bash' && exit ; fi
RepoVersion=`grep -h '^Package: php' /var/lib/apt/lists/ppa.launchpad.net_ondrej_php*_Packages | cut -f1 -d"-" | sort | tail -1| sed -e 's/Package: php//'`
elif [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] || [ "$shortdist" = "deb12" ]; then
# Debian Php variable
apt update
if ! ls /var/lib/apt/lists/packages.sury.org_php*_Packages > /dev/null 2>&1 ; then echo 'PHP(Sury) repo not installed' && echo 'Install using: curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=php bash' && exit ; fi
RepoVersion=`grep -h '^Package: php' /var/lib/apt/lists/packages.sury.org*_Packages| cut -f1 -d"-" | sort | tail -1| sed -e 's/Package: php//'`
elif [ "$shortdist" = "el8" ]; then elif [ "$shortdist" = "el8" ]; then
dnf check-update --refresh dnf check-update --refresh
RepoVersion=`dnf list php* | awk '{print $1; }' | cut -f1 -d"-"| tail -1 |sed 's/php//' | sed 's/./&./1'` RepoVersion=`dnf list php* | awk '{print $1; }' | cut -f1 -d"-"| tail -1 |sed 's/php//' | sed 's/./&./1'`
@@ -22,17 +29,16 @@ msg () {
fi fi
} }
msg "Current php version: $phpver"
if [ $IMODE = n ]; then if [ $IMODE = n ]; then
# Legacy/Main Menu # Legacy/Main Menu
PKGD="debconf-apt-progress -- apt purge -y" PKGD="debconf-apt-progress -- apt purge -y"
#Menu #Menu
if (whiptail --title "Set new php version?" --yesno "Install php version $RepoVersion ?" 8 78); then if (whiptail --title "Php Upgrader" --yesno " Current php version is $phpver, and $RepoVersion the is latest available version" --yes-button "Yes, upgrade to this version" --no-button "No, i want to choose" 8 100); then
newphpver=$RepoVersion newphpver=$RepoVersion
else else
newphpver=$(whiptail --inputbox "Please enter the version to install" --title "Custom" 8 39 3>&1 1>&2 2>&3) newphpver=$(whiptail --inputbox "Please enter the version to install" --nocancel --title "Php Upgrader" 8 50 3>&1 1>&2 2>&3)
fi fi
fi fi
@@ -42,7 +48,7 @@ if [ $IMODE = l ]; then
#Menu #Menu
while true; do while true; do
read -p "Set phpversion to version $RepoVersion ? -> yes/no?" yn read -p "Current php version is $phpver, and $RepoVersion the is latest available version -> Yes, upgrade to this version/No, i want to choose? " yn
case $yn in case $yn in
[Yy]* ) newphpver=$RepoVersion [Yy]* ) newphpver=$RepoVersion
break;; break;;
@@ -55,7 +61,7 @@ if [ $IMODE = l ]; then
fi fi
#Genereating vars for new php version #Genereating vars for new php version
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] || [ "$shortdist" = "deb12" ] ; then
# Debian/Ubunbtu Php variables # Debian/Ubunbtu Php variables
newphpPoolDir=/etc/php/${newphpver}/fpm/pool.d newphpPoolDir=/etc/php/${newphpver}/fpm/pool.d
newphpPkgName=php${newphpver} newphpPkgName=php${newphpver}
@@ -87,7 +93,7 @@ if [ $IMODE = l ]; then
if [ $IMODE = n ]; then if [ $IMODE = n ]; then
#Purge #Purge
if (whiptail --title "Set new php version?" --yesno "Remove php $phpver ?" 8 78); then if (whiptail --title "Php Upgrader" --yesno "Remove old php version ($phpver) ?" 8 78); then
PhpPurge=1 PhpPurge=1
$PKGP -y $phpPkgName* $PKGP -y $phpPkgName*
else else
@@ -100,7 +106,7 @@ fi
if [ $IMODE = l ]; then if [ $IMODE = l ]; then
#Purge #Purge
while true; do while true; do
read -p "Remove php $phpver ? -> yes/no?" yn read -p "Remove old php version ($phpver) ? -> yes/no?" yn
case $yn in case $yn in
[Yy]* ) PhpPurge=1 ; $PKGP $phpPkgName* [Yy]* ) PhpPurge=1 ; $PKGP $phpPkgName*
break;; break;;
@@ -120,13 +126,13 @@ systemctl start $newphpFPMService
systemctl enable $newphpFPMService systemctl enable $newphpFPMService
sed -i "/phpver/c\phpver=\"$newphpver\"" /etc/ICTM/mainvar.list sed -i "/phpver/c\phpver=\"$newphpver\"" /etc/WebV2/mainvar.list
mv /etc/ICTM/phpvar.list /etc/ICTM/phpvar"$phpver".list mv /etc/WebV2/phpvar.list /etc/WebV2/phpvar"$phpver".list
for storeme in newphpPoolDir newphpPkgName newphpMainConf newphpFPMService; do for storeme in newphpPoolDir newphpPkgName newphpMainConf newphpFPMService; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/phpvar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/phpvar.list
done done
sed -i 's/new//' /etc/ICTM/phpvar.list sed -i 's/new//' /etc/WebV2/phpvar.list
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh) source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh)

View File

@@ -3,36 +3,36 @@
**Default/Graphical installer**: **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.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/installer.sh -o /tmp/installer.sh
bash /tmp/installer.sh bash /tmp/installer.sh
``` ```
Using wget Using wget
``` ```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh wget https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh
bash /tmp/installer.sh bash /tmp/installer.sh
``` ```
**Legacy Installer for developing and debugging**: **Legacy Installer for developing and debugging**:
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.bprieshof.nl/Work_Archive/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 Using wget
``` ```
wget https://git.ictmaatwerk.com/VPS-scripts/Web-V2/raw/branch/master/installer.sh -O /tmp/installer.sh wget https://git.bprieshof.nl/Work_Archive/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 ## 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) bash <(curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2/raw/branch/master/AppendCMS.sh)
``` ```
## Adding extra Module after instalation ## 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) bash <(curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work_Archive/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:
@@ -41,5 +41,4 @@ bash <(curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts
* VPS-scripts/Ubuntu-MySQL * VPS-scripts/Ubuntu-MySQL
``` ```
----- -----
### Further documentation can be found at https://git.ictmaatwerk.com/docs/Web-V2/

View File

@@ -1,7 +1,7 @@
if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
#Getting information and vars #Getting information and vars
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
#CompatUpdater Setup #CompatUpdater Setup
UpdaterCompatTo=2 UpdaterCompatTo=2
@@ -17,7 +17,7 @@ aonoption="/MySQL/"
aonoption="$aonoption /Unattended-Security-Updates/" aonoption="$aonoption /Unattended-Security-Updates/"
aonoption="$aonoption /Backup-Util/" aonoption="$aonoption /Backup-Util/"
aonoption="$aonoption /AcmeSH/" aonoption="$aonoption /AcmeSH/"
echo 'EnabledAons=('$aonoption')' >> /etc/ICTM/selopts.list echo 'EnabledAons=('$aonoption')' >> /etc/WebV2/selopts.list
declare -p CompatVer | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list declare -p CompatVer | cut -d ' ' -f 3- >> /etc/WebV2/mainvar.list
printf " [\033[0;32mok\033[0m]\n" printf " [\033[0;32mok\033[0m]\n"

View File

@@ -1,5 +1,5 @@
#loading install vars #loading install vars
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
#Setting Vars #Setting Vars
sitename=CONFname sitename=CONFname
domain=DOMAINname domain=DOMAINname
@@ -9,7 +9,7 @@ webservice=WebServer
#Correcting service name for Apache #Correcting service name for Apache
if [ $webservice = apache ]; then\ if [ $webservice = apache ]; then\
source /etc/ICTM/apachevar.list source /etc/WebV2/apachevar.list
webservice="$apacheService" webservice="$apacheService"
ext=.conf ext=.conf
fi fi
@@ -37,6 +37,8 @@ fi
if test $certsatus -eq 0 if test $certsatus -eq 0
then then
site_ext="ssl" site_ext="ssl"
mkdir -p /etc/acmesh/inst/$domain
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --install-cert --ecc --domain $domain --cert-file /etc/acmesh/inst/$domain/cert.pem --key-file /etc/acmesh/inst/$domain/key.pem --ca-file /etc/acmesh/inst/$domain/ca.cer --fullchain-file /etc/acmesh/inst/$domain/fullchain.pem --reloadcmd 'systemctl reload $(cat /etc/WebV2/SslServices)'
else else
site_ext="nossl" site_ext="nossl"
rm -rf /etc/acmesh/certs/$domain* rm -rf /etc/acmesh/certs/$domain*

View File

@@ -1,8 +1,8 @@
if [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
# Debian/Ubunbtu apache variables # Debian/Ubunbtu apache variables
apacheConfDir=/etc/apache2 apacheConfDir=/etc/apache2
apacheService=apache2 apacheService=apache2
@@ -15,5 +15,5 @@ fi
#Storing vars to config #Storing vars to config
for storeme in apacheService apacheConfDir; do for storeme in apacheService apacheConfDir; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/apachevar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/apachevar.list
done done

View File

@@ -1,8 +1,8 @@
if [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi if [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
source /etc/ICTM/mainvar.list source /etc/WebV2/mainvar.list
if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
# Debian/Ubunbtu Php variables # Debian/Ubunbtu Php variables
phpPoolDir=/etc/php/${phpver}/fpm/pool.d phpPoolDir=/etc/php/${phpver}/fpm/pool.d
phpPkgName=php${phpver} phpPkgName=php${phpver}
@@ -19,5 +19,5 @@ fi
#Storing vars to config #Storing vars to config
for storeme in phpPoolDir phpPkgName phpMainConf phpFPMService; do for storeme in phpPoolDir phpPkgName phpMainConf phpFPMService; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/phpvar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/phpvar.list
done done

View File

@@ -7,6 +7,8 @@ if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
shortdist=ubu2004 shortdist=ubu2004
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
shortdist=deb10 shortdist=deb10
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then
shortdist=deb11
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
shortdist=el8 shortdist=el8
else else

View File

@@ -0,0 +1,25 @@
#!/bin/bash
#######################################################
# @description: #
# Setup the PHP session folder as a Ramdisk / tmpfs #
# This will store session info in memory #
# #
# @author: Bram Prieshof #
#######################################################
#sysCheck
if [ ! -f "/etc/WebV2/selopts.list" ] || [ ! -f "/etc/WebV2/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi
if [ ! -f "/etc/WebV2/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi
source /etc/WebV2/phpvar.list
#Stop php service
systemctl stop $phpFPMService
#Reset php session folder
rm -rf /var/lib/php/sessions
mkdir -p /var/lib/php/sessions
#Create memdisk/Tmpfs and mount it
echo "tmpfs /var/lib/php/sessions tmpfs size=32m,uid=$(id -u www-data),gid=$(id -g www-data),mode=0773 0 0" >> /etc/fstab
mount -a
#start php service
systemctl stop $phpFPMService

View File

@@ -45,14 +45,18 @@ 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
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then
echo "Debian 11 Detected"
PKGM="$APTMODE"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=deb11
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"
PKGI="${PKGM} install --setopt=install_weak_deps=False --best -y" PKGI="${PKGM} install --setopt=install_weak_deps=False --best -y"
PKGLIST="dnf" PKGLIST="dnf"
shortdist=el8 shortdist=el8
echo "This OS is not supported"
exit
else else
echo "This OS is not supported" echo "This OS is not supported"
exit exit
@@ -62,8 +66,8 @@ unset dist_ver dist APTMODE
#Repo Vars #Repo Vars
repo=https://git.ictmaatwerk.com/VPS-scripts/Web-V2 repo=https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2
branch=master branch=main
branchtype=branch branchtype=branch
###Select Module type ###Select Module type
@@ -133,7 +137,7 @@ fi
##--------------------## ##--------------------##
msg " Preconfiguring" msg " Preconfiguring"
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1
$PKGUC $PKGUC
$PKGUP $PKGUP

View File

@@ -7,25 +7,25 @@ function usage {
echo echo
} }
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [[ ! -f /etc/ICTM/toggle.conf ]]; then if [[ ! -f /etc/WebV2/toggle.conf ]]; then
echo "Creating File" echo "Creating File"
touch /etc/ICTM/toggle.conf touch /etc/WebV2/toggle.conf
fi fi
source /etc/ICTM/toggle.conf source /etc/WebV2/toggle.conf
if [ -z "$MonitWeb" ]; then if [ -z "$MonitWeb" ]; then
echo "Creating Var" echo "Creating Var"
echo "MonitWeb=3" >> /etc/ICTM/toggle.conf echo "MonitWeb=3" >> /etc/WebV2/toggle.conf
MonitWeb=3 MonitWeb=3
fi fi
if [[ "$1" = "-d" && "$MonitWeb" != 0 ]]; then if [[ "$1" = "-d" && "$MonitWeb" != 0 ]]; then
echo "Disable MonitWebui" echo "Disable MonitWebui"
sed -i '/MonitWeb=/c\MonitWeb=0' /etc/ICTM/toggle.conf sed -i '/MonitWeb=/c\MonitWeb=0' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/#enables\/disables monit-websocket/!b;n;cdeny from all' /APADIR/sites-enabled/010-Backend.conf sed -i --follow-symlinks '/#enables\/disables monit-websocket/!b;n;cdeny from all' /APADIR/sites-enabled/010-Backend.conf
sed -i '/#enables\/disables monit-websocket/ s/^#*/#/' MONITCONF sed -i '/#enables\/disables monit-websocket/ s/^#*/#/' MONITCONF
systemctl reload APASRV monit systemctl reload APASRV monit
elif [[ "$1" = "-e" && "$MonitWeb" != 1 ]]; then elif [[ "$1" = "-e" && "$MonitWeb" != 1 ]]; then
echo "Enable MonitWebui" echo "Enable MonitWebui"
sed -i '/MonitWeb=/c\MonitWeb=1' /etc/ICTM/toggle.conf sed -i '/MonitWeb=/c\MonitWeb=1' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/#enables\/disables monit-websocket/!b;n;c#deny from all' /APADIR/sites-enabled/010-Backend.conf sed -i --follow-symlinks '/#enables\/disables monit-websocket/!b;n;c#deny from all' /APADIR/sites-enabled/010-Backend.conf
sed -i '/#enables\/disables monit-websocket/ s/^.//' MONITCONF sed -i '/#enables\/disables monit-websocket/ s/^.//' MONITCONF
systemctl reload APASRV monit systemctl reload APASRV monit

View File

@@ -7,25 +7,25 @@ function usage {
echo echo
} }
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [[ ! -f /etc/ICTM/toggle.conf ]]; then if [[ ! -f /etc/WebV2/toggle.conf ]]; then
echo "Creating File" echo "Creating File"
touch /etc/ICTM/toggle.conf touch /etc/WebV2/toggle.conf
fi fi
source /etc/ICTM/toggle.conf source /etc/WebV2/toggle.conf
if [ -z "$MonitWeb" ]; then if [ -z "$MonitWeb" ]; then
echo "Creating Var" echo "Creating Var"
echo "MonitWeb=3" >> /etc/ICTM/toggle.conf echo "MonitWeb=3" >> /etc/WebV2/toggle.conf
MonitWeb=3 MonitWeb=3
fi fi
if [[ "$1" = "-d" && "$MonitWeb" != 0 ]]; then if [[ "$1" = "-d" && "$MonitWeb" != 0 ]]; then
echo "Disable MonitWebui" echo "Disable MonitWebui"
sed -i '/MonitWeb=/c\MonitWeb=0' /etc/ICTM/toggle.conf sed -i '/MonitWeb=/c\MonitWeb=0' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables monit-websocket/c\ deny all; #enables\/disables monit-websocket' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables monit-websocket/c\ deny all; #enables\/disables monit-websocket' /etc/nginx/sites-enabled/Backend
sed -i '/#enables\/disables monit-websocket/ s/^#*/#/' MONITCONF sed -i '/#enables\/disables monit-websocket/ s/^#*/#/' MONITCONF
systemctl reload nginx monit systemctl reload nginx monit
elif [[ "$1" = "-e" && "$MonitWeb" != 1 ]]; then elif [[ "$1" = "-e" && "$MonitWeb" != 1 ]]; then
echo "Enable MonitWebui" echo "Enable MonitWebui"
sed -i '/MonitWeb=/c\MonitWeb=1' /etc/ICTM/toggle.conf sed -i '/MonitWeb=/c\MonitWeb=1' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables monit-websocket/c\ #deny all; #enables\/disables monit-websocket' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables monit-websocket/c\ #deny all; #enables\/disables monit-websocket' /etc/nginx/sites-enabled/Backend
sed -i '/#enables\/disables monit-websocket/ s/^.//' MONITCONF sed -i '/#enables\/disables monit-websocket/ s/^.//' MONITCONF
systemctl reload nginx monit systemctl reload nginx monit

View File

@@ -7,26 +7,26 @@ function usage {
echo echo
} }
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [[ ! -f /etc/ICTM/toggle.conf ]]; then if [[ ! -f /etc/WebV2/toggle.conf ]]; then
echo "Creating File" echo "Creating File"
touch /etc/ICTM/toggle.conf touch /etc/WebV2/toggle.conf
fi fi
source /etc/ICTM/toggle.conf source /etc/WebV2/toggle.conf
if [ -z "$NetDa" ]; then if [ -z "$NetDa" ]; then
echo "Creating Var" echo "Creating Var"
echo "NetDa=3" >> /etc/ICTM/toggle.conf echo "NetDa=3" >> /etc/WebV2/toggle.conf
NetDa=3 NetDa=3
fi fi
if [[ "$1" = "-d" && "$NetDa" != 0 ]]; then if [[ "$1" = "-d" && "$NetDa" != 0 ]]; then
echo "Disable Netdata" echo "Disable Netdata"
sed -i '/NetDa=/c\NetDa=0' /etc/ICTM/toggle.conf sed -i '/NetDa=/c\NetDa=0' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables Netdata/c\ deny all; #enables\/disables Netdata' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables Netdata/c\ deny all; #enables\/disables Netdata' /etc/nginx/sites-enabled/Backend
systemctl stop netdata systemctl stop netdata
systemctl disable netdata > /dev/null 2>&1 systemctl disable netdata > /dev/null 2>&1
systemctl reload nginx systemctl reload nginx
elif [[ "$1" = "-e" && "$NetDa" != 1 ]]; then elif [[ "$1" = "-e" && "$NetDa" != 1 ]]; then
echo "Enable Netdata" echo "Enable Netdata"
sed -i '/NetDa=/c\NetDa=1' /etc/ICTM/toggle.conf sed -i '/NetDa=/c\NetDa=1' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables Netdata/c\ #deny all; #enables\/disables Netdata' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables Netdata/c\ #deny all; #enables\/disables Netdata' /etc/nginx/sites-enabled/Backend
systemctl start netdata systemctl start netdata
systemctl enable netdata > /dev/null 2>&1 systemctl enable netdata > /dev/null 2>&1

View File

@@ -7,24 +7,24 @@ function usage {
echo echo
} }
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [[ ! -f /etc/ICTM/toggle.conf ]]; then if [[ ! -f /etc/WebV2/toggle.conf ]]; then
echo "Creating File" echo "Creating File"
touch /etc/ICTM/toggle.conf touch /etc/WebV2/toggle.conf
fi fi
source /etc/ICTM/toggle.conf source /etc/WebV2/toggle.conf
if [ -z "$PhpMA" ]; then if [ -z "$PhpMA" ]; then
echo "Creating Var" echo "Creating Var"
echo "PhpMA=3" >> /etc/ICTM/toggle.conf echo "PhpMA=3" >> /etc/WebV2/toggle.conf
PhpMA=3 PhpMA=3
fi fi
if [[ "$1" = "-d" && "$PhpMA" != 0 ]]; then if [[ "$1" = "-d" && "$PhpMA" != 0 ]]; then
echo "Disable PhpMyadmin" echo "Disable PhpMyadmin"
sed -i '/PhpMA=/c\PhpMA=0' /etc/ICTM/toggle.conf sed -i '/PhpMA=/c\PhpMA=0' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;cdeny from all' /APADIR/sites-enabled/010-Backend.conf sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;cdeny from all' /APADIR/sites-enabled/010-Backend.conf
systemctl reload APASRV systemctl reload APASRV
elif [[ "$1" = "-e" && "$PhpMA" != 1 ]]; then elif [[ "$1" = "-e" && "$PhpMA" != 1 ]]; then
echo "Enable PhpMyadmin" echo "Enable PhpMyadmin"
sed -i '/PhpMA=/c\PhpMA=1' /etc/ICTM/toggle.conf sed -i '/PhpMA=/c\PhpMA=1' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;c#deny from all' /APADIR/sites-enabled/010-Backend.conf sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;c#deny from all' /APADIR/sites-enabled/010-Backend.conf
systemctl reload APASRV systemctl reload APASRV
elif [[ "$1" = "-h" ]]; then elif [[ "$1" = "-h" ]]; then

View File

@@ -7,24 +7,24 @@ function usage {
echo echo
} }
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [[ ! -f /etc/ICTM/toggle.conf ]]; then if [[ ! -f /etc/WebV2/toggle.conf ]]; then
echo "Creating File" echo "Creating File"
touch /etc/ICTM/toggle.conf touch /etc/WebV2/toggle.conf
fi fi
source /etc/ICTM/toggle.conf source /etc/WebV2/toggle.conf
if [ -z "$PhpMA" ]; then if [ -z "$PhpMA" ]; then
echo "Creating Var" echo "Creating Var"
echo "PhpMA=3" >> /etc/ICTM/toggle.conf echo "PhpMA=3" >> /etc/WebV2/toggle.conf
PhpMA=3 PhpMA=3
fi fi
if [[ "$1" = "-d" && "$PhpMA" != 0 ]]; then if [[ "$1" = "-d" && "$PhpMA" != 0 ]]; then
echo "Disable PhpMyadmin" echo "Disable PhpMyadmin"
sed -i '/PhpMA=/c\PhpMA=0' /etc/ICTM/toggle.conf sed -i '/PhpMA=/c\PhpMA=0' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables PHPMyadmin/c\ deny all; #enables\/disables PHPMyadmin' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables PHPMyadmin/c\ deny all; #enables\/disables PHPMyadmin' /etc/nginx/sites-enabled/Backend
systemctl reload nginx systemctl reload nginx
elif [[ "$1" = "-e" && "$PhpMA" != 1 ]]; then elif [[ "$1" = "-e" && "$PhpMA" != 1 ]]; then
echo "Enable PhpMyadmin" echo "Enable PhpMyadmin"
sed -i '/PhpMA=/c\PhpMA=1' /etc/ICTM/toggle.conf sed -i '/PhpMA=/c\PhpMA=1' /etc/WebV2/toggle.conf
sed -i --follow-symlinks '/deny all; #enables\/disables PHPMyadmin/c\ #deny all; #enables\/disables PHPMyadmin' /etc/nginx/sites-enabled/Backend sed -i --follow-symlinks '/deny all; #enables\/disables PHPMyadmin/c\ #deny all; #enables\/disables PHPMyadmin' /etc/nginx/sites-enabled/Backend
systemctl reload nginx systemctl reload nginx
elif [[ "$1" = "-h" ]]; then elif [[ "$1" = "-h" ]]; then

View File

@@ -15,6 +15,10 @@ sed -i 's/upload_max_filesize = 2/upload_max_filesize = 128/g' "$phpMainConf"
sed -i 's/post_max_size = 8/post_max_size = 64/g' "$phpMainConf" sed -i 's/post_max_size = 8/post_max_size = 64/g' "$phpMainConf"
#Php session to disk
chown www-data:www-data /var/lib/php/sessions
chmod 1773 /var/lib/php/sessions
if [ "$shortdist" = "el8" ]; then if [ "$shortdist" = "el8" ]; then
# Centos Mysql config # Centos Mysql config
echo "pdo_mysql.default_socket = '/var/run/mysqld/mysqld.sock'" >> /etc/opt/remi/php${phpver//.}/php.d/60-mysql_sock.ini echo "pdo_mysql.default_socket = '/var/run/mysqld/mysqld.sock'" >> /etc/opt/remi/php${phpver//.}/php.d/60-mysql_sock.ini

View File

@@ -0,0 +1,176 @@
#############################
# SingleModuleInstaller #
# For PHP-FPM #
#############################
##-----------------##
# Defining Vars #
##-----------------##
#SMI specific Vars
SMI_config=yes
SMI_ModuleName=php-fpm
#Enforcing Legacy Mode
APTMODE="apt"
OUTPUT='/dev/tty'
IMODE=l
#Web-V2 Vars
phpver=8.1
webserv=nginx
#PackageManager-config
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=ubu1804
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=ubu2004
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=deb10
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=deb11
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"12"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=deb12
elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then
PKGM="dnf"
PKGUC="$PKGM check-update --refresh"
PKGUP="$PKGM update -y"
PKGI="${PKGM} install --setopt=install_weak_deps=False --best -y"
PKGLIST="dnf"
shortdist=el8
else
echo "This os in not supported"
exit
fi
unset dist_ver dist APTMODE
#Repo Vars
repo=https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2
branch=main
branchtype=branch
###Select Module type
mtype=""$repo"/raw/"$branchtype"/"$branch"/SubModules/"$SMI_ModuleName""
#SelfBuilding Vars
PKGI="${PKGM} install -y"
##---------------##
# Functions #
##---------------##
msg () {
echo "$1"
}
#Checking if Config var has been set
if [ $SMI_config = no ]; then
msg " Script is not configured"
exit
fi
##-----------------##
# Storeing vars #
##-----------------##
mkdir -p /etc/WebV2
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/WebV2/mainvar.list
for storeme in PKGM PKGI PKGUC PKGUP PKGLIST OUTPUT IMODE shortdist repo branch branchtype shortdist phpver webserv; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/mainvar.list
done
echo 'EnabledAons=('$SMI_ModuleName')' >> /etc/WebV2/selopts.list
##--------------------------##
# Installer-Requirements #
##--------------------------##
msg " Starting installer" 8 78
$PKGUC > $OUTPUT 2>&1
$PKGI curl > $OUTPUT 2>&1
##-------------------------##
# Generating APT list #
##-------------------------##
#Remove existing pkgList
rm -f /tmp/pkg.list
##--------------------##
# Pre-Requirements #
##--------------------##
msg " Preconfiguring"
curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash > $OUTPUT 2>&1
$PKGUC
$PKGUP
##-------------------##
# Pre-configuring #
##-------------------##
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$mtype"/preconf.sh)
fi
echo less >> /tmp/pkg.list
printf " " >>/tmp/pkg.list
##-------------##
# Installer #
##-------------##
$PKGUC
sed -i 's/PHPprefix/'$phpPkgName'/g' /tmp/pkg.list
cat /tmp/pkg.list | xargs $PKGI
##---------------##
# Configuring #
##---------------##
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$mtype"/conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$mtype"/conf.sh)
fi
##-------##
# end #
##-------##
msg " Done!"

View File

@@ -1,4 +1,7 @@
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then #Setting up repository
curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=php osrel=$shortdist bash > $OUTPUT 2>&1
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] || [ "$shortdist" = "deb12" ] ; then
# Debian/Ubunbtu Php variables # Debian/Ubunbtu Php variables
phpPoolDir=/etc/php/${phpver}/fpm/pool.d phpPoolDir=/etc/php/${phpver}/fpm/pool.d
phpPkgName=php${phpver} phpPkgName=php${phpver}
@@ -12,7 +15,7 @@ elif [ "$shortdist" = "el8" ]; then
phpMainConf=/etc/opt/remi/php${phpver//.}/php.ini phpMainConf=/etc/opt/remi/php${phpver//.}/php.ini
phpFPMService=php${phpver//.}-php-fpm phpFPMService=php${phpver//.}-php-fpm
#Creating Socket directory #Creating Socket directory
mkdir -p /var/run/php mkdir -p /var/run/php /var/lib/php/sessions
fi fi
#Setting php version branch #Setting php version branch
@@ -35,5 +38,5 @@ fi
#Storing vars to config #Storing vars to config
for storeme in phpPoolDir phpPkgName phpMainConf phpFPMService phpVerBranch; do for storeme in phpPoolDir phpPkgName phpMainConf phpFPMService phpVerBranch; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/phpvar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/phpvar.list
done done

View File

@@ -0,0 +1,32 @@
#Sript for setting up SSL/TLS for Postfix (Web-V2)
##Loading install vars
source /etc/WebV2/mainvar.list
##Checking if hostname cert exists
if [ ! -f "/etc/acmesh/inst/$hostname/cert.pem" ] || [ ! -f "/etc/acmesh/inst/$hostname/key.pem" ] ; then echo 'SSL Certificate for $hostname is not installed' && exit ; fi
##Updating Postix config
printf "Updating Postfix config"
systemctl stop postfix
sed -i "/smtpd_tls_cert_file=/c\ssmtpd_tls_cert_file=/etc/acmesh/inst/$hostname/cert.pem" /etc/postfix/main.cf
sed -i "/smtpd_tls_key_file=/c\smtpd_tls_key_file=/etc/acmesh/inst/$hostname/key.pem" /etc/postfix/main.cf
systemctl start postfix
printf " [\e[1;32m Ok \e[0m]\n"
##Adding postfix to SSL services (so it gets reloaded when a the cert is renewd)
printf "Updating SSL services list"
echo "postfix" >> /etc/WebV2/SslServices
printf " [\e[1;32m Ok \e[0m]\n"
##Remove script
while true; do
read -p "Remove this script -> yes/no?" yn
case $yn in
[Nn]* )
break;;
[Yy]* )
rm -- "$0"
break;;
* )echo "Choose yes or no.";;
esac
done

View File

@@ -52,7 +52,7 @@ ${hostname}
EOF EOF
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
mkdir -p /var/spool/postfix/var/run/opendkim mkdir -p /var/spool/postfix/var/run/opendkim
sudo chown opendkim:postfix /var/spool/postfix/var/run/opendkim sudo chown opendkim:postfix /var/spool/postfix/var/run/opendkim
sed -i "/^RUNDIR=/c\RUNDIR=/var/spool/postfix/var/run/opendkim" /etc/default/opendkim sed -i "/^RUNDIR=/c\RUNDIR=/var/spool/postfix/var/run/opendkim" /etc/default/opendkim
@@ -90,9 +90,12 @@ chmod +x /etc/update-motd.d/51-generalspf
systemctl start postfix opendkim systemctl start postfix opendkim
systemctl enable postfix opendkim systemctl enable postfix opendkim
#Getting script for enableling ssl on Postfix
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/Postfix-EnableSSL.sh -o ~/Postfix-EnableSSL.sh
#if using Append module run for existing cms/sites #if using Append module run for existing cms/sites
if [ "$itype" = "AddMod" ]; then if [ "$itype" = "AddMod" ]; then
for file in /etc/ICTM/sites/*; do for file in /etc/WebV2/sites/*; do
sitename="${file##*/}" sitename="${file##*/}"
domain=${sitename//_/.} domain=${sitename//_/.}
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/CMSHook-preconf.sh) source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/CMSHook-preconf.sh)

View File

@@ -1,4 +1,4 @@
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
debconf-set-selections <<< "postfix postfix/mailname string $hostname" debconf-set-selections <<< "postfix postfix/mailname string $hostname"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'" debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
fi fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
# Debian/Ubunbtu redis variables # Debian/Ubunbtu redis variables
redisService=redis-server redisService=redis-server
@@ -10,4 +10,4 @@ elif [ "$shortdist" = "el8" ]; then
fi fi
curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=redis osrel=$shortdist bash > $OUTPUT 2>&1 curl --retry 7 --retry-delay 5 -s https://git.bprieshof.nl/Work/PKGRepoSetup/raw/branch/Main/Setup-Repo.sh |repo=redis osrel=$shortdist bash > $OUTPUT 2>&1

View File

@@ -1,4 +1,4 @@
https://git.ictmaatwerk.com/VPS-scripts/MySQL/raw/branch/master/ https://git.bprieshof.nl/Work_Archive/VPS-scripts_MySQL/raw/branch/main/
https://git.ictmaatwerk.com/VPS-scripts/Unattended-Security-Updates/raw/branch/master/ https://git.bprieshof.nl/Work_Archive/VPS-scripts_Unattended-Security-Updates/raw/branch/main/
https://git.ictmaatwerk.com/VPS-scripts/Backup-Util/raw/branch/master/ https://git.bprieshof.nl/Work_Archive/VPS-scripts_Backup-Util/raw/branch/master/
https://git.ictmaatwerk.com/VPS-scripts/AcmeSH/raw/branch/main/ https://git.bprieshof.nl/Work_Archive/VPS-scripts_AcmeSH/raw/branch/main/

View File

@@ -29,14 +29,15 @@ fi
##---------------## ##---------------##
#Git-repo #Git-repo
repo=https://git.ictmaatwerk.com/VPS-scripts/Web-V2 repo=https://git.bprieshof.nl/Work_Archive/VPS-scripts_Web-V2
branch=master branch=main
branchtype=branch #=branch for branch and =tag for release branchtype=branch #=branch for branch and =tag for release
CompatVer=2 CompatVer=2
#Installer-config #Installer-config
phpver=7.4 phpver=8.1
PHPMyadmin=1 #Overwriten by cms's without php PHPMyadmin=1 #Overwriten by cms's without php
sqlver=8.0 sqlver=8.0
SiteCount=1
TestMode=0 TestMode=0
#PackageManager-config #PackageManager-config
@@ -64,6 +65,13 @@ 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
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then
PKGM="$APTMODE"
PKGUC="$PKGM update"
PKGUP="$PKGM upgrade -y"
PKGI="${PKGM} install -y --no-install-recommends"
PKGLIST="apt"
shortdist=deb11
elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then
PKGM="dnf" PKGM="dnf"
PKGUC="$PKGM check-update --refresh" PKGUC="$PKGM check-update --refresh"
@@ -85,11 +93,11 @@ unset dist_ver dist APTMODE
syscheckoff=0 syscheckoff=0
if [ $TestMode = 1 ]; then if [ $TestMode = 1 ]; then
domain=ict-dagbesteding.nl domain=domain.com
sitename=ict_DB_nl sitename=domain_DB_com
email=b.prieshof@ictmaatwerk.com email=user@provider.srv
password=MeiFerrieSekureTESTp@ssw0rd4213 password=MeiFerrieSekureTESTp@ssw0rd4213
hostname=vdh001.nxdi.nl hostname=srv1.servers.com
sslenable=0 sslenable=0
domainwww=0 domainwww=0
fi fi
@@ -208,7 +216,7 @@ done
# System-Check # # System-Check #
##----------------## ##----------------##
if [[ "$syscheckoff" -ne 1 ]] && [[ -d /etc/ICTM ]]; then msg " This system has already been installed by Web-V2" && exit; fi if [[ "$syscheckoff" -ne 1 ]] && [[ -d /etc/WebV2 ]]; then msg " This system has already been installed by Web-V2" && exit; fi
##Check for pkgs, not yet setup for Centos ##Check for pkgs, not yet setup for Centos
# if [[ "$syscheckoff" -ne 1 ]] && [[ ! -z $(dpkg -l | cut -d " " -f 3 | grep "^mysql-server") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "nginx") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "apache") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "php") ]] ; then msg " This system has installed packages, Web-V2 is designed for clean systems" && exit; fi # if [[ "$syscheckoff" -ne 1 ]] && [[ ! -z $(dpkg -l | cut -d " " -f 3 | grep "^mysql-server") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "nginx") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "apache") || ! -z $(dpkg -l | cut -d " " -f 3 | grep "php") ]] ; then msg " This system has installed packages, Web-V2 is designed for clean systems" && exit; fi
@@ -372,15 +380,15 @@ fi
# Storeing vars # # Storeing vars #
##-----------------## ##-----------------##
mkdir -p /etc/ICTM/sites mkdir -p /etc/WebV2/sites
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/WebV2/mainvar.list
for storeme in PKGM PKGI PKGUC PKGUP PKGLIST OUTPUT IMODE shortdist repo branch branchtype webserv email shortdist hostname CompatVer; do for storeme in PKGM PKGI PKGUC PKGUP PKGLIST OUTPUT IMODE shortdist repo branch branchtype webserv email shortdist hostname CompatVer; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/mainvar.list
done done
touch /etc/WebV2/sites/"$sitename"
touch /etc/ICTM/sites/"$sitename" echo "SiteCount=$SiteCount" > /etc/WebV2/sites.count
##----------## ##----------##
# Addons # # Addons #
@@ -432,7 +440,7 @@ done
option="${option%"${option##*[![:space:]]}"}" option="${option%"${option##*[![:space:]]}"}"
fi fi
#saving selected modules #saving selected modules
echo 'SelectedOptions=('$option')' > /etc/ICTM/selopts.list echo 'SelectedOptions=('$option')' > /etc/WebV2/selopts.list
#Cleaning options from menu #Cleaning options from menu
option="${option,,}" && option="${option// /}" && option="${option//:/ }" && option="${option//'"'}" option="${option,,}" && option="${option// /}" && option="${option//:/ }" && option="${option//'"'}"
@@ -443,7 +451,7 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re
fi fi
#saving enabled Allways on modules #saving enabled Allways on modules
echo 'EnabledAons=('$aonoption')' >> /etc/ICTM/selopts.list echo 'EnabledAons=('$aonoption')' >> /etc/WebV2/selopts.list
#Combining selected option with always-on options #Combining selected option with always-on options
option="$option""$aonoption" option="$option""$aonoption"
@@ -603,7 +611,7 @@ done
#Saving updated vars #Saving updated vars
for storeme in phpver sqlver PHPMyadmin; do for storeme in phpver sqlver PHPMyadmin; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list declare -p $storeme | cut -d ' ' -f 3- >> /etc/WebV2/mainvar.list
done done
##-------------## ##-------------##
@@ -671,6 +679,8 @@ if [ $sslenable = 1 ]; then
if test $certsatus -eq 0 if test $certsatus -eq 0
then then
site_ext="ssl" site_ext="ssl"
mkdir -p /etc/acmesh/inst/$domain
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --install-cert --ecc --domain $domain --cert-file /etc/acmesh/inst/$domain/cert.pem --key-file /etc/acmesh/inst/$domain/key.pem --ca-file /etc/acmesh/inst/$domain/ca.cer --fullchain-file /etc/acmesh/inst/$domain/fullchain.pem --reloadcmd 'systemctl reload $(cat /etc/WebV2/SslServices)'
else else
site_ext="nossl" site_ext="nossl"
rm -rf /etc/acmesh/certs/$domain* rm -rf /etc/acmesh/certs/$domain*
@@ -682,6 +692,8 @@ if [ $sslenable = 1 ]; then
if test $certsatusBackend -eq 0 if test $certsatusBackend -eq 0
then then
siteBackend_ext="ssl" siteBackend_ext="ssl"
mkdir -p /etc/acmesh/inst/$hostname
/opt/acmesh/acme.sh --config-home '/etc/acmesh/data' --install-cert --ecc --domain $hostname --cert-file /etc/acmesh/inst/$hostname/cert.pem --key-file /etc/acmesh/inst/$hostname/key.pem --ca-file /etc/acmesh/inst/$hostname/ca.cer --fullchain-file /etc/acmesh/inst/$hostname/fullchain.pem --reloadcmd 'systemctl reload $(cat /etc/WebV2/SslServices)'
else else
siteBackend_ext="nossl" siteBackend_ext="nossl"
rm -rf /etc/acmesh/certs/$hostname* rm -rf /etc/acmesh/certs/$hostname*
@@ -746,7 +758,14 @@ done
# Services # # Services #
##------------## ##------------##
systemctl reload sshd fail2ban #Set ssh service for distro
if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; then
SSHService=ssh
elif [ "$shortdist" = "el8" ]; then
SSHService=sshd
fi
systemctl reload $SSHService fail2ban
##-------## ##-------##