Skip to content
Snippets Groups Projects
Commit f7b5fc94 authored by jurgenhaas's avatar jurgenhaas
Browse files

Bug fixes and allow http auth

parent 18e5bc61
Branches
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@
- name: "Drupal | Apache configuration file for our site(s)"
template:
src=etc_apache2_sites_available_vhost
dest=/etc/apache2/sites-available/{{ item.apache_site }}
dest=/etc/apache2/sites-available/{{ item.apache_site }}{{ apache_conf_ext }}
owner=root
group=root
mode=0664
......@@ -90,8 +90,19 @@
- "Apache | Restart Apache"
- name: "Drupal | Apache enable our new site(s)"
command: a2ensite {{ item.apache_site }} creates=/etc/apache2/sites-enabled/{{ item.apache_site }}
command: a2ensite {{ item.apache_site }} creates=/etc/apache2/sites-enabled/{{ item.apache_site }}{{ apache_conf_ext }}
with_items: drupal_settings
when: item.apache_site
notify:
- "Apache | Restart Apache"
- name: "Drupal | Setup AuthType Basic"
htpasswd:
path="/var/www/passwords/{{ item.apache_auth.user }}"
name="{{ item.apache_auth.user }}"
password="{{ item.apache_auth.password }}"
owner=www-data
group=www-data
mode=640
with_items: drupal_settings
when: item.apache_auth is defined
<VirtualHost *:80>
ServerAdmin {{ apache_server_admin }}
ServerName {{ item.domains.0.domain }}
ServerAlias{% for domain in item.domains %} {{ domain.domain }}{% for alias in domain.aliases %} {{ alias }}{% endfor %}{% endfor %}
ServerAdmin {{ apache_server_admin }}
ServerName {{ item.domains.0.domain }}
ServerAlias{% for domain in item.domains %} {{ domain.domain }}{% for alias in domain.aliases %} {{ alias }}{% endfor %}{% endfor %}
DocumentRoot /var/www/{{ item.root }}
DocumentRoot /var/www/{{ item.root }}
<Directory /var/www/{{ item.root }}/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/{{ item.root }}/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
{% if item.apache_auth is defined %}
AuthType {{ item.apache_auth.type }}
AuthName "{{ item.apache_auth.name }}"
AuthUserFile /var/www/passwords/{{ item.apache_auth.user }}
Require user {{ item.apache_auth.user }}
{% else %}
Order allow,deny
allow from all
{% endif %}
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog ${APACHE_LOG_DIR}/access.log combined env=!forwarded
CustomLog ${APACHE_LOG_DIR}/access.log proxy env=forwarded
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog ${APACHE_LOG_DIR}/access.log combined env=!forwarded
CustomLog ${APACHE_LOG_DIR}/access.log proxy env=forwarded
</VirtualHost>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment