#!/bin/bash alias_block='' #Create Server Alias Block if [ ! -z $serveralias ]; then for alias in $(echo $serveralias | tr ',' ' ') do alias_block=$alias_block"ServerAlias $alias " done fi cat < /etc/httpd/conf.d/$domain.conf AllowOverride None # Allow open access: Require all granted Options All MultiViews AllowOverride All Require all granted ServerName "$domain" $alias_block DocumentRoot "/home/$user/public_html" RewriteEngine on RewriteCond %{SERVER_NAME} =$domain RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] Listen 443 https SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog SSLSessionCache shmcb:/run/httpd/sslcache(512000) SSLSessionCacheTimeout 300 SSLCryptoDevice builtin ServerName "$domain" $alias_block DocumentRoot "/home/$user/public_html" SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /etc/pki/tls/private/localhost.key EOF