added initial apache configuration/setup
This commit is contained in:
29
CoreModules/apache/conf.sh
Normal file
29
CoreModules/apache/conf.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
systemctl stop apache2
|
||||
|
||||
##############
|
||||
# Apache #
|
||||
##############
|
||||
|
||||
a2enmod actions fcgid alias proxy_fcgi ssl headers
|
||||
|
||||
mkdir -p /etc/apache2/snippets/
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/snippets-ssl.conf -O /etc/apache2/snippets/apa-ssl.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/custom.conf -O /etc/apache2/conf-enabled/custom.conf
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
fi
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_nossl.conf
|
||||
ln -s /etc/apache2/sites-available/"$sitename"_nossl /etc/apache2/sites-enabled/"$sitename".conf
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_ssl.conf
|
||||
|
||||
systemctl start apache2
|
||||
Reference in New Issue
Block a user