In this guide I will explain in details the installation of Elgg (v1.8.3) locally under a system running Ubuntu. The installation here is done under Ubuntu 11.10 Oneiric Ocelot, but can be also followed on other versions of Ubuntu like Ubuntu 12.04/11.04/10.10, etc. If you haven't already installed the LAMP web server under Ubuntu, then do by following the instructions given in this tutorial: LAMP Installation.1. Creating MySQL Database Details
Login to your MySQL server with this command (use MySQL root password set during the installation of LAMP):
mysql -u root -p
Then run this sequence of commands:
create database elgg;
CREATE USER 'elgg'@'localhost' IDENTIFIED BY '12345';
GRANT ALL PRIVILEGES ON elgg.* TO 'elgg' IDENTIFIED BY '12345';
exit
These commands will create the follwoing MySQL database details:
- MySQL user: elgg
- Database name: elgg
- MySQL user password: 12345 ---> Replace it to whatever you want
These commands will download and install Elgg files in the /var/www/elgg/ directory:
cd /tmp && wget -O elgg-1.8.3.zip goo.gl/54qdI
sudo unzip elgg-1.8.3.zip -d /var/www
sudo mv /var/www/elgg-1.8.3/ /var/www/elgg/
sudo chown -R www-data:www-data /var/www/elgg
You will need to create now a folder called "data" in your home directory for Elgg to save files in with these commands (folder name can be renamed to whatever you want):
mkdir ~/data
chmod a+rw ~/data
Edit now the "ElggRewriteTester.php" file with this command:
gksudo gedit /var/www/elgg/install/ElggRewriteTester.php
Then change this line (line 73) from TRUE to FALSE :
$this->serverSupportsRemoteRead = TRUE
To
$this->serverSupportsRemoteRead = FALSE
Save your file and exit. This modification will allow you to get rid of this error when checking for server requirements later during the installation:
“We think your server is running the Apache web server. The rewrite test failed and the most likely cause is that AllowOverride is not set to All for Elgg’s directory. This prevents Apache from processing the .htaccess file which contains the rewrite rules. A less likely cause is Apache is configured with an alias for your Elgg directory and you need to set the RewriteBase in your .htaccess. There are further instructions in the .htaccess file in your Elgg directory.”
Also to avoid the "404" error when opening Elgg pages, you need to do these modifications:
- Via then terminal, run this command:
sudo a2enmod rewrite
- Edit now this file with this command:
gksudo gedit /etc/apache2/sites-enabled/000-default
And replace every line that says:
AllowOverride None
to
AllowOverride All
- Press CTRL+Q and save your file, then restart Apache with this command:
sudo /etc/init.d/apache2 restart
To start the installation of Elgg, open now this link:
http://localhost/elgg/
Then follow setup instructions. At the database page, provide the MySQL settings we created above:
Then in the "Configure site" page, enter the full path to the "data" directory where Elgg will save files into (under "Data Directory"). For this installation, the path will be as follows:
/home/username/data
Replace username with your own Ubuntu account username. If you have chosen another directory (not "data"), then put the full path to this new directory. When you finish the installation, Elgg will be accessed via this link:
http://localhost/elgg/
or
http://127.0.0.1/elgg/





