added initial apache configuration/setup

This commit is contained in:
2020-08-20 15:28:07 +02:00
parent c532f01a8d
commit d7e7ecf841
12 changed files with 110 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
#beginConf
ErrorLog ${APACHE_LOG_DIR}/s2_error.log
#CustomLog ${APACHE_LOG_DIR}/s2_custom.log combined
DirectoryIndex index.php index.html index.htm
DocumentRoot /var/www/DOMAINname/html;
<Directory /var/www/site1.your_domain>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/phpPHPver-fpm-SITEname.sock|fcgi://localhost"
</FilesMatch>
#endConf

9
CMS/none/apache-conf.sh Normal file
View File

@@ -0,0 +1,9 @@
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Apache-unconfigured -O /tmp/apache-siteconf
sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/apache/sites-available/"$sitename"_"$site_ext".conf
mkdir -p /var/www/"$domain"/html
echo "<html><head></head><body>$webserv has been succsefully installed by the Wizard</body></html>" > /var/www/$domain/html/index.html
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
systemctl reload nginx

View File

@@ -1 +1 @@
apache2 php-pear libapache2-mod-php phpPHPver-mysql phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-xmlrpc phpPHPver-zip python-certbot-apache apache2 libapache2-mod-fcgid python-certbot-apache

View 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

View File

@@ -0,0 +1 @@
SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"

View File

@@ -0,0 +1,6 @@
<VirtualHost *:80>
ServerName DOMAINname
#ConfHere
</VirtualHost>

View File

@@ -0,0 +1,4 @@
<VirtualHost *:80>
ServerName www.DOMAINname
Redirect permanent / http://DOMAINname/
</VirtualHost>

View File

@@ -0,0 +1,16 @@
<VirtualHost *:80>
ServerName DOMAINname
Redirect permanent / https://DOMAINname/
</VirtualHost>
<VirtualHost *:443>
ServerName DOMAINname
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/DOMAINname/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/DOMAINname/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/DOMAINname/chain.pem
Include snippets/apa-ssl.conf
#ConfHere
</VirtualHost>

View File

@@ -0,0 +1,14 @@
<VirtualHost *:80>
ServerName www.DOMAINname
Redirect permanent / https://DOMAINname/
</VirtualHost>
<VirtualHost *:443>
ServerName www.DOMAINname
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/DOMAINname/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/DOMAINname/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/DOMAINname/chain.pem
Include snippets/apa-ssl.conf
Redirect permanent / https://DOMAINname/
</VirtualHost>

View File

@@ -0,0 +1,7 @@
Protocols h2 http/1.1
Header always set Strict-Transport-Security "max-age=63072000"
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA2$
SSLHonorCipherOrder off
SSLSessionTickets off
SSLUseStapling On

View File

@@ -0,0 +1 @@
sudo add-apt-repository ppa:ondrej/apache2

View File

@@ -0,0 +1 @@
aonoption="$aonoption php-fpm"