``apache.mod_pagespeed`` | ``apache.mod_pagespeed`` | ||||
------------------------ | ------------------------ | ||||
Installs and Enables the mod_pagespeed module. (Debian Only) | |||||
Installs and Enables the mod_pagespeed module. (Debian and RedHat Only) | |||||
``apache.mod_php5`` | ``apache.mod_php5`` | ||||
------------------- | ------------------- |
'mod_wsgi': 'libapache2-mod-wsgi', | 'mod_wsgi': 'libapache2-mod-wsgi', | ||||
'mod_php5': 'libapache2-mod-php5', | 'mod_php5': 'libapache2-mod-php5', | ||||
'mod_fcgid': 'libapache2-mod-fcgid', | 'mod_fcgid': 'libapache2-mod-fcgid', | ||||
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb', | |||||
'vhostdir': '/etc/apache2/sites-available', | 'vhostdir': '/etc/apache2/sites-available', | ||||
'confdir': '/etc/apache2/conf.d', | 'confdir': '/etc/apache2/conf.d', | ||||
'mod_wsgi': 'mod_wsgi', | 'mod_wsgi': 'mod_wsgi', | ||||
'mod_php5': 'php', | 'mod_php5': 'php', | ||||
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm', | |||||
'vhostdir': '/etc/httpd/vhosts.d', | 'vhostdir': '/etc/httpd/vhosts.d', | ||||
'confdir': '/etc/httpd/conf.d', | 'confdir': '/etc/httpd/conf.d', |
{% if grains['os_family']=="Debian" %} | |||||
{% from "apache/map.jinja" import apache with context %} | {% from "apache/map.jinja" import apache with context %} | ||||
include: | include: | ||||
pkg: | pkg: | ||||
- installed | - installed | ||||
- sources: | - sources: | ||||
- mod-pagespeed-stable: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb | |||||
- mod-pagespeed-stable: {{ apache.mod_pagespeed_source }} | |||||
{% if grains['os_family']=="Debian" %} | |||||
a2enmod pagespeed: | a2enmod pagespeed: | ||||
cmd.run: | cmd.run: | ||||
- unless: ls /etc/apache2/mods-enabled/pagespeed.load | - unless: ls /etc/apache2/mods-enabled/pagespeed.load | ||||
- pkg: libapache2-mod-pagespeed | - pkg: libapache2-mod-pagespeed | ||||
- watch_in: | - watch_in: | ||||
- service: apache | - service: apache | ||||
{% endif %} | |||||
{% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %} | {% for dir in ['/var/cache/mod_pagespeed', '/var/log/pagespeed'] %} | ||||
{{ dir }}: | {{ dir }}: | ||||
- group: {{ salt['pillar.get']('apache:group', 'www-data') }} | - group: {{ salt['pillar.get']('apache:group', 'www-data') }} | ||||
{% endfor %} | {% endfor %} | ||||
{% if grains['os_family']=="Debian" %} | |||||
# Here we hardcode a logrotate entry to take care of the logs | # Here we hardcode a logrotate entry to take care of the logs | ||||
/etc/logrorate.d/pagespeed: | /etc/logrorate.d/pagespeed: | ||||
file: | file: | ||||
fi; | fi; | ||||
endscript | endscript | ||||
} | } | ||||
{% endif %} | {% endif %} |