Installing Elgg in Windows with Xampp

Introduction

In the previous post I wrote a short introduction to Elgg, an open source social network engine. Elgg is initially meant for installing in a LAMP environment, but it is also possible to install it in Windows, although this is not recommended for production servers. In this post I’ll explain how to install a web server with Elgg in Windows.

Requirements

Elgg requires an Apache web server with the mod_rewrite plugin and PHP5 installed, and a MySql database. The PHP also must have a few libraries (GD, JSON, XML and Multibyte String support). The easiest way to install all this at once in windows is to use one of the existent software packages, like EasyPHP or Xampp.

It had been a few years since the last time I installed Xampp, and the official Elgg documentation already includes some basic instructions for installing EasyPHP, so in this tutorial we’ll use Xampp. The first step is obviously downloading the latest versions of Xampp and Elgg.

Installing Xampp

There are two Xampp versions, as an exe file or as a zip. For the sake of simplicity we’ll install the executable version. Launching it we’ll see this:


Xampp-Instalation

After selecting the path were we want to install the software (a new subdirectory “xampp” will be created), we can start the installation. When all files are copied we will be asked a few questions in order to configure the system. The easiest thing is to leave all the default values, that should be the best for most people.

Once that’s finished, we’ll start the Xampp Control Panel:


Xampp-ControlPanel

Start the Apache server and MySql and “voilà”, we have a web server and database running in our system. Once both are started we can access to the Admin pages of Xampp and MySql. I’d recomend you to enter right now in the Apache Admin and make a couple of recommended security changes explained in the “Security” section.


Xampp-Management

Configuring Xampp for Elgg

To make sure that Elgg works well we’ll have to modify the PHP configuration. Edit the “path_to_xampp/php/php.ini” and look for this line: “;extension=php_curl.dll”. Delete the “;” and save the file.

After that, uncompress the zip that contains the Elgg code in the directory we want. Now we have to tell Apache where the code is, and for that we’ll open the file “…/xampp/apache/conf/httpd.conf” with the editor.

We have two options for the configuration: install Elgg at the root of our web server (so we would access it directly with http://localhost/) or installing it in a subdirectory (for example http://localhost/elgg/). In this tutorial I’ll explain the second option.

Elgg in a subdirectory

In the httpd.conf file we look for the following line: (the xxx depends on where you installed xampp):

DocumentRoot "xxx/xampp/htdocs"

Under this line we add:

Alias /elgg/ "path_to_elgg_directory/"

Where i wrote “elgg” you can put whatever you want, and you will be able to access your Elgg installation via “http://localhost/what_you_wrote/”.

Once that line is added, look for the following:

<Directory "xxx/xampp/htdocs/">
...
</Directory>

Under that you should add (it’s important that the path ends with “/”):

<Directory "path_to_elgg_directory/">
Options FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Later we’ll have to make a small change in one of Elgg files in order to tell it in which address it is installed. I’ll tell you later about that.

Database configuration

After the last step, you should be able to see the first Elgg configuration page in your browser at the url http://localhost/elgg/ (or whatever address you chose):


Elgg-InstalationStart

In this page we have to write the credentials for our MySql database, and Elgg will configure it. For this we have to create a MySql user and a new repository, and for that we’ll use the configuration tool included with Xampp. You can access it in your browser (http://localhost/phpmyadmin/ ) or clicking the MySql Admin button in the Xampp Control Panel. We’ll see this:


MySQLCreateDB

After writing the name of the database we want, click “Create” and we’ll have our new empty MySql repository. Next we have to create our new database user for Elgg (it is recommended not to use the “root” user for Elgg). In the “Privileges” tab, select the option for adding a new user and fill out the data.


MySQL-CreateUserAndDB

Now we have to give our user the privileges for using the repository we created. Search for the box “Database specific privileges”, write the name of the repository and press “Go”. We’ll access a form where we can select the privileges for our user. The easiest is just pressing “Check All” and again “Go” and we’ll have our user and repository ready.


MySQLGrantPrivileges

Now we just have to give Elgg the database parameters. Go back to the Elgg page and fill out the form.

Configurando Elgg

Once we have saved the previous form, we’ll see another Elgg configuration page:


Elgg-Configuration

Wait a moment before starting writing, first we have to make the small change I told you about before, or Elgg will not be able to recognize where it is installed in the web server. We edit the file “path_to_elgg/.htaccess” and look for the line:

#RewriteBase /

Change the line to (write the same you wrote in the Alias in the httpd.conf file before):

RewriteBase /elgg/

Now we can write the configuration data for our Elgg installation. Be sure to put the right values for your installation and save it. Ah, I forgot, you should have created a directory to store the temporary and user files for Elgg (”C:/Work/elgg/data/” in the example), and this directory should be outside the directory where you put the Elgg files (in my case “C:/Work/elgg/www/”).

If everything goes right, next we will see the form for creating our first Elgg administration user. Once done this, you’ll finally see the Elgg welcome page.


Elgg-FirstScreen

I hope this guide has been useful for you. You can find more information about the installation and troubleshooting in the Elgg official documentation, and in case you have any doubts write me a comment and I’ll try to answer it.


Elgg: Social networks for everyone




Official Elgg Website

Introduction

I’ve been playing the last few months with Elgg, an open-source social network engine that allows you to easily create your own social network. In this post I’ll try to give a general description of Elgg.

Elgg itself is just an engine for a plugin system, and these plugins provide the real social network functionalities. Downloading Elgg we find some default plugins that implement most of the basic functionalities expected of any social network (user profiles, blog, state messages, friends, etc.), but Elgg also has an active user community that has already developed hundreds of plugins providing a wide range of additional functionalities (photo albums, chat, etc.).

All these is also developed in a way that makes it easy to add or extend/modify existing plugins with just a few basic notions of programming. In future posts I’ll talk about the internal structure of Elgg and explain how to develop new plugins for it.


Elgg- Dashboard
Basic Elgg entrance page

Technology

Elgg is based in the classic LAMP (Linux, Apache, MySql, PHP), so if we want to create or own social network we just need a linux server with there elements installed. It is also possible to install it under Windows, but it is recommended just for testing or development. Soon I’ll write a short guide explaining how to install it in Windows.

For development only PHP is needed, all the database queries are done calling a few methods provided by the Elgg engine. The only problem is that the documentation is not very good, but that’s something the development team is working trying to improve.

Of course the default Elgg interface is quite simple, but it is very easy to customize it to our taste with a minimal knowledge of CSS, and there are already many plugins that improve the default style and can be used as a starting point for our personal modifications.


Elgg - MyProfile
Default user profile

Current state

One thing that we can say against Elgg is that most of the plugins developed so far are a bit “basic” and lack cohesion between eachother. This anyway is improving quickly and with little work we can create very attractive and feature-rich sites with just a fraction of the work that would be needed to develop them from scratch.

The plugins developed by the community are reaching a high level of maturity and quality, sometimes even providing functionalities not existing in other well-known social networks. As the community grows and Elgg itself improves, more interesting and advanced plugins will surely be developed.

About the development of Elgg itself, version 1.7 is currently planned for the end of November. This version will mainly be an internal improvement of the internal engine and the basic plugins stability, intended to solve bugs and clean up and standardize the code, which should at the same time make it easier to develop new plugins.




Community plugins list

Conclusion

Elgg is without doubt a very interesting project and shows the potential of open source development. With a big user community contributing with new plugins and functionalities, it is to expect that it will soon reach an even higher level of maturity and quality.