Provide a private Diaspora Pod
Goal
I want to run a private diaspora pod to learn what it can do. Maybe then I suggest it to family to use it as communication hub.
Architecture
I have apache running on an opensuse 13.1 server and a mysql database on a NAS. If the NAS db should turn out to be too slow, it may move to the faster webserver later. Obviously I'll try to use these instead of the recommended nginx/postgres combination.
Install Prerequisites
I used the list provided diasporafoundation]:
sudo zypper install ruby-devel rubygem-bundler make automake gcc gcc-c++ git libcurl-devel ImageMagick ImageMagick-extra libtool bison libtool patch libxml2-devel libxslt-devel libffi-devel libyaml-devel nodejs
Database
While the recomended setup via CLI should work, I used the synonym phpMyAdmin setup for convenience
- Activate phpMyAdmin on the NAS
- Login as root and create a new user with all rights on databases beginning with user_ and create separate db with name user_production.
Webserver
Since the webserver is already running and happily serving pages with ssl installing apache with ssl and firewall is not part of this howto
- Install ruby passenger
sudo zypper install rubygem-passenger-apache2
- Activate passenger by adding this to the APACHE_MODULES line in /etc/sysconfig/apache2
APACHE_MODULES="... passenger"
- Restart Apache and look at output. Should contain lines like this now:
CGroup: /system.slice/apache2.service ... |-30938 PassengerWatchdog |-30941 PassengerHelperAgent |-30947 PassengerLoggingAgent
Redis
Redis is a key-value database. Install like this
sudo zypper install redis sudo cp /etc/redis/default.conf.example /etc/redis/default.conf sudo vi /etc/redis/default.conf sudo chown redis /etc/redis/default.conf sudo /usr/sbin/rcredis restart
Install Diaspora
Clone Repo and Prepare Config
su - diaspora git clone -b master git://github.com/diaspora/diaspora.git cd diaspora
cp config/database.yml.example config/database.yml cp config/diaspora.yml.example config/diaspora.yml
Edit the obvious things (db, user, pw, url, certs) and collation to utf8 / utf8_bin (utf8mb4 not known)
Warning: while user is diaspora, database used by script is disaspora_production
Rails Dependencies and Assets
RAILS_ENV=production DB=mysql bin/bundle install --without test development RAILS_ENV=production DB=mysql bin/rake assets:precompile
Configure Apache (1st try)
/etc/apache2/conf.d/diaspora.conf
Alias /dia "/home/diaspora/diaspora/public/"
<Directory "/home/diaspora/diaspora/public/">
Options -MultiViews
AllowOverride None
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
Order allow,deny
Allow from 127.0.0.1
Allow from 192.168.0.0/16
Allow from 10.0.0.0/8
Allow from ::1
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from 127.0.0.1
Allow from 192.168.0.0/16
Allow from 10.0.0.0/8
</IfModule>
</Directory>
Run Pod
Consider doing this in screen session (I guess this should keep running)
RAILS_ENV=production DB=mysql ./script/server
For now: This script exits. No Errormessage. No Apache page. No local Diaspora Pod :(