Install Elgg to Create Own Online Social Networking Site

These days social networking sites have become more powerful for interacting people to people. It has been estimated that more than 80% of students rely on such kind of social networking sites in their daily communication such as surfing online, social activities, discussion etc. In most of the university social networks are considered as a communication method among teachers and students. Social networks improves performance of the students. A wide range of educational institutions have started using open source network application “Elgg“.

Elgg is an open source social network web application that build all kind of social environment from business to education. Create and manage your own social networking site with this open source tool. It runs on LAMP (Linux, Apache, MySQL, PHP) platform. It offers file sharing, blogging, social networking and groups. It provided you with a personal web blog, online profile, RSS reader, file repository. In addition all user content can be tagged with keywords. This way you can connect to people with same interest and can create a personal learning network. However Elgg is different from other social network, each profile item, uploaded file etc, can be assign to its own restrictions. It is integrated with Drupal, Webct, Mediawiki and Moodle and it also supports most of the open standards along with RSS, LDAP for authentication and XML-RPC for integrating most of the third party web blogging clients. Its very easy to create and manage your own web blog with full customization.

Requirements of Elgg

  1. Elgg runs on dedicated LAMP based server. Usually needs Apache, MySQL, PHP scripting language.
  2. Apache mod_rewrite module Multibyte String support for internationalization.
  3. GD for graphics processing.
  4. JSON (included in PHP 5.2+).
  5. XML

Elgg Features

Elgg is packed with bundle of features that you wish to have in your networking website. Here’s a full feature list:

  1. Elgg allows you to integrate with other web based tools like wikis and blog.
  2. It offers a large number of links between blog and community or users. That can be used to examine the actives and system of users once it finds exact start point.
  3. Elgg helps you to manage user and fulfill their requirement.
  4. It gives you a powerful data model which can make the creation simple and flexible.
  5. With the help of granular activity stream API your plugins pushes the required content to all your users.
  6. API plugin allows you to build and add required features like create video, edit, add title, tags descriptions of a video.
  7. In Elgg you can find files repositories for communities as well as individual.

However it is highly recommended to increase PHP memory limit to 128MB or 256MB, and increase upload file size to 10MB. By default, these settings are already added in the .htaccess file in the Elgg directory.

This article shows a depth instructions on how to install and setup Elgg on RHEL, CentOS, Fedora, Scientific Linux and Ubuntu, Linux Mint and Debian systems.

Installing Elgg

To install Elgg, you must have Apache, MySQL and PHP installed on your system. If not, install them using the following command as shown below.

On RHEL/CentOS/Fedora/Scientific Linux

# yum install mysql mysql-server httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc wget unzip

Turn on Apache “mod_rewrite” module. Open the following file.

# vi /etc/httpd/conf/httpd.conf

Change “AllowOverride None” to “AllowOverride All“.

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

Finally, restart Apache and MySQL service.

# /etc/init.d/httpd restart
# /etc/init.d/mysqld restart

On Debian/Ubuntu/Linux

# apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-mysql wget unzip

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

# a2enmod rewrite

Once you’ve Turn on “rewrite” module, now enable it for “.htaccess” processing. Open the following file with your choice of editor.

# vi /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>

Finally, restart Apache and Mysql service.

# /etc/init.d/apache2 restart
# /etc/init.d/mysql restart

Creating Elgg MySQL Database

Login to your MySQL server with root password.

# mysql -u root -p

Once you in MySQL shell, create “elgg” database as shown.

mysql> create database elgg;

Create a “elgg” user for MySQL and set password.

mysql> CREATE USER 'elgg'@'localhost' IDENTIFIED BY 'abc';

Grant “All” privileges on “elgg” database to “elgg” user and exit.

mysql> GRANT ALL PRIVILEGES ON elgg.* TO 'elgg' IDENTIFIED BY 'abc';
mysql> flush privileges;
mysql> exit;

Downloading and Installing Elgg

Elgg 1.8.15 is the latest recommended version, download it using wget command and extract it.

# wget http://elgg.org/download/elgg-1.8.15.zip
# unzip elgg-1.8.15.zip

Next, move “elgg” directory to your web server document root directory. For example, “/var/www/html/elgg” (For Red Hat distro’s) and “/var/www/elgg” (For Debian distro’s).

# mv elgg-1.8.15 /var/www/html/elgg
OR
# mv elgg-1.8.15 /var/www/elgg

Go to “elgg” directory and then “engine” directory.

# cd /var/www/html/elgg
# cd engine
OR
# cd /var/www/elgg
# cd engine

Copy “settings.example.php” to “settings.php“.

cp settings.example.php settings.php

Open the settings.php file with your choice of editor.

# vi settings.php

Enter the dbuser, dbpass, dbname, dbhost and dbprefix parameters as shown below.

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

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

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

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

/**
 * 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_';

Elgg needs a different directory called “data” to keep uploaded photos and profile icons. So, you need to create this directory outside of your web document root directory for security reason.

# mkdir data
# chmod 777 data

Finally, Open the web browser and navigate to “http://localhost/elgg/install“. Follow the installation wizard instructions as shown below.

Elgg Installation
Elgg Welcome Wizard
Elgg Requirements
Elgg Requirements Check
Elgg Configuration
Elgg Configuration Settings
Elgg Create Admin Account
Elgg Create Admin Account
Elgg Finished Installation
Elgg Finished Installation
Elgg Admin Control Panel
Elgg Admin Control Panel
Elgg Front End
Elgg Front End

Reference Link

Elgg Homepage

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

16 Comments

Leave a Reply
  1. I have already made an social networking site using elgg from xampp on windows 7. Now how to upload it? Please help me.

    Reply
  2. Hi there, First I am not a coder, never tried. So I thought I can try Elgg. I am trying to install elgg on XAMPP, I have Mac. I am receiving some Exception error. I tried MAMP and i receive same error I think its related to Mac permission somewhere. Can anyone please suggest me what to do? I am very upset because I am very new to all this.

    Many thanks in advance.

    Reply
    • @Sonu,

      I don’t think these instructions works on XAMPP with Mac OS, better try on Linux systems, or search for XAMPP related elgg documentation at their official site..

      Reply
  3. Please I need your help. I’m new to elgg and I’m trying to install version 1.21. I have tried several things and yet it does not pass the rewrite test. I’ve looked up the installation guide on elgg but it has not helped too. I’m using a Macbook and running xampp. Thanks

    Reply
  4. I’m getting this error after all the steps.

    Fatal Error.

    An unrecoverable error has occurred and has been logged. Contact the site administrator with the following information:

    Exception #1398146272

    Reply
  5. Hi,

    I tried to install elgg, in a subfolder of my website. I named the subfolder as “ncc” and have extracted all the files from the folder elgg to my subfolder “ncc”.

    When I try to install by going to my url ncc.yourgoal.in/install.php I get an error as mentioned below.

    “Web server
    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.”

    I have checked the .htaccess file but couldn’t understand what I have to do there. Please help me on how to install elgg

    Reply
    • In Apache httpd.conf file, change “AllowOverride None” to “AllowOverride All” and restart Apache service, it will fix this issue.

      Reply
  6. Great post! I folloed it step by step and it worked perfectly.

    Just one thing you also have to install php mbstring

    sudo yum install php-mbstring

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.