Install Elgg to create your own social network site on CentOS, RHEL, Fedora, Debian, Ubuntu

Overview

Elgg is a social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications. Source elgg.org

Install Elgg to create your own social network site on CentOS, RHEL, Fedora, Debian, Ubuntu

On CentOS, RHEL, Fedora


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

On Debian, Ubuntu


# 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

On CentOS, RHEL


# /etc/init.d/httpd start
# /etc/init.d/mysqld start
# chkconfig httpd on
# chkconfig mysqld on

On Debian, Ubuntu


# /etc/init.d/apache2 start
# /etc/init.d/mysqld start
# chkconfig httpd on
# chkconfig mysqld on

Set the root password for mysql and login to create database and a user for elgg


# /usr/bin/mysqladmin -u root password 'root@123'
# mysql -uroot -proot@123

mysql> create database elggdb;
mysql> grant all on elggdb.* to elgguser@localhost identified by 'elgg@123';
mysql> flush privileges;

Download the latest elgg zip file


# wget http://elgg.org/getelgg.php?forward=elgg-1.8.11.zip
# unzip elgg-1.8.11.zip

Move the elgg dir to document root of the web server
On CentOS, RHEL


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

On Debian, Ubuntu


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

Move to 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


# vi settings.php

Enter the database name, user and password we created above.


/**
* 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

Open the web browser and point it to

http://ipaddress-or-domainname/elgg

elgg01 300x176 Install Elgg to create your own social network site on CentOS, RHEL, Fedora, Debian, Ubuntu

If the requirements check fail with the error below

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

Open the .htaccess file, if the file is not present then copy it from htaccess_dist present in the elgg directory


# cd /var/www/html/elgg
# cp htaccess_dist .htaccess
# vi .htaccess

Uncomment Line 94 and set it as


RewriteBase /elgg/

Open apache conf file


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

Line 338 set AllowOverride from None to All


AllowOverride All

If the error continue to show up perform these additional steps


# vi elgg/install/ElggRewriteTester.php

change Line 73 from TRUE to FALSE


$this->serverSupportsRemoteRead = FALSE

elgg02 300x176 Install Elgg to create your own social network site on CentOS, RHEL, Fedora, Debian, Ubuntu

elgg04 300x176 Install Elgg to create your own social network site on CentOS, RHEL, Fedora, Debian, Ubuntu