One-click installers: Python web frameworks

Posted in Python by

This post is the first in a series taking a closer look at the variety of one-click installers available with the WebFaction control panel. Today, we’re starting close to our Python roots, by taking a look our Python web application tool belt.

We have one-click installers for several popular ways of building a web application with Python: CherryPy, Django, Pyramid, TurboGears, Zope and Plone, and mod_wsgi:

CherryPy

CherryPy is an object-oriented web framework that affords flexibility when it comes to choosing templating, database interaction, and more. CherryPy has a long history with WebFaction, as the control panel and API started out as CherryPy applications.

Django

Django is far and away the most popular Python one-click installer, and it comes as no surprise, thanks to its “batteries included” approach, extensive documentation, and enormous ecosystem of pluggable apps. Django’s all-in-one package includes a database ORM, a templating engine, and an administration interface.

See the WebFaction Django docs for a “getting started” guide and various configuration and troubleshooting sections.

Pyramid

Pyramid, fomerly known as repoze.bfg, is a web framework that’s often discribed as “minimalist.” Much like CherryPy, or in contrast to Django, Pyramid makes few assumptions about what components your web application might use, such as templating engines or databases.

See the WebFaction Pyramid docs for a deployment example, and a couple of WebFaction-specific Pyramid instructions.

TurboGears

TurboGears brings together several separate libraries to form a web framework. For example, TurboGears uses SQLAlchemy, a Python SQL toolkit, to provide persistence with a database, or Genshi for templating.

See the WebFaction TurboGears docs for a deployment example.

Zope and Plone

Zope is an object-oriented web application coupled with a unique persistence layer, the Zope Object Database, that stores actual Python objects. Plone is a comprehensive content management system that runs on Zope. The one-click installer provides both, but creating a Plone site is optional.

See the WebFaction Zope and Plone documentation for instructions on setting up a Plone site, and detailed Zope and Plone administration tasks.

mod_wsgi

WSGI, the Web Server Gateway Interface, is a standard interface for Python web applications (as defined in PEP 333). WSGI provides a common way for Python web applications to communicate with web servers. Most Python web frameworks you know and love are WSGI compatible. mod_wsgi is a module that adds WSGI support to the Apache web server.

The mod_wsgi one-click installer provides an Apache server with mod_wsgi installed and configured. The mod_wsgi one-click installer is especially handy for situations where you want to use a WSGI-compatible framework that doesn’t already have a one-click installer, like Flask and Bottle, or something of your own creation.

 

Python has a broad and capable family of web frameworks, so there’s sure to be one that has the features or characteristics you need. If one of these tools has piqued your interest, try its one-click installer. If you need any help, join us in the Q&A Community.

· 0 Comments ·
-
- - -
-

Introducing our new control panel design

Posted in Control panel by

Today we’re excited to unveil the latest change to the WebFaction hosting service: a new design for the WebFaction control panel.

This new design is the most visible change but under the hood it comes with a complete rewrite of the software powering the control panel. This new system should allow us to add new features quicker.

As always, please let us know what you think in the comments. We’ve tried to work out all the bugs ahead of time, but there’s no substitute for the keen eye of our customers, so if you run into any problems, join us in the Q&A Community for help.

· 12 Comments ·
-
- - -
-

A look at installing your own tools on WebFaction servers

Posted in Server setup by

In previous posts, we’ve demonstrated how to use software we provide through one-click installers or through your shell account. But sometimes you may want to use something we haven’t installed. Today we’d like to give a better picture of how to do that, and what WebFaction servers already have installed to help you.

Sometimes the software you want to use will be available as a binary or script you can run more or less straight away, without any compilation steps. It’s simply a matter of downloading and running. wget and curl both make it easy to download files, limiting the need to upload with SFTP.

Take ack, a grep alternative, as an example. Downloading and installing ack is a one-liner, provided $HOME/bin is in your PATH:

curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3

Much of the software you may want to install may require a more complicated installation process, however. In particular, you may be required to configure, compile, and install as separate steps.

To that end, each WebFaction server comes equipped with many of the common tools you need to do that. In particular, each WebFaction server has make for running the compilation and installation process, C/C++ compilers, and plenty of common prerequisite libraries. Preinstalled libraries include essentials such as readline and libcurl, as well as fancier libraries, like ImageMagick for graphics manipulation (to get a sense of what’s installed, try running ldconfig -p).

System configuration details are a bit dry, however. For a more concrete demonstration, we’ll compile the open source key-value store Redis. In general, the strategy for setting up software in your home directory is:

  1. Get the source.
  2. Configure (if applicable) and build.
  3. Install.

Of course, no two packages are alike, so be sure to read the software’s README file and other documentation. You should also look over the WebFaction Installing Software from Source documentation for some additional guidelines.

In Redis’s case, the process is simple. First, log in to your SSH account, then download the source with this command:

wget http://redis.googlecode.com/files/redis-2.6.11.tar.gz

Next, extract the tarball and switch to the source directory with these commands:

tar -xf redis-2.6.11.tar.gz
cd redis-2.6.11

Redis doesn’t require any configuring before building, so the next step is to compile. Enter make and press Enter. It takes a couple of minutes to compile, but when it’s done you’ll have working redis-server and redis-cli executables in the src directory. Before continuing, it’s best to confirm that the compilation finished without any problems. Many packages, including Redis, provide a test suite to confirm the build results. Run the test suite with this command:

make test

The tests take a few minutes to run, but provide confidence that the software will work as expected. Once we’re satisfied it’s ready, then we can install Redis to the home directory. Install with this command:

make PREFIX=$HOME install

Now, the Redis binaries are in your $HOME/bin directory. You can run the server with redis-server and the command-line client with redis-cli. You’re free to store keys and values to your heart’s content.

For a broader example, featuring several different packages and numerous dependencies, check out our post Setting up the reddit app without root access. It contains several more examples of installing software in your home directory.

Let us know what you’re installing in the comments, and if you need any help, join us in the Q&A Community.

· 2 Comments ·
-
- - -
-

Welcoming Ruby 2.0

Posted in General by

Today we’re happy to announce that the recently released Ruby 2.0 is now available on all of our servers. You can run Ruby 2.0 today as ruby2.0. Here it is on Web310:

$ ruby2.0 -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]

Ruby 2.0 comes with a number of new features, performance improvements, and built-in library changes.

One of the more prominent new features is an addition to the language syntax: keyword arguments. Sometimes known as named parameters, keyword arguments provide a more explicit way of using arguments and setting defaults. Here’s a little example:

$ irb2.0
irb(main):001:0> def greet(greeting: 'Hello',  name: 'WebFactioneers')
irb(main):002:1>   puts "#{greeting}, #{name}!"
irb(main):003:1> end
=> nil
irb(main):004:0> greet(name: 'readers')
Hello, readers!
=> nil
irb(main):005:0> greet(greeting: 'Howdy')
Howdy, WebFactioneers!
=> nil
irb(main):006:0> # you can even change the order
irb(main):007:0* greet(name: 'readers', greeting: 'Salutations')
Salutations, readers!
=> nil

For more details about Ruby 2.0, including a description of potential incompatibilities with previous Ruby versions, please see the official release notes. Try out Ruby 2.0 with your WebFaction account and, if you have any questions, join us in the Q&A Community.

· 0 Comments ·
-
- - -
-

A look at version control on our servers

Posted in Git by

Appending version_36 or final_2 to a file name is no way to keep track of different versions of files. Instead, we’re lucky to have a wide variety of version control tools at our disposal. And a webserver is no place to skimp on such things, so today we’re taking a look at version control on WebFaction’s servers.

If you like your version control centralized, with a single, authoritative repository, we’ve got you covered with Subversion. Both the Subversion client and server are available with your WebFaction account. For example, you can check out a working copy of the WordPress trunk with the svn command-line client like this:

$ svn co http://core.svn.wordpress.org/trunk/ wp-source

You can also serve a Subversion repository with the one-click installer. You can serve a Subversion repository publicly for open-source projects, or set up users to control access for private projects. Check out the Subversion documentation for more details.

If you like your version control distributed, where each user has a complete “clone” of the repository, then Git is a great choice. Each WebFaction server has the Git client installed, and serving Git repositories on the web is a snap with the one click installer. The client’s handy for grabbing code from GitHub, like the Django repository:

$ git clone https://github.com/django/django.git

Like Subversion, you can make respositories available on the web with the one-click installer. A single Git application can host mulitple repositories and can be configured for public access or per user access for private projects. See the Git documentation for detailed instructions.

An additional benefit of using a Git or Subversion application is that you can link your repositories to a Trac installation. Trac is a handy, open source project management tool that features a ticket tracker, wiki, and repository browser. For more details about using Trac with your WebFaction account, see our Trac documentation.

Of course, Git and Subversion aren’t your only options. It’s easy to set up other version control tools in your home directory. We have instructions for installing Mercurial and Bazaar clients, as well as publishing Mercurial and Bazaar repositories on the web with hgweb and loggerhead respectively.

So if you haven’t already, give version control a try with your WebFaction account. Let us know what you think in the comments, or if you need any help, join us in the Q&A Community.

· 0 Comments ·
-
- - -
-

Django 1.5 is here!

Posted in Python by

Today, the latest version of Django has been released. And we’re happy to make it available to you with the new Django 1.5 one-click installer:

Screen shot 2013-02-26 at 3.14.47 PM

Django 1.5 brings with it several major improvements, including:

  • A customizable user model. Now you can use you own model to store information about your users. Use it to ditch that 30-character username restriction, or to store first name and last name together in a single field.
  • The verbatim template tag. It turns off Django’s templating between the tags. Handy for using some JavaScript libraries, for example.
  • Experimental Python 3 support. Now you can start testing your Django application with Python 3, to prepare for the future of Python. Production-ready status will be here before you know it, when Django 1.6 is released.

Django 1.5 has a slew of other changes, too. Check out the Django project’s release announcement and release notes (mind those backwards incompatible changes), then give the new one-click installer a test drive. Let us know what you think in the comments and, if you have any questions, join us in the Q&A Community.

· 6 Comments ·
-
- - -
-

A look at databases on our servers

Posted in Control panel by

It’s a rare web hosting user that can get by without a database, so today we’re taking a closer look at how you can setup and use popular databases with WebFaction.

To start, the WebFaction control panel makes it easy to create databases, so there’s no need for any complex commands. You just pick out some details and click Add database (Check out the introduction to our new database management interface for an in-depth look):

A screenshot of the databases user interface

A database created with the control panel runs on your server’s shared database process. The shared server is more convenient than configuring your own and doesn’t count toward your account’s memory usage.

Different applications have different needs, so every WebFaction server supports both MySQL and PostgreSQL. MySQL is extremely popular and is used in several of our one-click installers, including WordPress and Drupal. PostgreSQL is growing in popularity and sports some exciting features, like procedural languages PL/Perl and PL/Tcl.

Once you’ve created your database of choice, it’s easy to connect to it and start storing data. Check out these documentation sections:

Although the shared database and the associated documentation is convenient, it’s not necessarily for everyone. That’s why we recently introduced a one-click installer for private MySQL and PostgreSQL instances. A private database is a good option if you’re facing problems with contention on the shared database or if you want to customize the database configuration.

And, of course, you can always set up and run a specialty database from your home directory on your own. For example, check out our instructions on installing MongoDB.

For more details, see the WebFaction User Guide page Databases. If you have any questions, let us know in the comments or join us in the Q&A communtity.

· 0 Comments ·
-
- - -
-

Ten amazing years, $100,000 giveaway!

Posted in General by

[Update Feb 7th 9.30am UTC] Our birthday giveaway has now ended. We sold out in about 40 hours.

Today marks WebFaction’s tenth birthday: ten years of hosting, ten years of support, and ten years of working to provide a service that we can be proud of. Ten years ago WebFaction opened its metaphorical doors to the world, and though a lot has changed since then, including our name, we hope to be doing for another ten years what we’ve always done: our best for our customers.

To celebrate this milestone, we’re giving away $100,000 in hosting services to new and existing customers. Starting tomorrow at 2pm UTC, new and existing customers may receive a one-time credit added to their accounts.

New customers: just sign up from tomorrow Feb 5th at 2pm UTC and pay $9.50 for the first month (or pay for longer). $100 will automatically be credited to your account.

Existing customers: add one new service to your account from tomorrow Feb 5th at 2pm UTC (a 256 MB plan, 256 MB extra memory, or a 1GB plan) and pay for one month of that service, and you will receive the next three months of that service for free.

Each customer is limited to one credit only, and it is non-transferable and non-refundable. Once we’ve given away $100,000 in services, the promotion will end and we’ll update this blog post to reflect that. Be quick or you might miss out on the free services. If you don’t need them yourself you can refer a friend and earn yourself some affiliate rewards.

Here is the Twitter announcement and the Facebook announcement so you can help spread the word if you’re on Twitter or Facebook.

Thank you for our first ten years; we can’t wait to see what’s in the years to come.

[Update Feb 5th 2pm UTC]: The giveaway has started!
[Update Feb 7th 9.30am UTC] Our birthday giveaway has now ended. We sold out in about 40 hours.

· 48 Comments ·
-
- - -
-

Introducing private PostgreSQL instances

Posted in PostgreSQL by

In October, we introduced the private MySQL instance installer as a solution to the “bad neighbor problem,” where one user consumes too much of a server’s shared MySQL database’s resources. Today, we’re introducing the private instance installer for PostgreSQL.

Like the private MySQL instance installer, there are a few details to consider:

  • The private instance relies upon the server’s globally-installed PostgreSQL binaries and libraries. If a security problem is found in PostgreSQL, WebFaction will apply the appropriate patches and no action is required on your part.
  • On CentOS 6 servers (web300 and greater), the version of PostgreSQL is 9.1. On CentOS 5 servers, the version of PostgreSQL is 8.3.
  • The PostgreSQL configuration files are owned by your user account and the server process is run under your user account. This means that you have full control over how the instance is configured and when it starts and stops running.
  • When the instance is installed, a cronjob is created to make sure the instance is running. Every 20 minutes the instance is checked, and if the instance is down, then it is restarted.
  • When the instance is installed, a cronjob is created to dump all the of the instance’s databases to a file every 24 hours. One week old dumps are deleted automatically.
  • The private instance may consume hundreds of megabytes of memory, depending on the instance’s configuration and the volume of data stored. The memory consumed counts toward your account’s memory allotment  For non-trivial datasets, we recommend upgrading to a minimum of 512 MB of memory or using one of our new 1 GB, 2 GB, or 4 GB plans.
  • To move data from the shared database server to a private instance, please see our importing and exporting documentation as a model for migrating your data.

Starting today you can use the one-click installer with the WebFaction control panel. Let us know what you think in the comments, and if you have any problems, join us in the Q&A Community.

· 7 Comments ·
-
- - -
-

New databases management interface

Posted in Control panel by

Today we’re proud to show you the newest update to the WebFaction control panel. We’ve upgraded the way you create and manage MySQL and PostgreSQL databases and users, as a part of our ongoing effort to make the control panel easier to use. We’ve made this two-minute video to show off how the new interface works:

The new databases interface is more flexible when it comes to creating databases and determining who can access them. In the past, database names were required to begin with your username and an underscore. The new databases interface throws that requirement out the window. Starting today, you can name your databases as you please. Perhaps more importantly, now you can grant a single user access to multiple databases, and more than one user may be granted access to any one database.

In addition to the video, we’ve updated our documentation to reflect the latest changes to the control panel. Let us know what you think in the comments and if you run into any problems, join us in the Q&A Community.

· 12 Comments ·
-
- - -
-