OSN 0.2

OSN is a distributed social network with an open protocol.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
AGPL (Affero General Public License) 
2.8/5 13
Gordon Irlam
ROOT \ Office \ Groupware
1 OSN Screenshot:
OSN is a distributed social network with an open protocol. From a user's perspective, all the individual sites in the federation appear as one. Users can search, browse profiles, link to each other without regard to which sites other users are using and send messages.

Public key cryptography is used to make the system resilient to spam. User profiles are based on the FOAF XML file format and users can migrate their profiles from one site to another.

Installation instructions:

If you are upgrading OSN from a prior release please skip to the
upgrade instructions at the end of this file.

OSN has the option of being installed on a multi-computer system. Any
number of profile servers, a profile database server, a search server,
a search server database, any number of mail servers, and a mail
server database. Presently the database machines have to be the same
as the hosts they serve, although changing this would be trivial. If
you are getting started it is recommended that everything be installed
on the same machine.

To install OSN you will need root access to a Linux dedicated host or
virtual private server. Debian and probably Ubuntu work best,
although other variants may also work.

It is assumed that OSN is being installed on a machine where the other
local users are trusted. As a convenience to development OSN does not
presently support running in an untrusted environment. If you were
running in an untrusted environment you would probably need to
chmod/chown the "config/site_config.*" and "profile/site_secrets.php"
files created later so that they are only accessible by the web server
user, make "search/pathd" readable only by user, remove the two
chmod() calls in "profile/image.php" save_image(), and run
"profile/create_iu" described later as the web server user. Let us
know if you need or try this.

The examples given here assume a single host, example.com, with IP
address takes on the role of all six system types.

First decide on the host names of the machines:

profile (database) server = example.com
search (database) server = search.example.com
mail (database) server = mail.example.com

These hostnames should be distinct. The name of the profile server is
also the name of the user facing website, so make it something

Configure DNS:

Configure DNS for the machines by adding the appropriate entries to
the zone file for example.com:

@ 3600 IN A
search 3600 IN CNAME @
mail 3600 IN CNAME @
www 3600 IN CNAME @
@ 3600 IN MX 0 mail.example.com.

"www" will be set to forward to example.com later on. Also note the
addition of an MX record for the example.com domain pointing to the
mail server.

You may also wish to add an SPF record to prevent spammers besmirching
the reputation of your domain. The details could vary but a basic
working example is:

@ 3600 IN TXT "v=spf1 a"

Configuring the source:

If you are reading this file you have already retrieved and unpacked
the source. We will assume you unpacked it into
/home/user/osn-RELEASE. Rename the source:

cd /home/user
mv osn-RELEASE osn

Create includes/site_config.php:

cd /home/user/osn/includes

This script will ask you a series of questions. Most should by now be
self explanatory. For the database password you are free to go with
the default or to make something up. If the database is ever running
on separate machines from the hosts they serve, you should probably
make something up.

Create includes/site_secrets.php:

cd /home/user/osn/profile

This script will create the secrets in "profile/site_secrets.php" used
to authenticate session cookies, validate invites, and track bounce
messages. It would be bad if this file was lost, but not the end of
the world. The contents of this file must not be publicly disclosed.

Setting up GCC and Make:

GCC is used to compile pathd the high speed path lookup daemon.

(as root)
aptitude install gcc make libmysqlclient-dev

Setting up PHP:

Install the required PHP modules:

(as root)
aptitude install php5-cli php5-mysql php-mail php-mail-mime php5-curl php5-mcrypt php5-gd

Install php-mail-mime 1.5.2 or later. Earlier versions gave the

Error: Only variable references should be returned by reference in /usr/share/php/Mail/mime.php on line 375

so if "aptitude show php-mail-mime" shows a version less than 1.5.2
install the source manually:

cd /home/user/osn/src
tar -zxf Mail_Mime-1.5.2.tgz
(then as root)
cp Mail_Mime-1.5.2/[mx]* /usr/share/php/Mail

Install Mail_mimeDecode 1.5.0 or later:

cd /home/user/osn/src
tar -zxf Mail_mimeDecode-1.5.0.tgz
(then as root)
cp Mail_mimeDecode-1.5.0/mimeDecode.php /usr/share/php/Mail
(edit) /usr/share/php/Mail/mimeDecode.php
remove "&" from "new" on line 324
(edit) /usr/share/php/PEAR.php
remove "&" from "new" on line 563, 566

Lastly configure the apache php.ini:

(as root)
(edit) /etc/php5/apache2/php.ini
display_errors = Off
log_errors = On
post_max_size = 21M
upload_max_filesize = 20M

"display_errors" should be "On" for development environments. The
tweaking of the post/upload sizes to to permit the uploading of large

Make apache pick up the new modules and configuration:

(as root)
apache2ctl restart

Setting up Exim:

Exim need to be configured appropriately to send and receive mail.
This may already be the case. If not:

(as root)
dpkg-reconfigure exim4-config
Internet site; mail is sent and received directly using SMTP
System mail name: example.com
IP-addresses to listen on for incoming SMTP connections:
Other destinations for which mail is accepted: example.com
Domains to relay for:
Machines to relay mail for:
Keep number of DNS-queries minimal (Dial-on-Demand)?:

This last option is for performance reasons it is recommended you
avoid DNS lookups of the local nodename on each remote connection.

The exim mailer now needs to be configured to accept mail intended for
OSN and invoke filter processes to handle it. First we need to
generate the exim configuration code to do this:

cd /home/user/osn
make configure-exim

Then we need to install this code it in the exim configuration file:

(as root)
(edit) /etc/exim4/exim4.conf.template

(in the routers section right before smarthost insert the contents
of the file /home/user/osn/mail/exim-routers.conf)

(anywhere in the transports section insert the contents of the file

Finally restart exim:

(as root)
/etc/init.d/exim4 restart
(runs update-exim4.conf)

Configuring regular mail:

OSN publishes an alias, info@example.com, for people to use to contact
the local site. This alias needs to be setup to forward to a user
that will respond to such email.

(as root)
(edit) /etc/aliases
add an alias for "info"

Setting up MySQL:

(as root)
aptitude install mysql-server mysql-client

Create the database access priviliges:

(as root)
cd /home/user/osn
make configure-mysql

You can use "make -n configure-mysql" if you want to see what database
commands will be performed before deciding to perform them.

Setting up Apache:

The web servers need to be configured on the profile and search
servers. As a cosmetic issue www.example.com also needs to be
configured to forward to example.com.

cd /home/user/osn
make configure-apache

(as root)
cd /home/user/osn
make install-apache
/etc/init.d/apache2 reload

Building pathd:

pathd is the high speed path lookup daemon:

cd /home/user/osn/search

Configuring the databases:

The initial profile database schema need to be defined and the initial
data values populated:

cd /home/user/osn/profile
(enter "osn" or the database password you have chosen)

"create_iu" creates the initial users. It will ask for the
administrator username, which should be a name like "fred". It should
also ask for the initial account password, which should be secure,
since it will be web accessible.

The search server and mail server databases also need to be setup:

cd /home/user/osn/search
(enter "osn" or the database password you have chosen)

cd /home/user/osn/mail
(enter "osn" or the database password you have chosen)

Setting up the daemon scripts:

OSN has a number of processes which must always be running. These are
"fetchd" the search server profile discovery daemon, "pathd" the high
speed path lookup daemon, "maild" the OSN mail processing daemon, and
"check_daemons" which monitors the state of the other daemons and
reports if any of them crashed.

cd /home/usr/osn
make configure-daemons

(as root)
cd /home/user/osn
make install-daemons

Setting up the feed directory:

OSN generates feeds for discussion forums. The feed directory needs
to be writeable by the web user.

(as root)
cd /home/user/osn
mkdir -p profile/http/feed/tmp
chown -R www-data:www-data profile/http/feed

Going live:

Everything is now setup. The daemons can be started:

(as root)
/etc/init.d/osn start

And the website can be enabled:

cd /home/user/osn/includes
(edit) site_config.php
$sitedown = 1;
$sitedown = 0;

The website is now live. If you are in a production environment you
might also want to set $invite_only to 1. This will prevent new users
creating accounts before you have had a chance to login and poke
around. You can set $invite_only back to 0, once you are satisfied
everything looks good.

You should now be able to connect to http://example.com/ with a web
browser and login with the administrator username and password you
specified earlier when running "create_iu". You should set the name
of the adminstrator to your name, and the description of the
adminsistrator to your self description. Be sure to do this for the
administrator username you specified earlier, and not the user
"admin". The user "admin" is an automated user that send out notices
to other users.

Last updated on March 3rd, 2008

#social networking #friend management #email-like messaging #groupware #social #networking #messaging

Add your review!