Updated apache module to use vars
This commit is contained in:
@@ -8,6 +8,7 @@ if [ ! -f "/etc/ICTM/phpvar.list" ] ; then echo 'Php var list missing,Please run
|
|||||||
source /etc/ICTM/selopts.list
|
source /etc/ICTM/selopts.list
|
||||||
source /etc/ICTM/mainvar.list
|
source /etc/ICTM/mainvar.list
|
||||||
source /etc/ICTM/phpvar.list
|
source /etc/ICTM/phpvar.list
|
||||||
|
if [ ! -f "/etc/ICTM/apachevar.list" ] ; then source /etc/ICTM/apachevar.list; 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)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -o /tmp/apache-siteconf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -o /tmp/apache-siteconf
|
||||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$hostname'/g' /tmp/apache-siteconf
|
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$hostname'/g' /tmp/apache-siteconf
|
||||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/Backend_"$siteBackend_ext".conf
|
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' "$apacheConfDir"/sites-available/Backend_"$siteBackend_ext".conf
|
||||||
systemctl reload apache2
|
systemctl reload $apacheService
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
#Apache
|
#Apache
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Apache-unconfigured -o /tmp/apache-siteconf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Apache-unconfigured -o /tmp/apache-siteconf
|
||||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' "$apacheConfDir"/sites-available/"$sitename"_"$site_ext".conf
|
||||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||||
|
|
||||||
#PHP
|
#PHP
|
||||||
sed -i -e '/cgi.fix_pathinfo/c\php_admin_value[cgi.fix_pathinfo] = 1' "$phpPoolDir"/$sitename.conf
|
sed -i -e '/cgi.fix_pathinfo/c\php_admin_value[cgi.fix_pathinfo] = 1' "$phpPoolDir"/$sitename.conf
|
||||||
sed -i -e '/security.limit_extensions/c\php_admin_value[security.limit_extensions] = .php' "$phpPoolDir"/$sitename.conf
|
sed -i -e '/security.limit_extensions/c\php_admin_value[security.limit_extensions] = .php' "$phpPoolDir"/$sitename.conf
|
||||||
|
|
||||||
systemctl reload apache2 php$phpver-fpm
|
systemctl reload $apacheService $phpFPMService
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Apache-unconfigured -o /tmp/apache-siteconf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Apache-unconfigured -o /tmp/apache-siteconf
|
||||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' "$apacheConfDir"/sites-available/"$sitename"_"$site_ext".conf
|
||||||
|
|
||||||
systemctl reload apache2
|
systemctl reload $apacheService
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Apache-unconfigured -o /tmp/apache-siteconf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Apache-unconfigured -o /tmp/apache-siteconf
|
||||||
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/apache-siteconf
|
||||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf
|
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' "$apacheConfDir"/sites-available/"$sitename"_"$site_ext".conf
|
||||||
|
|
||||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||||
systemctl reload apache2 php$phpver-fpm
|
systemctl reload $apacheService $phpFPMService
|
||||||
@@ -43,6 +43,9 @@ systemctl reload $phpFPMService
|
|||||||
#fail2ban
|
#fail2ban
|
||||||
if [ ! -f /etc/fail2ban/jail.d/wordpress-syslog.local ]; then
|
if [ ! -f /etc/fail2ban/jail.d/wordpress-syslog.local ]; then
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -o /etc/fail2ban/jail.d/wordpress-syslog.local
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -o /etc/fail2ban/jail.d/wordpress-syslog.local
|
||||||
|
if [ "$shortdist" = "el8" ]; then
|
||||||
|
sed -i '/logpath/c\logpath = /var/log/secure' /etc/fail2ban/jail.d/wordpress-syslog.local
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Setting Permsissions
|
#Setting Permsissions
|
||||||
|
|||||||
@@ -4,19 +4,19 @@
|
|||||||
|
|
||||||
if [ $domainwww = 1 ]; then
|
if [ $domainwww = 1 ]; then
|
||||||
#non-ssl
|
#non-ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
echo "" >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
#ssl
|
#ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
echo "" >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#non-ssl
|
#non-ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
sed -i -e 's/DOMAINname/'$domain'/g' "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
ln -s "$apacheConfDir"/sites-available/"$sitename"_nossl.conf "$apacheConfDir"/sites-enabled/010-"$sitename".conf
|
||||||
#ssl
|
#ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
sed -i -e 's/DOMAINname/'$domain'/g' "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
|
|
||||||
systemctl reload apache2
|
systemctl reload $apacheService
|
||||||
@@ -1,55 +1,68 @@
|
|||||||
systemctl stop apache2 > $OUTPUT 2>&1
|
systemctl stop $apacheService > $OUTPUT 2>&1
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Apache #
|
# Apache #
|
||||||
##############
|
##############
|
||||||
|
|
||||||
|
#Centos
|
||||||
|
if [ "$shortdist" = "el8" ]; then
|
||||||
|
echo 'IncludeOptional conf-enabled/*.conf'/etc/httpd/conf/httpd.conf
|
||||||
|
echo 'IncludeOptional sites-enabled/*.conf'/etc/httpd/conf/httpd.conf
|
||||||
|
sed -i -e '/User apache/c\User www-data' -e '/Group apache/c\Group www-data' /etc/httpd/conf/httpd.conf
|
||||||
|
sed -i 's/^/#/g' /etc/httpd/conf.d/welcome.conf
|
||||||
|
#Creating directories
|
||||||
|
mkdir -p /etc/httpd/{sites-available,sites-enabled,conf-enabled,conf-available,}
|
||||||
|
fi
|
||||||
|
|
||||||
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 ssl headers http2 setenvif socache_shmcb > $OUTPUT 2>&1
|
a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb > $OUTPUT 2>&1
|
||||||
|
|
||||||
mkdir -p /etc/apache2/snippets/
|
mkdir -p "$apacheConfDir"/snippets/
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -o /etc/apache2/snippets/apa-ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -o "$apacheConfDir"/snippets/apa-ssl.conf
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-backendredir.conf -o /etc/apache2/snippets/apa-backendredir.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-backendredir.conf -o "$apacheConfDir"/snippets/apa-backendredir.conf
|
||||||
sed -i -e 's/HOSTname/'$hostname'/' /etc/apache2/snippets/apa-backendredir.conf
|
sed -i -e 's/HOSTname/'$hostname'/' "$apacheConfDir"/snippets/apa-backendredir.conf
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -o /etc/apache2/conf-enabled/zzz-custom.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -o "$apacheConfDir"/conf-enabled/zzz-custom.conf
|
||||||
|
|
||||||
#Catch all (ip and unconfigured domains)
|
#Catch all (ip and unconfigured domains)
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -o /etc/apache2/sites-available/CatchAll.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -o "$apacheConfDir"/sites-available/CatchAll.conf
|
||||||
ln -s /etc/apache2/sites-available/CatchAll.conf /etc/apache2/sites-enabled/999-CatchAll.conf
|
ln -s "$apacheConfDir"/sites-available/CatchAll.conf "$apacheConfDir"/sites-enabled/999-CatchAll.conf
|
||||||
|
|
||||||
|
|
||||||
if [ $domainwww = 1 ]; then
|
if [ $domainwww = 1 ]; then
|
||||||
#non-ssl
|
#non-ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
echo "" >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
#ssl
|
#ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
echo "" >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
fi
|
fi
|
||||||
#non-ssl
|
#non-ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
sed -i -e 's/DOMAINname/'$domain'/g' "$apacheConfDir"/sites-available/"$sitename"_nossl.conf
|
||||||
ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
ln -s "$apacheConfDir"/sites-available/"$sitename"_nossl.conf "$apacheConfDir"/sites-enabled/010-"$sitename".conf
|
||||||
#ssl
|
#ssl
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
sed -i -e 's/DOMAINname/'$domain'/g' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
sed -i -e 's/DOMAINname/'$domain'/g' "$apacheConfDir"/sites-available/"$sitename"_ssl.conf
|
||||||
|
|
||||||
#non-ssl-Backend
|
#non-ssl-Backend
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/Backend_nossl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> "$apacheConfDir"/sites-available/Backend_nossl.conf
|
||||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/apache2/sites-available/Backend_nossl.conf
|
sed -i -e 's/DOMAINname/'$hostname'/g' "$apacheConfDir"/sites-available/Backend_nossl.conf
|
||||||
ln -s /etc/apache2/sites-available/Backend_nossl.conf /etc/apache2/sites-enabled/010-Backend.conf
|
ln -s "$apacheConfDir"/sites-available/Backend_nossl.conf "$apacheConfDir"/sites-enabled/010-Backend.conf
|
||||||
#ssl-Backend
|
#ssl-Backend
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/Backend_ssl.conf
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> "$apacheConfDir"/sites-available/Backend_ssl.conf
|
||||||
sed -i -e 's/DOMAINname/'$hostname'/g' /etc/apache2/sites-available/Backend_ssl.conf
|
sed -i -e 's/DOMAINname/'$hostname'/g' "$apacheConfDir"/sites-available/Backend_ssl.conf
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /opt/toggle
|
mkdir -p /opt/toggle
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -o /opt/toggle/toggle-PhpMyAdmin.sh
|
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -o /opt/toggle/toggle-PhpMyAdmin.sh
|
||||||
|
sed -i -e 's/APASRV/'$apacheService'/' -e 's/APADIR/'$apacheConfDir'/' /opt/toggle/toggle-PhpMyAdmin.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
systemctl start apache2 > $OUTPUT 2>&1
|
systemctl start $apacheService > $OUTPUT 2>&1
|
||||||
systemctl enable apache2 > $OUTPUT 2>&1
|
systemctl enable $apacheService > $OUTPUT 2>&1
|
||||||
1
CoreModules/apache/dnf.pkg.list
Normal file
1
CoreModules/apache/dnf.pkg.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
httpd mod_fcgid
|
||||||
@@ -1 +1,17 @@
|
|||||||
|
if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then
|
||||||
|
# Debian/Ubunbtu apache variables
|
||||||
|
apacheConfDir=/etc/apache2
|
||||||
|
apacheService=apche2
|
||||||
|
|
||||||
|
elif [ "$shortdist" = "el8" ]; then
|
||||||
|
# Centos Php variable
|
||||||
|
apacheConfDir=/etc/httpd
|
||||||
|
apacheService=httpd
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Storing vars to config
|
||||||
|
for storeme in apacheService apacheConfDir; do
|
||||||
|
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/apachevar.list
|
||||||
|
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.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=apache osrel=$shortdist bash > $OUTPUT 2>&1 > $OUTPUT 2>&1
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
rm /etc/apache2/sites-enabled/010-"$sitename".conf
|
rm "$apacheConfDir"/sites-enabled/010-"$sitename".conf
|
||||||
ln -s /etc/apache2/sites-available/"$sitename"_"$site_ext".conf /etc/apache2/sites-enabled/010-"$sitename".conf
|
ln -s "$apacheConfDir"/sites-available/"$sitename"_"$site_ext".conf "$apacheConfDir"/sites-enabled/010-"$sitename".conf
|
||||||
|
|
||||||
if [ -n "$sslfr" ]; then
|
if [ -n "$sslfr" ]; then
|
||||||
rm /etc/apache2/sites-enabled/010-Backend.conf
|
rm "$apacheConfDir"/sites-enabled/010-Backend.conf
|
||||||
ln -s /etc/apache2/sites-available/Backend_"$siteBackend_ext".conf /etc/apache2/sites-enabled/010-Backend.conf
|
ln -s "$apacheConfDir"/sites-available/Backend_"$siteBackend_ext".conf "$apacheConfDir"/sites-enabled/010-Backend.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl reload apache2
|
systemctl reload $apacheService
|
||||||
|
|||||||
@@ -42,11 +42,6 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fai
|
|||||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -o /etc/fail2ban/filter.d/wordpress-hard.local
|
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -o /etc/fail2ban/filter.d/wordpress-hard.local
|
||||||
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -o /etc/fail2ban/filter.d/wordpress-soft.local
|
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -o /etc/fail2ban/filter.d/wordpress-soft.local
|
||||||
|
|
||||||
if [ "$shortdist" = "el8" ]; then
|
|
||||||
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/action.d/ufw.conf -o /etc/fail2ban/action.d/ufw.conf
|
|
||||||
ln -s /var/log/secure /var/log/auth.log
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Start fail2ban service
|
#Start fail2ban service
|
||||||
systemctl start fail2ban
|
systemctl start fail2ban
|
||||||
systemctl enable fail2ban
|
systemctl enable fail2ban
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ webserv=WebServer
|
|||||||
webservice=WebServer
|
webservice=WebServer
|
||||||
|
|
||||||
#Correcting service name for Apache
|
#Correcting service name for Apache
|
||||||
if [ $webservice = apache ]; then
|
if [ $webservice = apache ]; then\
|
||||||
webservice=apache2
|
source /etc/ICTM/apachevar.list
|
||||||
|
webservice="$apacheService"
|
||||||
ext=.conf
|
ext=.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ if [ -n "$1" ]; then
|
|||||||
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/ICTM/toggle.conf
|
||||||
sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;cdeny from all' /etc/apache2/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 apache2
|
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/ICTM/toggle.conf
|
||||||
sed -i --follow-symlinks '/#enables\/disables PHPMyadmin/!b;n;c#deny from all' /etc/apache2/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 apache2
|
systemctl reload APASRV
|
||||||
elif [[ "$1" = "-h" ]]; then
|
elif [[ "$1" = "-h" ]]; then
|
||||||
usage
|
usage
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user