LinuxTutorialsUbuntu

How To Install Elgg on Ubuntu 14.04

Install Elgg on Ubuntu 14.04

In this tutorial, we will show you how to install Elgg on Ubuntu 14.04. For those of you who didn’t know, Elgg is an open-source and powerful social networking engine used to create your own social networking website. It is a PHP-based application and can easily be installed on a Linux VPS.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Elgg on Ubuntu 14.04 LTS.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 14.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Elgg on Ubuntu 14.04

Step 1. First of all, make sure that all packages are up to date.

apt-get update
apt-get upgrade

Step 2. Install LAMP (Apache, PHP, and MySQL) on Ubuntu 14.04

apt-get install mysql-client mysql-server apache2 php5 php5-mysql php5-gd php5-imap php5-ldap php5-odbc php-pear php-xml-parser php5-xmlrpc chkconfig wget unzip

Start LAMP service, enable to start on boot:

/etc/init.d/apache2 start
/etc/init.d/mysql start

Step 3. Configuring MySQL for Elgg.

By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL:

mysql_secure_installation

Next, we will need to log in to the MySQL console and create a database for the Elgg. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MySQL root password and hit Enter. Once you are logged in to your database server you need to create a database for Elgg installation:

create database elggdb;
grant all on elggdb.* to elgguser@localhost identified by 'your-passwd';
flush privileges;

Step 4. Configuring Apache webserver.

Create a new Apache virtual host for Elgg:

nano /etc/apache2/sites_available/default

Change “AllowOverride None” to “AllowOverride All”:

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All 
                Order allow,deny
                allow from all
</Directory>

Turn on the Apache “rewrite” module by running the following command:

a2enmod rewrite

Restart your Apache service for the changes to take effect:

/etc/init.d/apache2 restart

Step 5. Install Elgg.

Download the latest stable version of Elgg, At the moment of writing this article it is version 1.11.1:

wget https://www.elgg.org/getelgg.php?forward=elgg-1.11.1.zip
unzip elgg-1.11.1.zip

Move the Elgg installation files and directories:

mv elgg-1.8.11 /var/www/elgg
cd /var/www/elgg

Move to the engine directory and cp the settings example file to settings.php:

cd engine/
cp settings.example.php settings.php

Open the settings.php file in your favorite editor:

### nano settings.php
/**
* The database username
*
* @global string $CONFIG->dbuser
* @name $CONFIG->dbuser
*/
$CONFIG->dbuser = 'elgguser';

/**
* The database password
*
* @global string $CONFIG->dbpass
*/
$CONFIG->dbpass = 'elgg@123';

/**
* The database name
*
* @global string $CONFIG->dbname
*/
$CONFIG->dbname = 'elggdb';

/**
* The database host.
*
* For most installations, this is 'localhost'
*
* @global string $CONFIG->dbhost
*/
$CONFIG->dbhost = 'localhost';

/**
/**
* The database username
*
* @global string $CONFIG->dbuser
* @name $CONFIG->dbuser
*/
$CONFIG->dbuser = 'elgguser';

/**
* The database password
*
* @global string $CONFIG->dbpass
*/
$CONFIG->dbpass = 'elgg@123';

/**
* The database name
*
* @global string $CONFIG->dbname
*/
$CONFIG->dbname = 'elggdb';

/**
* The database prefix
*
* This prefix will be appended to all Elgg tables. If you're sharing
* a database with other applications, use a database prefix to namespace tables
* in order to avoid table name collisions.
*
* @global string $CONFIG->dbprefix
*/
$CONFIG->dbprefix = 'elgg_';

Create the upload directory and change its permission:

mkdir /upload
chmod 777 /upload

Step 6. Accessing Elgg.

Elgg will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://your-domain.com/install.php or http://server-ip-address/install.php and complete the required steps to finish the installation. Make sure the webserver has permission to write to and create directories in /var/www/html/elgg/. If you are using a firewall, please open port 80 to enable access to the control panel.

Install Elgg on Ubuntu 14.04

Congratulations! You have successfully installed Elgg. Thanks for using this tutorial for installing Elgg social networking engine on Ubuntu 14.04 system. For additional help or useful information, we recommend you check the official Elgg website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button