| @@ -1,16 +1,18 @@ | |||||
| - name: install required binary packages | |||||
| - name: Install required binary packages | |||||
| apt: name={{item}} state=installed | apt: name={{item}} state=installed | ||||
| with_items: | with_items: | ||||
| - apache2 | - apache2 | ||||
| - libapache2-mod-php5 | - libapache2-mod-php5 | ||||
| notify: restart apache | notify: restart apache | ||||
| - name: Create Apache vhost configuration for Webmail | |||||
| template: src=webmail.conf.j2 dest=/etc/apache2/sites-available/webmail.conf | |||||
| - name: Create Apache vhost configuration for HTTPS (RoundCube and PHPmyadmin) | |||||
| template: src=webmail.conf-443.j2 dest=/etc/apache2/sites-available/default-ssl.conf | |||||
| notify: restart apache | notify: restart apache | ||||
| - name: Enable Apache vhost | |||||
| command: /usr/sbin/a2ensite webmail.conf creates=/etc/apache2/sites-enabled/webmail.conf | |||||
| - name: Enable Apache vhost for HTTPS | |||||
| command: /usr/sbin/a2ensite default-ssl creates=/etc/apache2/sites-enabled/default-ssl.conf | |||||
| notify: restart apache | notify: restart apache | ||||
| - name: Enabling Apache SSL module | |||||
| - name: Create Apache vhost configuration for HTTP (redirect to HTTPS) | |||||
| template: src=webmail.conf-80.j2 dest=/etc/apache2/sites-available/000-default.conf | |||||
| notify: restart apache | |||||
| - name: Enable Apache SSL module | |||||
| command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf | command: /usr/sbin/a2enmod ssl creates=/etc/apache2/mods-enabled/ssl.conf | ||||
| notify: restart apache | notify: restart apache | ||||
| @@ -1,11 +1,10 @@ | |||||
| <IfModule mod_ssl.c> | <IfModule mod_ssl.c> | ||||
| <VirtualHost _default_:443> | <VirtualHost _default_:443> | ||||
| ServerAdmin webmaster@localhost | |||||
| ServerAdmin {{ ispmail_postmaster_address }} | |||||
| ServerName {{ ispmail_webmail_hostname }} | ServerName {{ ispmail_webmail_hostname }} | ||||
| #DocumentRoot /var/www/html | |||||
| Include /etc/roundcube/apache.conf | Include /etc/roundcube/apache.conf | ||||
| Alias /roundcube /var/lib/roundcube | |||||
| Alias / /var/lib/roundcube/ | |||||
| # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | ||||
| # error, crit, alert, emerg. | # error, crit, alert, emerg. | ||||
| @@ -0,0 +1,6 @@ | |||||
| <VirtualHost *:80> | |||||
| ServerAdmin {{ ispmail_postmaster_address }} | |||||
| ServerName {{ ispmail_webmail_hostname }} | |||||
| Redirect permanent / https://{{ ispmail_webmail_hostname}}/ | |||||
| </VirtualHost> | |||||