StatusNet – Start your own hosted microblogging twitter like social network on Debian GNU / Linux

build-your-own-microblogging-service-like-twitter-on-debian-linux-Status.net-logo
I like experimenting with free and open source projects providing social networking capabilities like twitter and facebook. Historically I have run my own social network with Elgg – Open Source Social Network Engine. I had a very positive impression from Elgg as a social engine as, there are plenty of plugins and one can use Elgg to run free alternative to very basic equivalent of facebook, problem with Elgg I had however is if is not all the time monitored it quickly fills up with spam and besides that I found it to be still buggy and not easy to update.
The other social network free software I heard of isBuddyPress which I recently installed with Multisite (MuSite) enabled.

Since BuddyPress is WordPress based and it supports all the nice wordpress plugins, my impression is social networking based on wordpress behaves much more stable and since there is Akismet for WordPress, the amount of spammer registrations is much lower than with Elgg.

Recently I started blogging much more actively and I realized everyday I learn and read too much interesting articles and I don't log them anywhere and thought I need a way besides twitter to keep flashy notes of what I'm doing reading, learning in a short notes. I don't want to use Twitter on purpose, because I don't want to improve twitter's site SEO with adding my own stuff on their website but I want to keep my notes on my own local hosted server.

As I didn't wanted to loose time with Complexity of Elgg anymore and wanted to try to something new and I know the open source microblogging social network (Twitter Equivalent) – identi.ca runs StatusNet – Free and Open Source Social software. StatusNet is well known under the motto of "Decentralized Twitter"

screenshot-status-net-microblogging-twitter-like-free-software-network

I took the time to grab it and install it to my home brew machine pc-freak.net. If you haven't seen StatusNet so far – you can check out demo of my installation here – registration is not freely opened because, i don't want spammers to break in, however if you want to give a try drop me a mail or comment below and I will open access for you ..

There is no native statusnet package for Debian Linux (as I'm running Debian) so to install it, I've grabbed statusnet.

To install StatusNet, everything was pretty straight forward and literally following instructionsf rom INSTALL file, i.e.:

# status.example.com maps to /var/www/status/
cd /var/www/status/
wget http://status.net/statusnet-0.9.6.tar.gz
tar -xzf statusnet-0.9.6.tar.gz --strip-components=1
rm statusnet-0.9.6.tar.gz
cd ..
chgrp www-data status/
chmod g+w status/
cd status/
chmod a+w avatar/ background/ file/

mysqladmin -u "root" -p "sql-root-password" create statusnet
mysql -u root -p
GRANT ALL on statusnet.* TO 'statusnetuser'@'localhost' IDENTIFIED BY 'statusnet-secret-password';

To Change default behaviour of URls to be more SEO friendly and not to show .php in URL (e.g. add so called fancy URLs – described in INSTALL):

cp htaccess.sample .htaccess


Then had to configure a VirtualHost under a subdomain http://statusnet.yourdomain.com/install.php or you can alternatively install and access it in browser via http://your-domain.com/status/install.php

An important note to open here is you have to set the URLs via which status.net will be accessed further before proceeding with the install, if you will be using HTTPS here is time to configure it and test it before proceeding with install …  Just be warned that if you don't set the URLs properly now and try to modify them further you will get a lot of issues hard to solve which will cost you a lot of time and nervee ..

If you want to enable twitter bridging in Statusnet you will need to get Twitter consumer and secret keys, to get that you have to create new application on https://dev.twitter.com/apps afterwards you will be taken to a page containing Consumer Key & Consumer Secret string.
StatusNet installation will auto generate config.php, you can further edit it manually with text editor. Content of my current statusnet config.php is here.

Most important options to change are:

$config['daemon']['user'] = 'www-data';
$config['daemon']['group'] = 'www-data';

www-data is user with which Apache is running by default on Debian Linux.

$config['site']['profile'] = 'private';

By default Status.Net will be set to run as private – e.g. it will be fitted for priv. use – messages posted will not publicly be visible. Here the possible options to choose between are:

$config['site']['profile'] = 'private';
$config['site']['profile'] = 'community';
$config['site']['profile'] = 'singleuser';
$config['site']['profile'] = 'public';

singleuser is pretty self explanatory, setting public option will open registration for any user on the internet – probably your network will quickly be filled with spam – so beware with this option. community will make statusnet publicly visible but, registration will only possible via use creation / invitation to join the network from admin.

vi /var/www/status/config.php
$config['site']['fancy'] = true;

Then to enable twitter to statusnet bridge add to config.php

vi /var/www/status/config.php

addPlugin('TwitterBridge');
$config['twitter']['enabled'] = true;
$config['twitterimport']['enabled'] = true;
$config['avatar']['path'] = '/avatar';
$config['twitter']['consumer_key'] = 'XXXXXXXX';
$config['twitter']['consumer_secret'] = 'XXXXXXXX';
# disable sharing location by default
$config['location']['sharedefault'] = 'false';

Notice, I decided to disable statusnet sharedefault folder, because i don't have a lot of free space to provide to users. If you want to let users be allowed to share files (you the space for that), you might want to set a maximum quote of uploaded files (to prevent your webserver from being DoSed – for example by too many huge uploads), here is some reasonable settings:
 

$config['attachments']['file_quota'] = 7000000;
$config['attachments']['thumb_width'] = 400;
$config['attachments']['thumb_height'] = 300;

 

If you want to get the best out of performance of your new statusnet microblogging service, after each modification of config.php be sure to run:

 

php scripts/checkschema.php

Running checkschema.php is also useful, to check whether adding new plugins to check whether plugin will not throw an error.

Here is some extra useful config.php plugins to enable:
 

addPlugin('Gravatar', array());
#addPlugin('Textile');
addPlugin('InfiniteScroll');
addPlugin('Realtime');
addPlugin('Blog');
addPlugin('SiteNoticeInSidebar');
addPlugin('WikiHashtags');
addPlugin('SubMirror');
addPlugin('LinkPreview');
addPlugin('Blacklist');


If you expect to have quickly growing base of users it is recommended to also check out whether your MySQL is tuned with mysqltuner and optimize it for performance

Another useful think you would like to do is to increased the number of Statusnet avatars in the 'following' – 'followers' – 'groups' sections on my profile page by editing

lib/groupminilist.php

and

lib/profileminilist.php

line 36 in both files.
To get the full list of possible variables that can be set in config.php run in terminal:

 php scripts/setconfig.php -a

If you happen to encounter some oddities and issues with StatusNet after installation, this is most likely to some PHP hardering on compile time or some PHP.ini functions disabled for security or some missing component to install which is described as a prerequirement in statusnet INSTALL file

to debug the issues enable statusnet logging by adding in config.php

$config['site']['logdebug'] = true;
$config['site']['logfile'] = '/var/log/statusnet.log';

By default logs produced will be quite verbose and there will be plenty of information you will probably not need and will lead to a lot of "noise", to get around this, there is the LogFilter Plugin for some reasonable logging use in config.php:

addPlugin('LogFilter', array( 'priority' => array(LOG_ERR => true,
LOG_INFO => true,
LOG_DEBUG => false),
'regex' => array('/About to push/i' => false,
'/twitter/i' => false,
'/Successfully handled item/i' => false)
));

If you want tokeep log of statusnet it is a good idea to rorate logs periodically to keep them from growing too big, to do this create in /etc/logrotate.d new files /etc/logrotate.d/statusnet with following content:

/var/log/statusnet/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 770 www-data www-data
sharedscripts
postrotate
/path/to/statusnet/scripts/stopdaemons.sh > /dev/null
/path/to/statusnet/scripts/startdaemons.sh > /dev/null
endscript
}

You will probably want to to add new Links, next to StatusNet main navigation links for logged in users, this is possible by adding new line to

lib/primarynav.php

and

lib/secondarynav.php

You will have to add a PHP context like:

 $this->action->menuItem('http://www.pc-freak.net/blog/',
                              _m('MENU','Pc-Freak.Net Blog'),
                              _('A pC Freak Blog'),
                              false,
                              'nav_pcfreak');

Once you're done with installation, make sure you change permissions or move install.php from /var/www/status, otherwise someone might overwrite your config.php and mess your installation …

chmod 000 /var/www/status/install.php There is plenty of other things to do with StatusNet (Support for communication with Jabber XMPP protocol, notification via SMS etc. There are also some plugins to add more statusnet functionality.


Enjoy micro blogging ! 🙂

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , , , , , ,

10 Responses to “StatusNet – Start your own hosted microblogging twitter like social network on Debian GNU / Linux”

  1. admin says:
    Firefox 30.0 Firefox 30.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0

    If you're planning to start Statusnet for a public use and enable registration for everyone opened you will probably want to tweak its performance. I've stumbled upon a very good guide explaining how to run stastusnet with Nginx, MemCache and APC Caching – http://publications.jbfavre.org/statusnet/optimize-statusnet-nginx-php-fpm-apc-memcache.en

    View CommentView Comment
  2. Ezekiel says:
    Chromium 25.0.1364.160 Chromium 25.0.1364.160 Ubuntu x64 Ubuntu x64
    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22

    Woah! I'm really digging the template/theme of this site. It's simple, yet effective. A lot of times it's very hard to get that "perfect balance" between usability and visual appeal. I must say you've done a amazing job with this. Additionally, the blog loads extremely fast for me on Chrome. Exceptional Blog!

    View CommentView Comment
  3. Termometro de cocina says:
    Internet Explorer 6.0 Internet Explorer 6.0 Windows XP Windows XP
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.1.4322; PeoplePal 6.2)

    Enhorabuena! y gracias!

    Debo pronunciar que tu entrada en el website me ha sido efectivamente beneficioso!

    Termometro de cocina

    View CommentView Comment
  4. casual luggage says:
    Safari 5.1 Safari 5.1 iPad iOS 5.1.1 iPad iOS 5.1.1
    Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3

    Hey! Ɗo yoս know іf theʏ make any plugins to
    protect аgainst hackers? ӏ’m kinda paranoid ɑbout losing еverything I’ve worƙeԀ hard ߋn. Any suggestions?

    View CommentView Comment
  5. www.ankaraozlemtemizlik.com says:
    Safari 6.0 Safari 6.0 iPod iOS 6.1.3 iPod iOS 6.1.3
    Mozilla/5.0 (iPod; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25

    I don’t know whether it’s just me or if everybody else encountering problems with your
    blog. It seems like some of the written text on your posts are
    running off the screen. Can somebody else please comment and let me know if this is happening to them as well?
    This might be a problem with my web browser because
    I’ve had this happen before. Kudos

    View CommentView Comment
  6. hip0 says:
    Google Chrome 40.0.2214.111 Google Chrome 40.0.2214.111 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36

    While running statusnet you should notice that nomatter what kind of configuration is in config.php for logging, your social network will be printing a lot of debug messages in /var/log/messages this is pretty annoying / frustrating, cause statusnet writes too much content in messages (flooding the central log place)  and if you're like me and you like watching about some general server problems in /var/log/messages, you will notice the file becomes seriously bloated cause of statusnet ..
    So here is the fix (resolution) to the can't remove statusnet log messages from /var/log/messages:

    I tried to do it the described statusnet way with using config.php parameters:

    $config['site']['logdebug'] = false;
    $config['site']['logfile'] = '/var/log/statusnet/statusnet.log';

    But this didn't work out, so finally after a long investigation and thanks to https://blog.lebegue.org/tag/status-net/ I've learned how tor remove this irritating  logs like:

    Feb 15 07:36:14 pcfreak statusnet: [s.pc-freak.net:16960.39b846a3 GET /url/250] Including config file: /var/www/statusnet/config.php
    Feb 15 07:37:54 pcfreak statusnet: [s.pc-freak.net:17248.96acaddd GET /blog/27d59548-aaad-4322-8266-bb8c7a1de39f] Including config file: /var/www/statusnet/config.php
    Feb 15 07:37:55 pcfreak statusnet: [s.pc-freak.net:17259.b0759ee8 GET /main/login] Including config file: /var/www/statusnet/config.php
    Feb 15 07:37:59 pcfreak statusnet: [s.pc-freak.net:17165.ab3d73bf GET /conversation/272] Including config file: /var/www/statusnet/config.php
    Feb 15 07:38:14 pcfreak statusnet: [s.pc-freak.net:17219.2cd7748c GET /rss] Including config file: /var/www/statusnet/config.php
    Feb 15 07:41:12 pcfreak statusnet: [s.pc-freak.net:17043.c12fc927 GET /notice/279] Including config file: /var/www/statusnet/config.php
    Feb 15 07:41:13 pcfreak statusnet: [s.pc-freak.net:17043.f0e9823e GET /main/login] Including config file: /var/www/statusnet/config.php
    Feb 15 07:43:50 pcfreak statusnet: [s.pc-freak.net:17247.fa35eec5 GET /hipo] Including config file: /var/www/statusnet/config.php
    Feb 15 07:43:51 pcfreak statusnet: [s.pc-freak.net:17247.10038263 GET /main/login] Including config file: /var/www/statusnet/config.php
    Feb 15 07:43:52 pcfreak statusnet: [s.pc-freak.net:17247.65edaada GET /hipo] Including config file: /var/www/statusnet/config.php
    Feb 15 07:43:53 pcfreak statusnet: [s.pc-freak.net:17247.890edc9a GET /main/login] Including config file: /var/www/statusnet/config.php
    Feb 15 07:44:03 pcfreak statusnet: [s.pc-freak.net:17304.4f0de47e GET /blog/727b7387-3202-4276-bb08-51375f9fa488] Including config file: /var/www/statusnet/config.php
    Feb 15 08:00:07 pcfreak statusnet: [s.pc-freak.net:16960.28432279 GET /blog/10af5d33-aa2e-43d5-b277-daff203e679c] Including config file: /var/www/statusnet/config.php
    Feb 15 08:02:51 pcfreak statusnet: [status.pc-freak.net:17256.28391783 GET /] Including config file: /var/www/statusnet/config.php
    Feb 15 08:02:53 pcfreak statusnet: [s.pc-freak.net:17209.ac633812 GET /main/login?PHPSESSID=nuvn3m1gfmma3gm2i0vjvfuak2] Including config file: /var/www/statusnet/config.php
    Feb 15 08:07:40 pcfreak statusnet: [s.pc-freak.net:17023.73625b14 GET /url/257] Including config file: /var/www/statusnet/config.php
    Feb 15 08:08:31 pcfreak statusnet: [s.pc-freak.net:17211.1bb35baf GET /notice/354] Including config file: /var/www/statusnet/config.php
    Feb 15 08:08:32 pcfreak statusnet: [s.pc-freak.net:17211.d359d1d2 GET /main/login] Including config file: /var/www/statusnet/config.php
    Feb 15 08:11:02 pcfreak statusnet: [s.pc-freak.net:17302.2b3005ff GET /url/250] Including config file: /var/www/statusnet/config.php
    Feb 15 08:12:15 pcfreak statusnet: [s.pc-freak.net:17067.419db455 GET /notice/400] Including config file: /var/www/statusnet/config.php
    Feb 15 08:12:46 pcfreak statusnet: [s.pc-freak.net:17265.3971c766 GET /directory/users/t] Including config file: /var/www/statusnet/config.php
    Feb 15 08:15:13 pcfreak statusnet: [s.pc-freak.net:17264.59165daa GET /url/310] Including config file: /var/www/statusnet/config.php
    Feb 15 08:15:32 pcfreak statusnet: [s.pc-freak.net:17256.e756fa2b GET /url/309] Including config file: /var/www/statusnet/config.php
    Feb 15 08:15:43 pcfreak statusnet: [status.pc-freak.net:16968.3ba9c838 GET /] Including config file: /var/www/statusnet/config.php
    Feb 15 08:19:42 pcfreak statusnet: [s.pc-freak.net:17265.185f92ae GET /notice/249] Including config file: /var/www/statusnet/config.php
    Feb 15 08:19:49 pcfreak statusnet: [s.pc-freak.net:17066.a71e1440 GET /url/266] Including config file: /var/www/statusnet/config.php

     

    Edit ./lib/statusnet.php
    find inside file:

    common_log(LOG_INFO, "Including config file: " . $_config_file);

    Comment out the line (i.e. substitute it with):

    common_log(LOG_INFO, "Including config file: " . $_config_file);

     

    Save the file and you're done no more irritating logs in /var/log/messagse Hooray !!! 🙂 God is Great! 🙂

    View CommentView Comment
  7. Daniel @ Hosted Status Page says:
    Internet Explorer 11.0 Internet Explorer 11.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

    Looks pretty cool I am sure you could also build a simliar thing yourself quite easily aswell.

    View CommentView Comment
  8. hand jobs says:
    Safari 8.0 Safari 8.0 iPhone iOS 8.1.2 iPhone iOS 8.1.2
    Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B440 Safari/600.1.4

    Great blog here! Also your site lots up very fast! What web host are you the use of? Can I am getting your affiliate hyperlink in your host? I desire my web site loaded up as fast as yours lol

    View CommentView Comment
  9. Facebook Memes says:
    Google Chrome 39.0.2171.95 Google Chrome 39.0.2171.95 Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

    Greetings, I think your web site might be having browser
    compatibility problems. When I look at your blog in Safari, it looks fine however, if opening in IE,
    it’s got some overlapping issues. I simply wanted to provide you with a quick heads up!

    Besides that, fantastic site!

    View CommentView Comment
  10. Pinglagu says:
    Firefox 47.0 Firefox 47.0 Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1; rv:47.0) Gecko/20100101 Firefox/47.0

    Thanks for tutorial bro. Im from indonesia 🙂

    View CommentView Comment

Leave a Reply

CommentLuv badge