#!/bin/bash
mweb=$1
mweb1=${mweb%%.*}
mweb2=${mweb
/root/.acme.sh/acme.sh --issue -d $mweb --apache
mconf="\n\n
<VirtualHost *:443>\n
\tServerAdmin webmaster@a.com\n
\tRewriteEngine On\n
\tDocumentRoot "/var/www/html/$mweb1/public"\n
\tServerName $mweb:443\n
\t<Directory "/var/www/html/$mweb1">\n
\t\tOptions FollowSymLinks\n
\t\tAllowOverride All\n
\t\tOrder Allow,Deny\n
\t\tAllow from all\n
\t</Directory>\n
ErrorLog "logs/error_log.$mweb.log"\n
CustomLog "logs/access_log.$mweb.log" combined env=!IMAG\n
SSLCertificateFile /root/.acme.sh/$mweb/$mweb.cer\n
SSLCertificateKeyFile /root/.acme.sh/$mweb/$mweb.key\n
SSLCertificateChainFile /root/.acme.sh/$mweb/fullchain.cer\n
</VirtualHost>"
echo -e $mconf >> /etc/httpd/conf/${mweb2}_ssl.conf
./myssl.sh xxx.xxx.com