| | 1 | = Shared Varnish Caching = |
| | 2 | If you find that your site runs slowly and you've turned on all the CMS specific caching features available to you, it might be time to use our shared [https://www.varnish-cache.org/about varnish server]. Varnish helps manage higher traffic websites by creating a cache of all the previous page loads and serving them up with a minimal amount of processing. In order to hook into our shared varnish instance, you'll need to make some changes to your DNS entries, and a support team member will need to add a file to our varnish server (currently dolores.mayfirst.org). |
| | 3 | |
| | 4 | == Changing DNS Entries == |
| | 5 | Visit the control panel and the hosting order that should use varnish caching. Change the DNS entry for the appropriate domains. For example, you might want |
| | 6 | |
| | 7 | || '''Domain Name''' || '''IP Address''' |
| | 8 | || myexample.org || 209.51.180.234 |
| | 9 | || www.myexample.org || 209.51.180.234 |
| | 10 | || myexample.com || 209.51.180.234 |
| | 11 | || www.myexample.com || 209.51.180.234 |
| | 12 | || '''example.mayfirst.org''' || '''doesn't change''' |
| | 13 | |
| | 14 | Notice that the last entry example.mayfirst.org did not change. This domain can serve as a direct link to the server in case anything goes awry. |
| | 15 | |
| | 16 | == Modify Your Config Files == |
| | 17 | Some CMS's require you to modify your configuration files. You should check to make sure you have the correct configurations set. |
| | 18 | |
| | 19 | === For Mediawiki === |
| | 20 | In your LocalSettings.php, you'll need to add the following: |
| | 21 | {{{ |
| | 22 | $wgUseSquid = true; |
| | 23 | $wgSquidServers = array('209.51.180.234:80'); |
| | 24 | }}} |
| | 25 | |
| | 26 | === For Drupal === |
| | 27 | * Drupal 6 requires the [http://pressflow.org/ Pressflow] distribution. |
| | 28 | * Drupal 7 should work fine using the standard MF/PL web app. |
| | 29 | |
| | 30 | === Wordpress === |
| | 31 | You shouldn't need to take any special steps for wordpress caching. Though please make sure to turn off W3 Total Cache before using our shared varnish server. |
| | 32 | |
| | 33 | == Support Team == |
| | 34 | Our current varnish server is dolores. You'll need to make the following configuration changes for each new hosting order. |
| | 35 | |
| | 36 | * Create a new vcl file for the domain, i.e. /etc/varnish/vhosts/domain-name.vcl |
| | 37 | * Copy the format of a current vcl file, depending on the CMS. |
| | 38 | * Add an include line in /etc/varnish/vhosts/vhosts-list.vcl for the file you created above. |
| | 39 | * run /etc/init.d/varnish reload |
| | 40 | |
| | 41 | '''NOTE:''' The above instructions should ultimately become a part of puppet or red. |
| | 42 | |