- name: libapache2-mod-fcgid | - name: libapache2-mod-fcgid | ||||
- order: 180 | - order: 180 | ||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
a2enmod fcgid: | a2enmod fcgid: | ||||
cmd.run: | cmd.run: | ||||
- require: | - require: | ||||
- pkg: mod-fcgid | - pkg: mod-fcgid | ||||
- watch_in: | - watch_in: | ||||
- cmd: apache2-restart | |||||
- cmd: apache-restart | |||||
{% endif %} | {% endif %} |
include: | include: | ||||
- apt | - apt | ||||
- apache2.register_site | |||||
- apache.register_site | |||||
{% if grains['os']=="Ubuntu" %} | {% if grains['os']=="Ubuntu" %} | ||||
apache2: | |||||
apache: | |||||
pkg.installed: | pkg.installed: | ||||
- name: apache2 | - name: apache2 | ||||
- order: 175 | - order: 175 | ||||
- order: 225 | - order: 225 | ||||
- onlyif: ls /etc/apache2/sites-enabled/000-default | - onlyif: ls /etc/apache2/sites-enabled/000-default | ||||
- watch_in: | - watch_in: | ||||
- cmd: apache2-reload | |||||
- cmd: apache-reload | |||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
apache2-reload: | |||||
apache-reload: | |||||
cmd.wait: | cmd.wait: | ||||
- name: service apache2 reload | - name: service apache2 reload | ||||
- order: 420 | - order: 420 | ||||
apache2-restart: | |||||
apache-restart: | |||||
cmd.wait: | cmd.wait: | ||||
- name: service apache2 restart | - name: service apache2 restart | ||||
- order: 425 | - order: 425 | ||||
file.absent: | file.absent: | ||||
- order: 230 | - order: 230 | ||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
/etc/apache2/sites-available/default-ssl: | /etc/apache2/sites-available/default-ssl: | ||||
file.absent: | file.absent: | ||||
- order: 230 | - order: 230 | ||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
{% endif %} #END: os = ubuntu | {% endif %} #END: os = ubuntu |
- name: libapache2-mod-php5 | - name: libapache2-mod-php5 | ||||
- order: 180 | - order: 180 | ||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
a2enmod php5: | a2enmod php5: | ||||
cmd.run: | cmd.run: | ||||
- require: | - require: | ||||
- pkg: mod-php5 | - pkg: mod-php5 | ||||
- watch_in: | - watch_in: | ||||
- cmd: apache2-restart | |||||
- cmd: apache-restart | |||||
{% if 'apache2-php-ini' in pillar %} | {% if 'apache2-php-ini' in pillar %} | ||||
/etc/php5/apache2/php.ini: | /etc/php5/apache2/php.ini: | ||||
- source: {{ pillar['apache2-php-ini'] }} | - source: {{ pillar['apache2-php-ini'] }} | ||||
- order: 225 | - order: 225 | ||||
- watch_in: | - watch_in: | ||||
- cmd: apache2-restart | |||||
- cmd: apache-restart | |||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
- pkg: php5 | - pkg: php5 | ||||
{% endif %} | {% endif %} | ||||
{% endif %} | {% endif %} | ||||
- order: 230 | - order: 230 | ||||
- require: | - require: | ||||
- pkg: apache2 | |||||
- pkg: apache | |||||
- file: /etc/apache2/sites-available/{{ pillar['apache2-register-site'][site]['name'] }} | - file: /etc/apache2/sites-available/{{ pillar['apache2-register-site'][site]['name'] }} | ||||
{% endif %} | {% endif %} | ||||
- mode: 775 | - mode: 775 | ||||
- watch_in: | - watch_in: | ||||
- cmd: a2ensite {{ pillar['apache2-register-site'][site]['name'] }} | - cmd: a2ensite {{ pillar['apache2-register-site'][site]['name'] }} | ||||
- cmd: apache2-reload | |||||
- cmd: apache-reload | |||||
{% endif %} | {% endif %} | ||||
########################################## | ########################################## |
cmd.run: | cmd.run: | ||||
- unless: ls /etc/apache2/mods-enabled/rewrite.load | - unless: ls /etc/apache2/mods-enabled/rewrite.load | ||||
- watch_in: | - watch_in: | ||||
- cmd: apache2-restart | |||||
- cmd: apache-restart | |||||
{% endif %} | {% endif %} |