Elgg 1.8b1 on Ubuntu 11.04

From Crashcourse Wiki

Jump to: navigation, search


Installing Elgg 1.8b1 on Ubuntu 11.04

Just out of interest, I want to install, configure and use (at least in a basic sense) the Elgg social networking engine on my fully-updated Ubuntu 11.04 system, and all of the documentation I've found seems at least a wee bit out-of-date, or incomplete, so I've documented my first attempt to do this and I'm open to suggestions as to how to correct or improve what I've written here.

Given the inevitability of spammers making a mess of openly-writable wiki pages, if you have suggestions, e-mail me at rpjday@crashcourse.ca and I'll incorporate your suggestions into the instructions here.

It might seem premature to try the current beta version as opposed to the stable version but since I'm just playing, there seems to be no reason to not test out Elgg 1.8 beta 1. Oh, and there's one more point.

I'm working off of the documentation I've found online in a number of places (see next section) and, in some places, this documentation simply seems wrong (or outdated) so I'll throw out the occasional question and others are welcome to answer to clarify the best way to do this. And so, without further ado, to work.

The existing online documentation

I'm working off of a combination of online docs found in various places via Teh Google:

So I'll just combine the above to get the best of all possible worlds, and see where we end up.

The required non-Elgg software and configuration

Here's the (alleged) setup for all of the software you need to run Elgg; feel free to fill me in on whether any of it isn't actually necessary since I get the feeling that some of what's listed below is superfluous for this version of Elgg.

The Apache web server

Install the following (even though it's possible that it's not all technically necessary):

$ sudo apt-get install \
    apache2 \
    apache2-doc \
    apache2-utils \
    libapr1 \
    libexpat1 \

After that, edit /etc/apache2/sites-available/default and for the entry for the /var/www directory, set the line:

AllowOverride All

Next, enable a number of Apache modules (not sure all of them are necessary -- certainly, the rewrite module is essential):

$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2enmod include

After which, restart the web server:

$ sudo /etc/init.d/apache2 restart

And that should do it for Apache, at least for now.


Install the following for PHP support (again, let me know if any of this isn't strictly required for ELGG operation, or if I've overlooked any essential PHP packages that should be listed here):

$ sudo apt-get install \
    php5 \
    php5-gd \

That should be sufficient to pull in all of the required PHP packages, but I'm willing to be corrected.


Simply installing the MySQL server package should be enough to pull in all of the necessary MySQL-related packages:

$ sudo apt-get install mysql-server

In addition, once you've set up the appropriate MySQL username and password, you'll need to create a database for ELGG:

mysql> CREATE DATABASE elgg;

Remember the username, password and database name you use here, as you'll need them later.

The Elgg data directory

Finally, you should create a directory for your eventual Elgg data, somewhere other than the Elgg installation directory, and make it world-writable for the moment, as in:

$ sudo mkdir /usr/local/elggdata
$ sudo chmod 777 /usr/local/elggdata

It's entirely possible that you can make that directory a bit more secure, perhaps by making it part of the www-data group and making its octal permissions 775, but this should work for now.

At this point, you should be ready to download, install and configure the Elgg software itself.

Installing Elgg 1.8b1

Now that you've set up all the prerequisites above, we should be able to download, unload and configure Elgg on your Ubuntu system, and we'll try to keep this simple.

First, grab the Elgg zip file from here, and unzip it under the default document root directory /var/www. Once that's done, create a symlink for convenience:

$ cd /var/www
$ sudo ln -s elgg1.8b1 elgg

Next, unless you want to open up that directory to the Apache web server, you can simply make the required copy of the .htaccess file thusly:

$ cd /var/www/elgg
$ sudo cp htaccess_dist .htaccess

Next, the web server will need write access to the Elgg engine/ directory, so you can just open that up:

$ sudo chmod 777 engine

At this point, you're ready to browse to your Elgg installation and finish the configuration.

Browsing and Elgg configuration

As long as all of the above has worked, bring up a browser and browse to http://localhost/elgg to complete your Elgg configuration. Once you're past the Welcome screen, let's work through the rest of the initial configuration one Elgg step at a time.

Requirements check

If you've made it this far and followed all of the instructions, all of the requirements checking should pass. If it doesn't, you did something wrong so ... fix it.

Database installation

Based on the information you recorded earlier, fill in the appropriate values to set up your MySQL database.

Configure site

This screen is reasonably self-explanatory, except it seems that I can't just use "localhost" for the Site URL -- it looks like I need to hardcode the IP address, as in in my case. I'm open to suggestions here.

Create admin account

Again, self-explanatory. And at that point, you should have a working Elgg installation on your Ubuntu system.

So ... now what?

Now I start experimenting with how this utility works. If you have suggestions or corrections, email me at rpjday@crashcourse.ca. In particular, I'm interested in improvements to the recipe above, especially related to steps that don't need to be there. More coming soon ...

Personal tools