deb/apache-register-tips.bash
changeset 21 52f40bd9e114
parent 14 719ced1ac5c3
child 31 461eed8e7463
equal deleted inserted replaced
20:f1b38aa4fa52 21:52f40bd9e114
     9 mkdir -p /srv/www/$d
     9 mkdir -p /srv/www/$d
    10 chown user:user /srv/www/$d
    10 chown user:user /srv/www/$d
    11 
    11 
    12 cat <<EOF >/etc/apache2/sites-available/$d.conf
    12 cat <<EOF >/etc/apache2/sites-available/$d.conf
    13 <VirtualHost $d.defun.work:*>
    13 <VirtualHost $d.defun.work:*>
    14 	DocumentRoot /srv/www/$d
    14     DocumentRoot /srv/www/$d
       
    15     ServerName $d.defun.work
    15 
    16 
    16     <Directory "/srv/www/$d/">
    17     <Directory "/srv/www/$d/">
    17         Require all granted
    18         Require all granted
    18     </Directory>
    19     </Directory>
    19 </VirtualHost>
    20 </VirtualHost>
       
    21 
       
    22 <IfModule mod_ssl.c>
       
    23   <VirtualHost $d.defun.work:443>
       
    24 	DocumentRoot /srv/www/$d
       
    25     ServerName $d.defun.work
       
    26 
       
    27     <Directory "/srv/www/$d/">
       
    28         Require all granted
       
    29     </Directory>
       
    30 
       
    31     SSLCertificateFile /etc/letsencrypt/live/defun.work/fullchain.pem
       
    32     SSLCertificateKeyFile /etc/letsencrypt/live/defun.work/privkey.pem
       
    33     Include /etc/letsencrypt/options-ssl-apache.conf
       
    34   </VirtualHost>
       
    35 </IfModule>
    20 EOF
    36 EOF
    21 
    37 
    22 a2ensite $d
    38 a2ensite $d
    23 service apache2 restart
    39 service apache2 reload