An outstanding PHP engine, Elgg, can be utilized for operating your own well-developed social network. Great community support is provided through themes and plugins developed by user community and the official developers.
- Ubuntu 12.04 or Debian 7
- Apache (with rewrite module)
- MySQL 5+
- PHP 5.2+ (few modules are needed for supporting some features)
A good idea would be to perform total update of the system before starting anything else.
apt-get update apt-get upgrade
Installing web and database server
mysql and apache can be installed by doing
apt-get install apache2 mysql-server
During the installation of mysql-server, you need to input a password for the root user. Utilize a robust password and note it down somewhere as you will utilize it for creating a user and a database later for Elgg.
After installation of apache, Elgg requires the rewrite module which can be enabled by the command below:
The default configuration of apache ignores
.htaccess files in the “document root” (
/var/www by default). However it is needed for url rewriting in Elgg to operate.
Next the apache configuration needs to be changed by opening it in any editor, like vim or nano.
In the above file, replace
AllowOverride None with
AllowOverride All in the
Directory section that’s defined for
On editing and saving the configuration file, restart the apache server:
service apache2 restart
Creating MySQL user and database
Rather than utilizing root for the purpose of Elgg, a good idea would be to develop a new database user. You can get into MySQL command line by operating the command below:
mysql -u root -p
The queries given below need to be executed for creating a new database, an Elgg user, and for granting the database access for this user.
CREATE DATABASE elgg; CREATE USER elgguser IDENTIFIED BY 'elggpassword'; GRANT ALL ON elgg.* TO elgguser;
The command given below deploys PHP along with few other modules required byElgg for proper functioning of some features.
apt-get install php5 php5-gd php-xml-parser php5-mysql unzip
You need to go to root directory of your your webserver and download the source code ofElgg.
cd /var/www/ wget http://elgg.org/getelgg.php?forward=elgg-1.8.18.zip -O elgg.zip
Now elgg.zip needs to be unzipped and removed and the folder enclosing the code should be unwrapped.
unzip elgg.zip && rm elgg.zip mv elgg-1.8.18/* . && rmdir elgg-1.8.18
Configuring Elgg for Install
Setting up data directory
Elgg utilizes a data directory for storingsystem generated and user uploaded data. A folder needs to be created outside the root directory of the webserver and it needs to be made writeable by the webserver.
mkdir <span style='color: red'>/var/elggdata</span> chown -R www-data:www-data /var/elggdata
www-data is user of apache that performs writing to file system. The command given above provides data directory’s apache ownership.
.htaccess and settings.php
.htaccess file and the
settings.php files need to be moved to their places.
mv /var/www/htaccess_dist /var/www/.htaccess mv /var/www/engine/settings.example.php /var/www/engine/settings.php
Open up the
settings.php file and complete the access details of the database.
In the file, ensure that right values are set to the variables given below.
$CONFIG->dbuser = 'elgguser'; $CONFIG->dbpass = 'elggpassword'; $CONFIG->dbname = 'elgg'; $CONFIG->dbhost = 'localhost'; $CONFIG->dbprefix = ''; // or anything else you like
Installation will be quite easy if you follow all the steps provided in this guide. Open the browser and move on to your IP address (‘18.104.22.168’, etc.) or
/install.php of your website(‘example.com’, etc.)
http://example.com/install.php or http://22.214.171.124/install.php
This is it! You will be able to see the installation page alongwith instructions pertaining todifferent steps that are involved in this process. Elgg will be creating the database and will be asking for some details specific to the site and it will also create the admin user for you in the steps that follow.
There is great community support with Elgg. In case you get stuck anywhere just go to the community site. A number of people are there who will be ready to provide you with everything you need.