Installing StatusNet
I made a few notes last night on how to install statusnet. The first step is to download the latest statusnet file and read the INSTALL document.
Once you've download the file, copy it to /var/www and rename it statusnet. I then suggest you follow a LAMP installation guide for your distro if you haven't already.
## Ubuntu package install
apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5 \
php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap \
php5-mcrypt php5-memcache php5-ming php5-pspell php5-recode php5-snmp \
php5-sqlite php5-tidy php5-xmlrpc php5-xsl
## File permissions
chgrp www-data /var/www/statusnet/
chmod g+w /var/www/statusnet/
chmod a+w /var/www/statusnet/avatar
chmod a+w /var/www/statusnet/background
chmod a+w /var/www/statusnet/file
## Database creation
I use MySQL's shell to create the database, create the user and set the user's database permissions,
mysql --user=root --password="password"
Once I'm logged in:
create user james;
=> Query OK, 1 row affected (0.00 sec)
create database statusnet;
=> Query OK, 1 row affected (0.00 sec)
GRANT ALL on statusnet.*
TO james@localhost
IDENTIFIED BY 'secretpassword';
=> Query OK, 1 row affected (0.00 sec)
## StatusNet install.php
It doesn't matter if you use an IP address at this stage, as all you are interested in is the PHP script to automate the remaining part of the installation procedure.
I used http://192.168.1.177/statusnet/install.php
Once the installation has completed successfully you are ready to configure the system.
## StatusNet configuration
Here are the parts of the config which I added or modified:
$config['site']['name'] = 'micro.rorbuilder.info';
$config['site']['server'] = 'micro.rorbuilder.info';
$config['site']['path'] = 'statusnet';
$config['site']['fancy'] = true;
$config['site']['language'] = 'en_GB';
## Hooking up the domain name
I suggest you research that subject from elsewhere as it can be quite complicated for a beginner.
In my case I modified /etc/apache2/vhosts.d/00_default_vhost.conf on my primary server to include the following:
ProxyPreserveHost On
ProxyPass / http://192.168.1.177/
ProxyPassReverse / http://192.168.1.177/
ServerName micro.rorbuilder.info
## Testing the site
At this point StatusNet was viewable from http://micro.rorbuilder.info/statusnet/ which meant I was ready to log in as admin or register a new user.
I'm not sure where I read about sendmail but I ended up installing it to ensure statusnet could send out email notifications to users. How I configured the email server is beyond the scope of this blog entry.
After I created a new user, made a sample post, and uploaded an avatar I decided to move statusnet to the root of the webserver (http://micro.rorbuilder.info).
Note: Make sure you enable .htaccess and check that the Apache rewrite module is loaded and Allowoverride All is set.
Here's my /etc/apache2/httpd.conf file on the target machine (192.168.1.177):
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Satisfy all
## Moving StatusNet to the root web directory
Simply move the contents from /var/www/statusnet to /var/www and then modify config.php as follows:
$config['site']['path'] = '';
This will break the file path for the avatar images but it can easily be fixed with a symlink. There may be some paths (doc) which are still missing however I suspect they are fairly trivial to fix.
Here's my .htaccess file on /var/www
RewriteEngine On
# NOTE: change this to your actual StatusNet base URL path,
# minus the domain part:
#
# http://example.com/ => /
# http://example.com/mublog/ => /mublog/
#
#RewriteBase /statusnet/
RewriteBase /
## Uncomment these if having trouble with API authentication
## when PHP is running in CGI or FastCGI mode.
#
#RewriteCond %{HTTP:Authorization} ^(.*)
#RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?p=$1 [L,QSA]
Order allow,deny
statusnet identica installation homeserver notes