Diaspora on FreeBSD
January 4th, 2012 Reading time 2 min
This is a small collection of brief notes and specs for installing a Diaspora* project pod instance on
FreeBSD 8.2, which is the setup I am was using at the create-o-plex pod before I stopped operating it.
I refer to these notes along with the Diaspora* installation instructions to get set up and running.
Install prerequisite ports
These are the ports which you should update and install prior to cloning the Diaspora Github repository:
- git
- ImageMagick
- libxml2
- mysql51-server
- www/nginx
- redis
- ruby19
- sqlite3
Install bundler
You need to install the Ruby bundler
utility for use with Diaspora:
sudo gem install bundler
Example Configurations
Here are some examples and snippets based on the configuration files I use in my FreeBSD based setup. Please note that my setup is experimental and although it runs in production mode and is monitored, it supports limited users and runs on a server with modest resources. These examples are just that. YMMV, etc. ;)
/usr/local/etc/redis.conf
daemonize yes
pidfile /var/run/redis/redis.pid
bind 127.0.0.1
port 6379
timeout 300
loglevel verbose
logfile /path_to_log_dir/redis/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /home/db/redis/
appendonly no
appendfsync everysec
vm-enabled no
vm-swap-file /tmp/redis.swap
vm-max-memory 0
vm-page-size 32
vm-pages 134217728
vm-max-threads 4
glueoutputbuf yes
hash-max-zipmap-entries 64
hash-max-zipmap-value 512
script_server.yml
script_server:
# Choose database. Currently supported: mysql, postgres
db: "mysql"
# Enable thin as application server
enable_thin: true
# Port on which thin should listen
thin_port: 3000
# We're running our Thin instances on sockets instead of ports
default_thin_args: "--servers 3 --socket /tmp/thin.sock"
# Possibilities are development, production
rails_env: "production"
nginx.conf
Relevant snippet from the nginx.conf
showing sockets for Thin:
upstream thin_cluster {
server unix:/tmp/thin.0.sock;
server unix:/tmp/thin.1.sock;
server unix:/tmp/thin.2.sock;
}
Notes
Bundle Install Phase
SQLite3 gem install will fail to find includes at build time without setting this prior to running bundle install
:
export CONFIGURE_ARGS="with-sqlite3-include=/usr/local/include"