├── .gitignore ├── wordpress ├── cli-allow-root.sls ├── cli.sls ├── map.jinja ├── config.sls ├── plugin.sls ├── init.sls └── files │ ├── wp-config.php │ └── htaccess ├── test ├── shared │ └── spec_helper.rb └── integration │ ├── cli │ └── serverspec │ │ └── wp_cli_spec.rb │ └── high │ └── serverspec │ └── wp_config_spec.rb ├── Gemfile ├── LICENSE ├── Rakefile ├── pillar.example ├── .travis.yml ├── README.rst └── .kitchen.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .kitchen/ 2 | .kitchen.local.yml 3 | -------------------------------------------------------------------------------- /wordpress/cli-allow-root.sls: -------------------------------------------------------------------------------- 1 | {% if salt['pillar.get']('wordpress:cli:allowroot') == True %} 2 | {% set allowroot = "--allow-root" %} 3 | {% else %} 4 | {% set allowroot = "" %} 5 | {% endif %} 6 | -------------------------------------------------------------------------------- /test/shared/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "serverspec" 2 | require "pathname" 3 | 4 | # Set backend type 5 | set :backend, :exec 6 | 7 | RSpec.configure do |c| 8 | c.path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 9 | end 10 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'codeclimate-test-reporter', group: :test, require: nil 4 | gem 'rake' 5 | gem 'berkshelf', '~> 4.0' 6 | 7 | group :integration do 8 | gem 'test-kitchen' 9 | gem 'kitchen-salt' 10 | gem 'kitchen-inspec' 11 | end 12 | 13 | group :docker do 14 | gem 'kitchen-docker' 15 | end 16 | 17 | # vi: set ft=ruby : 18 | gem "kitchen-vagrant" -------------------------------------------------------------------------------- /wordpress/cli.sls: -------------------------------------------------------------------------------- 1 | {% from "wordpress/map.jinja" import map with context %} 2 | 3 | # This downloads and installs WP-Cli 4 | /usr/local/bin/wp: 5 | file.managed: 6 | - source: {{ salt['pillar.get']('wordpress:cli:source') }} 7 | - source_hash: {{ salt['pillar.get']('wordpress:cli:hash') }} 8 | - user: {{ map.www_user }} 9 | - group: {{ map.www_group }} 10 | - mode: 740 11 | -------------------------------------------------------------------------------- /test/integration/cli/serverspec/wp_cli_spec.rb: -------------------------------------------------------------------------------- 1 | require "serverspec" 2 | 3 | # Set backend type 4 | set :backend, :exec 5 | 6 | describe 'wordpress cli tool' do 7 | 8 | wp_cli = '/usr/local/bin/wp' 9 | 10 | describe file(wp_cli) do 11 | it { should exist } 12 | it { should be_mode 740 } 13 | it { should be_owned_by 'www-data' } 14 | it { should be_grouped_into 'www-data' } 15 | end 16 | end -------------------------------------------------------------------------------- /test/integration/high/serverspec/wp_config_spec.rb: -------------------------------------------------------------------------------- 1 | require "serverspec" 2 | 3 | # Set backend type 4 | set :backend, :exec 5 | 6 | describe 'wordpress configuration' do 7 | 8 | configs = ['/www/html/sitenameA.com/wp-config.php', '/www/html/sitenameB.com/wp-config.php'] 9 | 10 | configs.each do |config| 11 | describe file(config) do 12 | it { should exist } 13 | it { should be_file } 14 | it { should be_mode 644 } 15 | it { should be_owned_by 'www-data' } 16 | it { should be_grouped_into 'www-data' } 17 | it { should contain "dbuser" } 18 | end 19 | end 20 | end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Nitin Madhok 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /wordpress/map.jinja: -------------------------------------------------------------------------------- 1 | {% set map = salt['grains.filter_by']({ 2 | 'default': { 3 | 'docroot': '/www/html', 4 | 'www_group': 'www-data', 5 | 'www_user': 'www-data', 6 | }, 7 | 'Debian': { 8 | 'docroot': '/www/html', 9 | 'www_group': 'www-data', 10 | 'www_user': 'www-data', 11 | }, 12 | 'RedHat': { 13 | 'docroot': '/var/www/html', 14 | 'www_group': 'apache', 15 | 'www_user': 'apache', 16 | }, 17 | 'Suse': { 18 | 'docroot': '/srv/www/htdocs', 19 | 'www_group': 'www', 20 | 'www_user': 'wwwrun', 21 | }, 22 | }, merge=salt['pillar.get']('wordpress:lookup')) %} 23 | -------------------------------------------------------------------------------- /wordpress/config.sls: -------------------------------------------------------------------------------- 1 | {% from "wordpress/map.jinja" import map with context %} 2 | {% from "wordpress/cli-allow-root.sls" import allowroot with context %} 3 | {% for name, site in pillar['wordpress']['sites'].items() %} 4 | 5 | {% if 'dbhost' in site %} 6 | {% set dbhost = site.dbhost %} 7 | {% else %} 8 | {% set dbhost = 'localhost' %} 9 | {% endif %} 10 | 11 | # This command tells wp-cli to create our wp-config.php, DB info needs to be the same as above 12 | configure-{{ name }}: 13 | cmd.run: 14 | - name: '/usr/local/bin/wp core config {{ allowroot }} --dbhost={{ dbhost }} --dbname={{ site.database }} --dbuser={{ site.dbuser }} --dbpass={{ site.dbpass }}' 15 | - cwd: {{ map.docroot }}/{{ name }} 16 | - runas: {{ map.www_user }} 17 | - unless: test -f {{ map.docroot }}/{{ name }}/wp-config.php 18 | 19 | {% endfor %} 20 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rake/testtask' 3 | require 'bundler/setup' 4 | 5 | Rake::TestTask.new do |t| 6 | t.libs << 'lib' 7 | t.pattern = 'test/**/*_test.rb' 8 | t.verbose = false 9 | end 10 | 11 | desc 'Run Test Kitchen integration tests' 12 | namespace :integration do 13 | desc 'Run integration tests with kitchen-docker' 14 | task :docker do 15 | require 'kitchen' 16 | Kitchen.logger = Kitchen.default_file_logger 17 | @loader = Kitchen::Loader::YAML.new(local_config: '.kitchen.docker.yml') 18 | Kitchen::Config.new(loader: @loader).instances.each do |instance| 19 | instance.test(:always) 20 | end 21 | end 22 | end 23 | 24 | task default: :test 25 | 26 | begin 27 | require 'kitchen/rake_tasks' 28 | Kitchen::RakeTasks.new 29 | rescue LoadError 30 | puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] 31 | end -------------------------------------------------------------------------------- /pillar.example: -------------------------------------------------------------------------------- 1 | wordpress: 2 | cli: 3 | source: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 4 | hash: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar.sha512 5 | allowroot: False 6 | sites: 7 | sitenameA.com: 8 | username: siteAuser 9 | password: siteApass 10 | database: siteAdb 11 | dbhost: localhost 12 | dbuser: siteAdbuser 13 | dbpass: siteAdbpass 14 | url: http://siteA.com 15 | title: 'siteA title' 16 | email: siteA@email.com 17 | sitenameB.com: 18 | username: siteBuser 19 | password: siteBpass 20 | database: siteBdb 21 | dbhost: localhost 22 | dbuser: siteBdbuser 23 | dbpass: siteBdbpass 24 | url: http://siteB.com 25 | title: 'siteB title' 26 | email: siteB@email.com 27 | plugins: 28 | - '' 29 | plugins_url: 30 | '': 31 | url: '' 32 | name: '' 33 | lookup: 34 | docroot: /var/html -------------------------------------------------------------------------------- /wordpress/plugin.sls: -------------------------------------------------------------------------------- 1 | {% from "wordpress/map.jinja" import map with context %} 2 | {% from "wordpress/cli-allow-root.sls" import allowroot with context %} 3 | {% for name, site in pillar['wordpress']['sites'].items() %} 4 | {% if 'plugins' in pillar['wordpress']['sites'][name] %} 5 | {% for plugin_name in pillar['wordpress']['sites'][name]['plugins'] %} 6 | 7 | configure_plugin_{{ plugin_name }}: 8 | cmd.run: 9 | - name: '/usr/local/bin/wp plugin install {{ allowroot }} --activate {{ plugin_name }}' 10 | - cwd: {{ map.docroot }}/{{ name }} 11 | #- user: {{ map.www_user }} 12 | - runas: {{ map.www_user }} 13 | - unless: '/usr/local/bin/wp plugin is-installed {{ allowroot }} {{ plugin_name }}' 14 | {% endfor %} 15 | {% endif %} 16 | 17 | {% if 'plugins_url' in pillar['wordpress']['sites'][name] %} 18 | {% for plugin_name, info in pillar['wordpress']['sites'][name]['plugins_url'].items() %} 19 | 20 | configure_plugin_{{ info.name }}: 21 | cmd.run: 22 | - name: '/usr/local/bin/wp plugin install {{ allowroot }} --activate {{ info.url }}' 23 | - cwd: {{ map.docroot }}/{{ name }} 24 | #- user: {{ map.www_user }} 25 | - runas: {{ map.www_user }} 26 | - unless: '/usr/local/bin/wp plugin is-installed {{ allowroot }} {{ info.name }}' 27 | {% endfor %} 28 | {% endif %} 29 | {% endfor %} 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | rvm: 4 | - 2.2.5 5 | 6 | sudo: required 7 | services: 8 | - docker 9 | - mysql 10 | - apache 11 | 12 | env: 13 | matrix: 14 | - INSTANCE: high-ubuntu-1404 15 | - INSTANCE: high-ubuntu-1604 16 | - INSTANCE: high-debian-7 17 | - INSTANCE: high-debian-8 18 | - INSTANCE: high-centos-6 19 | - INSTANCE: cli-ubuntu-1404 20 | - INSTANCE: cli-ubuntu-1604 21 | - INSTANCE: cli-debian-7 22 | - INSTANCE: cli-debian-8 23 | - INSTANCE: cli-centos-6 24 | - INSTANCE: config-ubuntu-1404 25 | - INSTANCE: config-ubuntu-1604 26 | - INSTANCE: config-debian-7 27 | - INSTANCE: config-debian-8 28 | - INSTANCE: config-centos-6 29 | 30 | # https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142455888 31 | before_script: 32 | - sudo iptables -L DOCKER || sudo iptables -N DOCKER 33 | - sudo apt-get install git 34 | - git clone https://github.com/saltstack-formulas/apache-formula.git /tmp/apache 35 | - git clone https://github.com/saltstack-formulas/php-formula.git /tmp/php 36 | - git clone https://github.com/saltstack-formulas/mysql-formula.git /tmp/mysql 37 | 38 | install: 39 | # setup ci for test formula 40 | - export BUNDLE_GEMFILE=$PWD/Gemfile 41 | - bundle install 42 | 43 | script: bundle exec kitchen verify ${INSTANCE} 44 | -------------------------------------------------------------------------------- /wordpress/init.sls: -------------------------------------------------------------------------------- 1 | {% from "wordpress/map.jinja" import map with context %} 2 | {% from "wordpress/cli-allow-root.sls" import allowroot with context %} 3 | 4 | include: 5 | - wordpress.cli 6 | 7 | {% for id, site in salt['pillar.get']('wordpress:sites', {}).items() %} 8 | {{ map.docroot }}/{{ id }}: 9 | file.directory: 10 | - user: {{ map.www_user }} 11 | - group: {{ map.www_group }} 12 | - mode: 755 13 | - makedirs: True 14 | 15 | # This command tells wp-cli to download wordpress 16 | download_wordpress_{{ id }}: 17 | cmd.run: 18 | - cwd: {{ map.docroot }}/{{ id }} 19 | - name: '/usr/local/bin/wp core download {{ allowroot }} --path="{{ map.docroot }}/{{ id }}/"' 20 | - runas: {{ map.www_user }} 21 | - unless: test -f {{ map.docroot }}/{{ id }}/wp-config.php 22 | 23 | # This command tells wp-cli to create our wp-config.php, DB info needs to be the same as above 24 | configure_{{ id }}: 25 | cmd.run: 26 | - name: '/usr/local/bin/wp core config {{ allowroot }} --dbname="{{ site.get('database') }}" --dbuser="{{ site.get('dbuser') }}" --dbpass="{{ site.get('dbpass') }}" --dbhost="{{ site.get('dbhost') }}" --path="{{ map.docroot }}/{{ id }}"' 27 | - cwd: {{ map.docroot }}/{{ id }} 28 | - runas: {{ map.www_user }} 29 | - unless: test -f {{ map.docroot }}/{{ id }}/wp-config.php 30 | 31 | # This command tells wp-cli to install wordpress 32 | install_{{ id }}: 33 | cmd.run: 34 | - cwd: {{ map.docroot }}/{{ id }} 35 | - name: '/usr/local/bin/wp core install {{ allowroot }} --url="{{ site.get('url') }}" --title="{{ site.get('title') }}" --admin_user="{{ site.get('username') }}" --admin_password="{{ site.get('password') }}" --admin_email="{{ site.get('email') }}" --path="{{ map.docroot }}/{{ id }}/"' 36 | - runas: {{ map.www_user }} 37 | - unless: /usr/local/bin/wp core is-installed {{ allowroot }} --path="{{ map.docroot }}/{{ id }}" 38 | {% endfor %} 39 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | wordpress-formula 3 | ================= 4 | 5 | A saltstack formula to install and configure WordPress on Debian, Ubuntu, and RHEL. 6 | 7 | .. note:: 8 | 9 | See the full `Salt Formulas installation and usage instructions 10 | `_. 11 | 12 | Available states 13 | ================ 14 | 15 | .. contents:: 16 | :local: 17 | 18 | ``wordpress`` 19 | ------------- 20 | 21 | Install and configure WordPress sites 22 | 23 | ``wordpress.cli`` 24 | ------------- 25 | 26 | Installs wp-cli 27 | 28 | ``wordpress.config`` 29 | ------------- 30 | 31 | Configure WordPress sites 32 | 33 | ``wordpress.plugin`` 34 | ------------- 35 | 36 | Installs Wordpress plugins 37 | 38 | 39 | Pillar customizations: 40 | ====================== 41 | 42 | .. code-block:: yaml 43 | 44 | wordpress: 45 | cli: 46 | source: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 47 | hash: 2906a669a28d2a344da88c63c96aff3c 48 | sites: 49 | sitename: 50 | username: 51 | password: 52 | database: 53 | dbuser: 54 | dbpass: 55 | url: http://example.ie 56 | title: 'My Blog' 57 | email: 'john.doe@acme.com' 58 | plugins: 59 | - '' 60 | plugins_url: 61 | '': 62 | url: '' 63 | name: '' 64 | 65 | Formula Dependencies 66 | ==================== 67 | 68 | The `wordpress-formula` requires PHP, a MySQL client, and a webserver. 69 | 70 | You may want to review the following formulas for help. 71 | 72 | * `php-formula `_ 73 | * `mysql-formula (mysql.client) `_ 74 | 75 | You also need either: 76 | 77 | * `nginx-formula `_ 78 | * `apache-formula `_ 79 | 80 | Author 81 | ====== 82 | 83 | Nitin Madhok nmadhok@g.clemson.edu 84 | Russell Ballestrini russell@ballestrini.net 85 | Debian Fork by Starchy Grant starchy@gmail.com 86 | -------------------------------------------------------------------------------- /wordpress/files/wp-config.php: -------------------------------------------------------------------------------- 1 | 51 | Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi 52 | FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -appConnTimeout 10 -idle-timeout 310 -flush -pass-header Authorization 53 | 54 | ServerName: sitenameA.com 55 | sitenameB.com: 56 | enabled: True 57 | Directory: 58 | default: {AllowOverride: All, Options: All, Require: all granted} 59 | DocumentRoot: /var/html/sitenameB.com 60 | Formula_Append: | 61 | 62 | Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi 63 | FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -appConnTimeout 10 -idle-timeout 310 -flush -pass-header Authorization 64 | 65 | ServerName: sitenameB.com 66 | php.sls: 67 | php: 68 | ng: 69 | fpm: 70 | service: 71 | enabled: True 72 | config: 73 | ini: 74 | opts: 75 | recurse: True 76 | settings: 77 | PHP: 78 | engine: 'Off' 79 | extension_dir: '/usr/lib/php5/20121212/' 80 | extension: [pdo, pdo_mysql.so, pdo_pgsql.so, iconv.so, openssl.so, curl.so, gd.so, geoip.so, imagick.so, json.so, ldap.so, mysqli.so, mysql.so, readline.so, recode.so] 81 | conf: 82 | opts: 83 | recurse: True 84 | settings: 85 | global: 86 | pid: /var/run/php5-fpm.pid 87 | pools: 88 | 'www.conf': 89 | enabled: True 90 | opts: 91 | replace: True 92 | settings: 93 | www: 94 | user: www-data 95 | group: www-data 96 | listen: /var/run/php5-fpm.sock 97 | listen.owner: www-data 98 | listen.group: www-data 99 | listen.mode: 0660 100 | pm: ondemand 101 | pm.max_children: 5 102 | pm.start_servers: 3 103 | pm.min_spare_servers: 2 104 | pm.max_spare_servers: 4 105 | pm.max_requests: 200 106 | 'php_admin_value[memory_limit]': 300M 107 | mysql.sls: 108 | mysql: 109 | server: 110 | root_user: 'root' 111 | root_password: 'somepass' 112 | user: mysql 113 | mysqld: 114 | bind-address: 0.0.0.0 115 | log_bin: /var/log/mysql/mysql-bin.log 116 | port: 3306 117 | binlog_do_db: foo 118 | auto_increment_increment: 5 119 | database: 120 | - siteAdb 121 | - siteBdb 122 | user: 123 | siteAdbuser: 124 | password: 'siteAdbpass' 125 | host: localhost 126 | databases: 127 | - database: siteAdb 128 | grants: ['all privileges'] 129 | siteBdbuser: 130 | password: 'siteBdbpass' 131 | host: localhost 132 | databases: 133 | - database: siteBdb 134 | grants: ['all privileges'] 135 | wordpress.sls: 136 | wordpress: 137 | cli: 138 | source: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 139 | hash: https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar.md5 140 | sites: 141 | sitenameA.com: 142 | username: siteAuser 143 | password: siteApass 144 | database: siteAdb 145 | dbhost: localhost 146 | dbuser: siteAdbuser 147 | dbpass: siteAdbpass 148 | url: http://siteA.com 149 | title: 'siteA title' 150 | email: siteA@email.com 151 | sitenameB.com: 152 | username: siteBuser 153 | password: siteBpass 154 | database: siteBdb 155 | dbhost: localhost 156 | dbuser: siteBdbuser 157 | dbpass: siteBdbpass 158 | url: http://siteB.com 159 | title: 'siteB title' 160 | email: siteB@email.com 161 | 162 | suites: 163 | - name: high 164 | provisioner: 165 | state_top: 166 | base: 167 | '*': 168 | - apache 169 | - apache.config 170 | - apache.vhosts.standard 171 | - php.ng 172 | - php.ng.mysql 173 | - mysql 174 | - wordpress 175 | - name: wordpress_cli 176 | provisioner: 177 | state_top: 178 | base: 179 | '*': 180 | - wordpress.cli 181 | - name: wordpress_config 182 | provisioner: 183 | state_top: 184 | base: 185 | '*': 186 | - wordpress.config -------------------------------------------------------------------------------- /wordpress/files/htaccess: -------------------------------------------------------------------------------- 1 | # This file is managed by Salt. 2 | # 3 | # Local changes will be overwritten! 4 | 5 | # BEGIN W3TC Browser Cache 6 | 7 | AddType text/css .css 8 | AddType text/x-component .htc 9 | AddType application/x-javascript .js 10 | AddType application/javascript .js2 11 | AddType text/javascript .js3 12 | AddType text/x-js .js4 13 | AddType text/html .html .htm 14 | AddType text/richtext .rtf .rtx 15 | AddType image/svg+xml .svg .svgz 16 | AddType text/plain .txt 17 | AddType text/xsd .xsd 18 | AddType text/xsl .xsl 19 | AddType text/xml .xml 20 | AddType video/asf .asf .asx .wax .wmv .wmx 21 | AddType video/avi .avi 22 | AddType image/bmp .bmp 23 | AddType application/java .class 24 | AddType video/divx .divx 25 | AddType application/msword .doc .docx 26 | AddType application/vnd.ms-fontobject .eot 27 | AddType application/x-msdownload .exe 28 | AddType image/gif .gif 29 | AddType application/x-gzip .gz .gzip 30 | AddType image/x-icon .ico 31 | AddType image/jpeg .jpg .jpeg .jpe 32 | AddType application/json .json 33 | AddType application/vnd.ms-access .mdb 34 | AddType audio/midi .mid .midi 35 | AddType video/quicktime .mov .qt 36 | AddType audio/mpeg .mp3 .m4a 37 | AddType video/mp4 .mp4 .m4v 38 | AddType video/mpeg .mpeg .mpg .mpe 39 | AddType application/vnd.ms-project .mpp 40 | AddType application/x-font-otf .otf 41 | AddType application/vnd.ms-opentype .otf 42 | AddType application/vnd.oasis.opendocument.database .odb 43 | AddType application/vnd.oasis.opendocument.chart .odc 44 | AddType application/vnd.oasis.opendocument.formula .odf 45 | AddType application/vnd.oasis.opendocument.graphics .odg 46 | AddType application/vnd.oasis.opendocument.presentation .odp 47 | AddType application/vnd.oasis.opendocument.spreadsheet .ods 48 | AddType application/vnd.oasis.opendocument.text .odt 49 | AddType audio/ogg .ogg 50 | AddType application/pdf .pdf 51 | AddType image/png .png 52 | AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx 53 | AddType audio/x-realaudio .ra .ram 54 | AddType application/x-shockwave-flash .swf 55 | AddType application/x-tar .tar 56 | AddType image/tiff .tif .tiff 57 | AddType application/x-font-ttf .ttf .ttc 58 | AddType application/vnd.ms-opentype .ttf .ttc 59 | AddType audio/wav .wav 60 | AddType audio/wma .wma 61 | AddType application/vnd.ms-write .wri 62 | AddType application/font-woff .woff 63 | AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw 64 | AddType application/zip .zip 65 | 66 | 67 | ExpiresActive On 68 | ExpiresByType text/css A31536000 69 | ExpiresByType text/x-component A31536000 70 | ExpiresByType application/x-javascript A31536000 71 | ExpiresByType application/javascript A31536000 72 | ExpiresByType text/javascript A31536000 73 | ExpiresByType text/x-js A31536000 74 | ExpiresByType text/html A3600 75 | ExpiresByType text/richtext A3600 76 | ExpiresByType image/svg+xml A3600 77 | ExpiresByType text/plain A3600 78 | ExpiresByType text/xsd A3600 79 | ExpiresByType text/xsl A3600 80 | ExpiresByType text/xml A3600 81 | ExpiresByType video/asf A31536000 82 | ExpiresByType video/avi A31536000 83 | ExpiresByType image/bmp A31536000 84 | ExpiresByType application/java A31536000 85 | ExpiresByType video/divx A31536000 86 | ExpiresByType application/msword A31536000 87 | ExpiresByType application/vnd.ms-fontobject A31536000 88 | ExpiresByType application/x-msdownload A31536000 89 | ExpiresByType image/gif A31536000 90 | ExpiresByType application/x-gzip A31536000 91 | ExpiresByType image/x-icon A31536000 92 | ExpiresByType image/jpeg A31536000 93 | ExpiresByType application/json A31536000 94 | ExpiresByType application/vnd.ms-access A31536000 95 | ExpiresByType audio/midi A31536000 96 | ExpiresByType video/quicktime A31536000 97 | ExpiresByType audio/mpeg A31536000 98 | ExpiresByType video/mp4 A31536000 99 | ExpiresByType video/mpeg A31536000 100 | ExpiresByType application/vnd.ms-project A31536000 101 | ExpiresByType application/x-font-otf A31536000 102 | ExpiresByType application/vnd.ms-opentype A31536000 103 | ExpiresByType application/vnd.oasis.opendocument.database A31536000 104 | ExpiresByType application/vnd.oasis.opendocument.chart A31536000 105 | ExpiresByType application/vnd.oasis.opendocument.formula A31536000 106 | ExpiresByType application/vnd.oasis.opendocument.graphics A31536000 107 | ExpiresByType application/vnd.oasis.opendocument.presentation A31536000 108 | ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000 109 | ExpiresByType application/vnd.oasis.opendocument.text A31536000 110 | ExpiresByType audio/ogg A31536000 111 | ExpiresByType application/pdf A31536000 112 | ExpiresByType image/png A31536000 113 | ExpiresByType application/vnd.ms-powerpoint A31536000 114 | ExpiresByType audio/x-realaudio A31536000 115 | ExpiresByType image/svg+xml A31536000 116 | ExpiresByType application/x-shockwave-flash A31536000 117 | ExpiresByType application/x-tar A31536000 118 | ExpiresByType image/tiff A31536000 119 | ExpiresByType application/x-font-ttf A31536000 120 | ExpiresByType application/vnd.ms-opentype A31536000 121 | ExpiresByType audio/wav A31536000 122 | ExpiresByType audio/wma A31536000 123 | ExpiresByType application/vnd.ms-write A31536000 124 | ExpiresByType application/font-woff A31536000 125 | ExpiresByType application/vnd.ms-excel A31536000 126 | ExpiresByType application/zip A31536000 127 | 128 | 129 | 130 | Header append Vary User-Agent env=!dont-vary 131 | 132 | AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json 133 | 134 | # DEFLATE by extension 135 | AddOutputFilter DEFLATE js css htm html xml 136 | 137 | 138 | 139 | 140 | Header set Pragma "public" 141 | Header append Cache-Control "public" 142 | 143 | 144 | 145 | 146 | Header set Pragma "public" 147 | Header append Cache-Control "public" 148 | 149 | 150 | 151 | 152 | Header set Pragma "public" 153 | Header append Cache-Control "public" 154 | 155 | 156 | # END W3TC Browser Cache 157 | 158 | # BEGIN WordPress 159 | 160 | RewriteEngine On 161 | RewriteBase / 162 | RewriteRule ^index\.php$ - [L] 163 | RewriteCond %{REQUEST_FILENAME} !-f 164 | RewriteCond %{REQUEST_FILENAME} !-d 165 | RewriteRule . /index.php [L] 166 | 167 | # END WordPress 168 | --------------------------------------------------------------------------------