Book Image

Elgg Social Networking

By : Mayank Sharma
Book Image

Elgg Social Networking

By: Mayank Sharma

Overview of this book

<p>Elgg is an open-source social web application licensed under GPL version 2, and runs on the LAMP (Linux, Apache, MySQL, and PHP) or WAMP (Windows, Apache, MySQL, PHP) platform. It offers a networking platform combining elements of blogging, e-portfolios, news feed aggregation, file sharing, and social networking. Elgg has its own plug-in architecture, and can use plug-ins to provide a calendar and a wiki. It supports a number of open standards including RSS, LDAP for authentication, FOAF, and XML-RPC for integration with most third-party blogging clients. It can be integrated with MediaWiki, Moodle, Drupal, and WebCT.<br /><br />Elgg provides each user with a personal weblog, file repository (with podcasting capabilities), an online profile, and an RSS reader. Additionally, all of a user's content can be tagged with keywords&acirc;&euro;&rdquo;so they can connect with other users with similar interests and create their own personal learning network. However, where Elgg differs from a regular weblog or a commercial social network (such as MySpace) is the degree of control each user is given over who can access their content. Each profile item, blog post, or uploaded file can be assigned its own access restrictions&acirc;&euro;&rdquo;from fully public to readable only by a particular group or individual.<br /><br />Using Elgg is the easiest way to create your own fully customized, hosted social network for your business, organization, or group of friends. Elgg communities can include blogs, discussion groups, media galleries, friends' lists, and much more. Because it's open source, and has many plug-ins, Elgg can be extended in unlimited ways. Elgg lets you host your own Facebook-style social network and retain complete control over how it works. This book shows you all you need to know to create safe, fun social networks.<br />&nbsp;<br />While anybody can use Elgg to create their social network, it is especially useful in education as it has many features making it suitable for e-learning, including groups, communities, and blogs that can be used for online classes where students can communicate in a new way with each other and with students around the world&acirc;&euro;&rdquo;in a managed, protected environment, creating what its authors term a "personal learning landscape". This book also covers using Elgg in teaching/learning.</p>
Table of Contents (14 chapters)
Elgg Social Networking
Credits
About the Author
About the Reviewer
Preface

Installing Elgg


Now that we have a platform ready for Elgg, let's move on to the most important step of setting up Elgg. Download the latest version of Elgg from its website. At the time of writing this book, the latest version of Elgg was Elgg-0.8. Elgg is distributed as a zipped file.

To uncompress under Linux: Move this zipped file to /tmp and uncompress it with the following command:

$ unzip /tmp/elgg-0.8.zip

To uncompress under Windows: Right-click on the ZIP file and select the Extract here option.

After uncompressing the ZIP file, you should have a directory called elgg-<version-number>, in my case, elgg-0.8/. This directory contains several sub-directories and files. The INSTALL file contains detailed installation instructions. The first step is to move this uncompressed directory to your web server.

Note

You can set up Elgg on your local web server that sits on the Internet or on a paid web server in a data center anywhere on the planet. The only difference between the two setups is that if you don't have access to the local web server, you'll have to contact the web service provider and ask him about the transfer options available to you. Most probably, you'll have FTP access to your web server, and you'll have to use one of the dozens of FTP clients, available for free, to transfer Elgg's files from your computer to the remote web server. Optionally, if you have "shell" access on the web server, you might want to save time by transferring just the zipped file and unzipping it on the web server itself. Contact your web server provider for this information.

The webserver's directory where you need to copy the contents of the Elgg directory depends upon your Apache installation and operating system. In Ubuntu Linux, the default web server directory is /var/www/. In Windows, WAMP5 asks where it should create this directory during installation. By default, it's the www directory and is created within the directory you installed WAMP5 under.

Note

Another important decision you need to make while installing Elgg is how do you want your users to access your network. If you're setting up the network to be part of your existing web infrastructure, you'll need to install Elgg inside a directory. If, on the other hand, you are setting up a new site just for the Elgg-powered social network, copy the contents of the Elgg directory inside the www directory itself and not within a sub-directory.

Once you have the Elgg directory within your web server's www directory, it's time to set things in motion. Start by renaming the config-dist.php file to config.php and the htaccess-dist to .htaccess. Simply right-click on the file and give it a new name or use the mv command in this format:

$ mv <original-file-name> <new-file-name>

Note

To rename htacces-dist to .htaccess in Windows, you'll have to open the htaccess-dist file in notepad and then go to File | Save As and specify the name as .htaccess with the quotes.

Editing config.php

Believe it or not, we've completed the "installation" bit of setting up Elgg. But we still need to configure it before throwing the doors open to visitors. Not surprisingly, all this involves is creating a database and editing the config.php file to our liking.

Creating a Database

Making an empty database in MySQL isn't difficult at all. Just enter the MySQL interactive shell using your username, password, and hostname you specified while installing MySQL.

$ mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.22-Debian_0ubuntu6.06.3-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE elgg;

You can also create a MySQL database using a graphical front-end manager like PHPMyAdmin, which comes with WAMP5. Just look for a database field, enter a new name (elgg), and hit the Create button to create an empty Elgg database.

Initial Configuration

Elgg has a front-end interface to set up config.php, but there are a couple of things you need to do before you can use that interface:

  1. 1. Create a data directory outside your web server root. As described in the configuration file, this is a special directory where uploaded files will go. It's also advisable to create this directory outside your main Elgg install. This is because this directory will be writable by everyone accessing the Elgg site and having such a "world-accessible" directory under your Elgg installation is a security risk.

    If you call the directory elgg-data, make it world-readable with the following command:

$ chmod 777 elgg-data

  1. 2. Setup admin username and password. Before you can access Elgg's configuration web front-end, you need an admin user and a password. For that open the config.php file in your favorite text editor and scroll down to the following variables:

$CFG->adminuser = "";
$CFG->adminpassword = "";
  • Specify your chosen admin username and password between the quotes, so that it looks something like this:

$CFG->adminuser = "admin";
$CFG->adminpassword = "765thyr3";

Make sure you don't forget the username and password of the admin user.

Important Settings

When you have created the data directory and specified an admin username and password, it's time to go ahead with the rest of the configuration. Open a web browser and point to http://<your-web-server>/<elgg-installation>/_elggadmin/.

This will open up a simple web page with lots of fields. All fields have a title and a brief description of the kind of information you need to fill in that field. There are some drop-down lists as well, from which you have to select one of the listed options. Here are all the options and their descriptions:

Administration panel username: Username to log in to this admin panel, in future, to change your settings.

Admin password: Password to log in to this admin panel in future.

Site name: Enter the name of your site here (e.g. Elgg, Apcala, University of Bogton's Social Network, etc.).

Tagline: A tagline for your site (e.g. Social network for Bogton).

Web root: External URL to the site (e.g. http://elgg.bogton.edu/).

Elgg install root: Physical path to the files (e.g. /home/elggserver/httpdocs/).

Elgg data root: This is a special directory where uploaded files will go. If possible, this should live outside your main Elgg installation? (you'll need to create it by hand). It must have world writable permissions set, and have a final slash at the end.

Note

Even in Windows, where we use back slashes (\) to separate directories, use Unix's forward slashes (/) to specify the path to the install root, data root, and other path names. For example, if you have Elgg files under WAMP's default directory in your C drive, use this path: C:/wamp/www/elgg/.

Database type: Acceptable values are mysql and postgres - MySQL is highly recommended.

System administrator email: The email address your site will send emails from (e.g. [email protected]).

News account initial password: The initial password for the 'news' account. This will be the first administrator user within your system, and you should change the password immediately after the first time you log in.

Default locale: Country code to set language to if you have gettext installed.

Public registration: Can general members of the public register for this system?

Public invitations: Can users of this system invite other users?

Maximum users: The maximum number of users in your system. If you set this to 0, you will have an unlimited number of users.

Maximum disk space: The maximum disk space taken up by all uploaded files.

Disable public comments: Set the following to true to force users to log in before they can post comments, overriding the per-user option. This is a handy sledgehammer-to-crack-a-nut tactic to protect against comment spam (although an Akismet plug-in is available from elgg.org).

Email filter: Anything you enter here must be present in the email address of anyone who registers; e.g. @mycompany.com will only allow email address from mycompany.com to register.

Default access: The default access level for all new items in the system.

Disable user templates: If this is set, users can only choose from available templates rather than defining their own.

Persistent connections: Should Elgg use persistent database connections?

Debug: Set this to 2047 to get ADOdb error handling.

RSS posts maximum age: Number of days for which to keep incoming RSS feed entries before deleting them. Set this to 0 if you don't want RSS posts to be removed.

Community create flag: Set this to admin if you would like to restrict the ability to create communities to admin users.

cURL path: Set this to the cURL executable if cURL is installed; otherwise leave blank.

Note

According to Wikipedia, cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, TFTP, SCP, SFTP, Telnet, DICT, FILE, and LDAP. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. For example, it is a good tool for simulating a user's actions at a web browser.

Under Ubuntu Linux, you can install curl using the following command:

apt-get install curl

Templates location: The full path of your Default_Template directory.

Profile location: The full path to your profile configuration file (usually, it's best to leave this in mod/profile/).

Finally, when you're done, click on the Save button to save the settings.

Note

The next version of Elgg, Elgg 0.9, will further simplify installation. Already an early release candidate of this version (elgg-0.9rc1) is a lot more straightforward to install and configure, for initial use.

First Log In

Now, it's time to let Elgg use these settings and set things up for you. Just point your browser to your main Elgg installation (http://<your-web-server>/<elgg-installation>). It'll connect to the MySQL database and create some tables, then upload some basic data, before taking you to the main page.

On the main page, you can use the news account and the password you specified for this account during configuration to log in to your Elgg installation.

Congratulations!