Installing Elgg

Requirements
For Elgg, you need:

  • Apache2 web server
  • PHP 5.2+
  • MySQL 5+

Download Elgg

  • Download latest stable version from http://www.elgg.org/download.php
  • $ unzip elgg-1.x
  • make sure the unzipped directory is inside webroot or accessible by Apache

Setting permissions to Elgg installation
create .htaccess file

$ cd elgg-1.x
$ cp htaccess_dist .htaccess

Make the .htaccess file writable by Apache or simply do chmod 777 .htacess and remove write permissions after the installation is complete.

Open .htaccess file for editing. Make sure RewriteEngine is set to on. If elgg directory is located at ~/username, then set RewriteBase as follows:

RewriteEngine on
RewriteBase /~username/

If the elgg directory is located in the webroot, such as, /var/www/elgg177 in Ubuntu, set it as follows:

RewriteEngine on
#RewriteBase /

Yes. You comment out RewriteBase since you are already in the webroot.

Next, copy settings file

$ cp engine/settings.example.php engine/settings.php

Make this file apache writable. Then edit the file settings.php to set $CONFIG->url. If elgg is located at ~/username/elgg then set it like the first option below. If it is located in a folder called elgg under the webroot, set it like the second option below:

$CONFIG->url = "http://someserver.com/~username/";
$CONFIG->url = "http://localhost";

Create database for Elgg
Create a database:

$ mysql -u root -p
mysql> create database elgg;
mysql> create user elgg_user identified by 'pass';
mysql> grant all on elgg.* to 'elgg_user'@'localhost';

Replace the word pass with your password. We created a database, a user, and and granted full access to the elgg database to this user.

Create data folder
Create a data directory outside the elgg installation and make it Apache writable.

Install from browser
Navigate to the elgg directory with your browser. If your webroot is /var/www and elgg is located at /var/www/elgg, then type http://localhost/elgg. Fill out the information in the html forms and you are good to go. If you see any error messages, see the troubleshooting sections.