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.


In Laos

Well, it’s been some time since the last time I wrote, so I thing it’s time to summarize what I’ve been doing since the last post. After the problems in Thailand I got to Cambodia two days later than planned. I arrived to Siem Reap the night of the 19th, and I stayed there 5 days with my friend Kiara, who is doing voluntary work there at an orphanage. I really liked the city, and the temples at Angkor are really amazing.

After that I spent one day in Phnom Penh, the capital of Cambodia, from where I took a flight to Laos. I stayed a couple of days in Viantiane, and afterwards I came to Luang Prabang in a looong bus ride. I’ve been already almost a week, resting and relaxing more than doing any “profitable” thing, but I really felt like chilling out for a few days after all the travelling around of the previous weeks.

The city is very quiet and not very big, but there are many things to do here, and the hostel where I’ve been staying -SpicyLaos- is really nice and there is a very good atmosphere. I have to decide tonight what I’m going to do the following days, whether staying here until Saturday or starting to get closer back to Vientiane stopping somewhere along the way. In any case I want to be on Sunday at Vientiane, and next Tuesday I’m taking another flight from there to Ho Chi Minh, in the south of Vietnam.

I have only ten days left of my trip, so I want to make the most of the rest of it (no more lazy days :p). Lets see how everything goes…

That’s all, you can see the photos I’ve uploaded so far in my flikr account.


Problems in Thailand

First of all I want to calm down some people that has written me, the situation in general here in Thailand is of normality, apart from the fact that the two airports of Bangkok have been taken over by the government opponents. The terrorists attacks with hundreds of victims that are on the news have happened in India, here there have been some incidents with the demonstrators but nothing so bad.

Anyway many flights have been canceled, including the one that was supposed to take me yesterday to Siem Reap (Cambodia) from Chiang Mai, where I am now. It was a direct flight, so it didn’t have to stop in Bangkok, but it seems that the plane is “trapped” in Bangkok, or at least that’s what I’ve understood from the explanations they’ve given me.

All this has forced me to change a little bit my trip plans. Yesterday I took a night bus to Bangkok, where I am now, and I’ll spend here one day and tomorrow (Saturday) I’ll continue to Siem Reap with another bus. I will lose almost two days with this change, but at least I’ll try to do a couple of things in Bangkok that I couldn’t do last week, specially visiting the royal palace.

That’s all, this is just a little annoying but nothing to worry about, at least so far. The people here seems to be more tired than worried about the situation, and there seem to be no reason to be alarmed. I’ll inform you if there is any further change to the situation.


Asia 2008 - Day 5 - Tokyo

After the night flight from Kuala Lumpur and passing the usual controls of passport and luggage (taking out all my dirty clothes from my backpack is something I had to do everytime I travelled outside Japan during the year I lived there), I took the train to Ueno. I arrived there around 9am, and it was too early for checking-in at the hostel, so I left my backpack in a locker and went to visit the area.

2008-11-03-Tokyo-008.jpg 2008-11-03-Tokyo-026.jpg
The Ueno park central lake Pagoda

Just after entering the park, and while I bought a coffee from an automatic machine, a Japanese beggar came to me and had me talking for about hour telling me (with a quite limited English) about his opinions of Japan and how (according to him) Japan should open more to the western world, and also how i should start talking with every Japanese girl I saw…

2008-11-03-Tokyo-035.jpg 2008-11-03-Tokyo-053.jpg
Lanterns at the entrance to a temple “Doris” (traditional doors) at the entrance to a temple

Once finished the discussion I started walking around the Ueno area, and visiting the temples and monuments of the surroundings. Around noon I started looking for a place to eat, and finally I decided for a small curry restaurant… one of the things that I had missed the most was the japanese curry-rice, and it was as good as I remembered :p

2008-11-03-Tokyo-059.jpg 2008-11-03-Tokyo-074.jpg
Walking around Ueno

After lunch I went to the hostel, and after the check-in I went directly to bed to recover some lost sleep. After the siesta I went to Shibuya to have a look and have dinner there. Almost everything was as I remembered, apart from the small Indian restaurant where we used to go quite often, that had disappeared along with the rest of the building, so I had some ramen at another place I used to go, and then had a beer at the “200 yen place” (although now it was 300).

2008-11-03-Tokyo-086.jpg 2008-11-03-Tokyo-100.jpg
The Hachiko statue, a frequent meeting point One of Shibuya’s main streets
2008-11-03-Tokyo-090.jpg 2008-11-03-Tokyo-103.jpg
Shibuya crossing Walking around

More pics in my flickr set: 2008-AsiaTrip-03-Tokyo .