Showing posts with label Varnish. Show all posts
Showing posts with label Varnish. Show all posts

Thursday, August 2, 2012

RubyStack now with Rails 3.2.7 and Varnish

We are happy to announce a new version of BitNami RubyStack that includes the latest version of Rails, 3.2.7.

BitNami RubyStack simplifies the development and deployment of Ruby on Rails applications for development, testing and production. It can be deployed using a native installer for Windows, OS X or Linux, as a virtual machine or in the Amazon cloud. Thanks to the Amazon Free Tier, you can try BitNami RubyStack in the cloud for free during one year.

In addition to Rails we have upgraded the following components:

- Ruby 1.9.3-p194
- Git 1.7.11.3
- Subversion 1.7.5
- NGinx 1.3.4
- Passenger 3.0.14
- PHP 5.3.15

It also ships the following components that you can use in your applications:

- RVM 1.13.6
- DevKit tdm-32-4.5.2 for Windows
- MySQL 5.5.21
- Apache 2.2.22
- ImageMagick 6.7.5

In this release we include an optional new component: Varnish Cache server 3.0.1 for Linux and OS X. It is a web application accelerator that can be deployed in front of any HTTP server and can significantly improve performance. You can learn more in the BitNami Varnish quick start guide.

It takes just minutes to deploy BitNami RubyStack and we are always looking for ways we can improve it. So go ahead, give it a try and let us know what you think!

Monday, July 2, 2012

BitNami WordPress now with Varnish Cache

We have just updated BitNami WordPress to version 3.4.1 This version bundles a ready-to-use version of Varnish Cache. 

Varnish Cache is a web application accelerator (also known as a caching HTTP reverse proxy) that can be installed and configured in front of any HTTP server and takes care of caching the content being served. This blog post will show you how to configure a BitNami WordPress Amazon micro instance to use the Varnish for improving the performance.

By default, Varnish is disabled. You can enable it by renaming the control script:

$ cd /opt/bitnami
$ sudo mv /opt/bitnami/varnish/scripts/ctl.sh.disable /opt/bitnami/varnish/scripts/ctl.sh
$ sudo ./ctlscript.sh start varnish

Varnish is installed with a default configuration file, agnostic to the web application being cached. Using this configuration file, although achieving high performance, could lead to some contents not bring properly refreshed in the cache so your users would get an outdated version of your site. The solution is to use a customized VCL configuration file. A good source is the Varnish examples page. In this example, we will change our default.vcl configuration file to a WordPress-specific one (you can find the source file here).

$ sudo mv wordpress.vlc /opt/bitnami/varnish/etc/varnish/

Varnish runs on port 81 by default. You may want to change it to port 80 and change Apache to a different port. We are going to use port 81 for Apache and port 80 for Varnish in this example. You will need to perform the following changes in the server configuration files:

/opt/bitnami/apache2/conf/httpd.conf

Listen 80  change to  Listen 81

/opt/bitnami/varnish/scripts/ctl.sh

VARNISH_PORT=81 change to VARNISH_PORT=80

/opt/bitnami/varnish/etc/varnish/default.vcl where it is specified the Apache port.

backend default {
    .host = "127.0.0.1";
    .port = "80";  change to  "81"
}     

You can now restart the servers:

$ sudo /opt/bitnami/ctlscript.sh restart

In our real life tests running WordPress on an Amazon Web Services micro instance server, a Varnish-enabled instance was able to accommodate between 5 and 10 times more simultaneous users than a vanilla WordPress server.