Welcoming Rails 3.2.1 and Ruby 1.9.3

Posted in Rails by

As you may have noticed, a new installer has appeared in the control panel for Rails 3.2.1:

Not only does the new installer include the latest iteration of Rails, but it also sports a shiny new version of Ruby, 1.9.3. Ruby-1.9.3 is now installed on all WebFaction servers:

[demo@web310 ~]$ ruby1.9 -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

The 1.9-series Ruby features various bug fixes and library changes you might expect from a Ruby release, but it also introduces some important language changes. For example, Ruby 1.9 introduces a new syntax for creating anonymous functions:

howdy = lambda {|name| puts "Howdy, #{name}."}  # old style
hi = -> (name) {puts "Hi, #{name}."}            # new style

Ruby 1.9 introduces some other syntax and API changes, including changes to string encoding. So check out the Ruby NEWS file for more information.

Meanwhile, Rails 3.2 isn’t missing out on the fun, bringing some handy improvements, too. Highlights include a faster development mode and faster request routing. Another useful feature of Rails 3.2 is easy query explanations. In development mode, ActiveRecord queries that take longer than one half second to finish are automatically explained. In general, a new explain method makes it easier to track down slow queries and investigate indices.

To learn more about the latest developments in Ruby, check out the complete Ruby on Rails 3.2 Release Notes document.

When you’re ready, give the new Rails installer a try. If you have any questions, join us in the Q&A Community.


Nine years already!

Posted in General by

Nine years ago we registered python-hosting.com which later became WebFaction.
Since the beginning we focused on building solid foundations: fast and stable servers, great customer service and up-to-date software. A lot has happened in 9 years but we’re proud to say that the foundations are still there.

Things are definitely speeding up though and in the last year alone we’ve almost doubled in size and we’ve added more features in one year than in the previous several years: we extended into Europe and then Asia, we started rolling out a new control panel, we built a new server setup with an innovative neighbor-protection system, we provided two massive upgrades on our base hosting plan (first diskspace and then memory) and on our managed dedicated servers, we added a 1h account setup guarantee and we added a gazillion new tools and versions to our one-click installer and our server setup.

But most importantly we hope that we have sustainably kept our customers happy and we want to thank all of you for the nice comments on Twitter, on your websites and in support tickets.

To celebrate our 9-year birthday we are offering a $50 discount on all new signups (minimum one-year pre-payment). Existing customers can also get the discount if they buy extra plans for their account. To receive the discount just use the promo code “9YEARS” when you signup at https://www.webfaction.com/signup or mention “9YEARS” when you request an upgrade in the control panel (under Account->Upgrade/Downgrade). This code is valid until February 12th 2012 at midnight UTC.

Here is to the next 9 years!


A Look at Our PHP Setup

Posted in Server setup by

In the tradition of A look at our Python setup, today’s post is all about WebFaction’s PHP setup. While some of our specialized installers get a lot of attention, we know that PHP is an important, if not glamorous, part of many web developers’ toolbox. So let’s take a closer look.

On our servers, PHP 5.2 is the default version. It’s not the newest and shiniest, but it’s hugely popular. For example, on Web310:

$ php --version
PHP 5.2.17 (cli) (built: Jan 17 2012 13:19:44) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube
        Ltd., and
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

But we’re not ignoring PHP’s development. PHP 5.3 is also available:

$ php53 --version
PHP 5.3.9 (cli) (built: Jan 16 2012 15:27:59) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube

We’ve tried to provide a lot of the more popular and useful compilation options. For example, we’ve enabled libcurl support so you can start making HTTP requests, right out of the box:

    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, "http://www.webfaction.com");

Here’s a complete list of the our compilation flags on a CentOS 6 (64-bit) server:


You can see all the details on your specific machine’s PHP setup by running php-config.

In case you missed it previously, you should also know that our PHP setup allows you to send email with PHP’s built-in mail() function. There’s no requirement to use an SMTP library to send mail (though you’re welcome to do so, if you prefer). You can send email simply, like so:

    $message = "Just testing sendmailn";
    mail('support@webfaction.com', 'Help me', $message);

Of course, PHP in isolation isn’t so useful; we can plug it into the web with our corresponding Static/CGI/PHP applications. They’re more flexible than meets the eye. By default, a Static/CGI/PHP application uses a traditional php-cgi deployment method, where each PHP script is loaded and run with each request. It’s simple, effective, and perhaps best of all, doesn’t count toward your account’s memory usage.

But if you’d like to tweak your PHP deployment method, you can choose FastCGI as an alternative. Although it consumes your account’s memory, it has better performance for some applications. To use FastCGI, create a .htaccess file in your Static/PHP/CGI application directory containing this line:

<FilesMatch .php$>
    SetHandler php52-fcgi

You can also replace php52-fcgi with php52-fcgi2, php52-fcgi3, through php52-fcgi6 to control the number of processes FastCGI will use to serve the site.

In addition to .htaccess, you’re free to use your own php.ini file to configure your PHP application. For example, you can use php.ini to set the maximum size of file uploads. See our existing Configuring PHP docs for all the details.

Finally, we have some Static/CGI/PHP-derived installers for popular tools, like WordPress and Drupal. Under the hood, they’re PHP applications through and through, so you can use what you’ve learned here to extend or customize those applications too.

We hope this gives you a better picture of what our PHP setup is capable of and what you can do with your account. If you have any questions, let us know in the comments or join us on the Q&A Community.