Zotonic: the Erlang Content Management System
Described by its authors as a pragmatic and modern CMS, Zotonic is that and much more. When I started using Zotonic, it was because of its efficiency and the fact that I could pack several client CMS sites onto a machine with only humble resources. I soon discovered, however, that Zotonic is not only a CMS, but also a Web framework, which allows me to create very complicated Web sites in a fraction of the time it would have taken me using more traditional languages and frameworks. Zotonic won't fall over if it encounters an error, and it does not need to be poked with a stick and awakened every time a request comes in.
Zotonic is written in Erlang, a functional language that was designed for programming telephone switches. The logic behind using Erlang for Web development is that modern Web sites, with their plethora of connections from users and robots, are starting to look more and more like telephone exchanges. “I have never programmed in a functional language, and Erlang looks like Dutch to me!”, I hear you say. Well, the authors of Zotonic are fluent in Erlang (and Dutch, incidentally), and they have done a good job of creating a piece of software that is useful out of the box, regardless of whether you know Erlang, and Zotonic could be just the killer app you need to dive in and learn Erlang.
Another attractive feature of Zotonic is its PostgreSQL database (see sidebar). As someone who has toyed with learning Erlang for a while, probably one of the big barriers was that on top of learning a completely new programming paradigm, I also would have to learn a new database in the form of mnesia. Zotonic's use of PostgreSQL means one less new thing to learn and at least allows me to feel in familiar territory when I am designing my data.
Note:
The only database offered by Zotonic at the moment is PostgreSQL; however, there are plans to create “Elastic Zotonic”, which will use a distributed store. Although Zotonic does use a relational database, in most cases, what you are inserting into the database will be a Zotonic resource with a key (ID) and a document (Props). Relationships between resources are defined using predicates, such as has_relation and has_part. For a lot of Web development, this is all you need; however, if you do need it, the power of the relational database is available to you.
Update:
As it stands, the default Zotonic branch is under heavy development, and installation instructions have changed slightly from the time this article went to press. You can clone the 0.6 version instead using hg clone -r release-0.6.x https://zotonic.googlecode.com/hg/ zotonic. If you want to live on the edge, see the new instructions for the default branch: code.google.com/p/zotonic/source/browse/doc/INSTALL.
You also can check out the very active Zotonic Google group if you need further help.
I am running the latest version of Ubuntu, which has Erlang preinstalled. You can test whether you have Erlang by typing erl at the command line. If you get the Erlang shell, you are good to go. Press Ctrl-c, followed by the letter a and carriage return to exit Erlang. If you don't have Erlang on your system, you can download it from the Erlang Web site or install it with your distribution's package manager.
Another dependency is ImageMagick; to check whether it's installed, run:
convert -version
You, of course, need to have PostgreSQL installed, and you need Mercurial installed to fetch the latest version of Zotonic from the Google code site.
Fetch the Zotonic source and build it:
hg clone https://zotonic.googlecode.com/hg/ zotonic cd zotonic make
Now, create a database for Zotonic:
CREATE USER zotonic WITH PASSWORD 'yourdbpassword';
CREATE DATABASE zotonic
WITH OWNER = zotonic ENCODING = 'UTF8';
GRANT ALL ON DATABASE zotonic TO zotonic;
\c zotonic
CREATE LANGUAGE "plpgsql";
Zotonic comes complete with an example site, which implements a simple blog. You can find the code for this default site in priv/sites/default/, and you can get this default site running by creating a config file and starting Zotonic.
Find the sample config file in priv/sites/default/config.in, and rename it or create a copy with no extension:
cp priv/sites/default/config.in priv/sites/default/config
Open config in your favourite text editor, and modify it to use the database you just created:
% Hostname for virtual host support
{hostname, "127.0.0.1:8000"},
{hostalias, "localhost:8000"},
% PostgreSQL database connection
{dbhost, "127.0.0.1"},
{dbport, 5432},
{dbuser, "zotonic"},
{dbpassword, "yourdbpassword"},
{dbdatabase, "zotonic"},
Now, start Zotonic in debug mode using start.sh:
./start.sh
You should see text fly by on the console that suggests some tables are being created. Point your browser at 127.0.0.1:8000, and you should see your new blog.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Web Development News
Developer Poll
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- The Pari Package On Linux
- Home, My Backup Data Center
- New Products
- Dart: a New Web Programming Experience
- This is the easiest tutorial
4 hours 51 min ago - Ahh, the Koolaid.
10 hours 29 min ago - git-annex assistant
16 hours 29 min ago - direct cable connection
16 hours 51 min ago - Agreed on AirDroid. With my
17 hours 1 min ago - I just learned this
17 hours 6 min ago - enterprise
17 hours 36 min ago - not living upto the mobile revolution
20 hours 27 min ago - Deceptive Advertising and
21 hours 3 min ago - Let\'s declare that you have
21 hours 3 min ago








Comments
Quitting Out of the Erlang Interpreter
Instead of ctrl-C + abort, the faster and cleaner way out of the erlang interpreter command prompt >:
q().
Kind of like typing quit() at a python interpreter command prompt, but shorter and ending with a period/full stop. (Don't all good sentences end with a period? They do in Erlang.)