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 web site. 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 through the step by step installation Elgg on a Ubuntu 14.04 LTS.
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:
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 'elgg@123'; flush privileges;
Step 4. Configuring Apache webserver.
Create a new Apache virtual host for Elgg:
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:
Restart your Apache service for the changes to take effect:
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 favourite 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 favourite browser and navigate to http://yourdomain.com/install.php or http://server-ip/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.
Congratulations! You have successfully installed Elgg. Thanks for using this tutorial for installing Elgg social networking engine on Ubuntu 14.04 system.