Skip to content
Juan F edited this page Mar 27, 2017 · 3 revisions

<<toc>>

Installing

Important: Nuntium runs only on unix-based systems.

Set up the database

# mysql -u root -p
mysql> create database nuntium;
mysql> create database nuntium_development;
mysql> create database nuntium_test;
mysql> create user 'nuntium'@'localhost';
mysql> set password for 'nuntium'@'localhost' = PASSWORD('secret');
mysql> grant all on nuntium_test.* to 'nuntium'@'localhost';
mysql> grant all on nuntium_development.* to 'nuntium'@'localhost';
mysql> grant all on nuntium.* to 'nuntium'@'localhost' identified by 'secret';

Configure you Rails to access the database

Modify you config/database.yml to match the settings above

development:
  adapter: mysql
  database: nuntium_development
  username: nuntium
  password:
  pool: 5
  timeout: 5000
  reconnect: true

test:
  adapter: mysql
  database: nuntium_test
  username: nuntium
  password:
  pool: 5
  timeout: 5000

production:
  adapter: mysql
  database: nuntium
  username: nuntium
  password: secret
  pool: 5
  timeout: 5000
  reconnect: true

Prepare the database

# cd path/to/nuntium
# bundle exec rake db:schema:load
# bundle exec rake db:test:clone
# bundle exec rake db:schema:load RAILS_ENV=production
# bundle exec rake db:seed
# bundle exec rake db:seed RAILS_ENV=production

Compile Javascript and CSS

  • Then compile the assets:
cd path/to/nuntium
bundle exec smart_asset

Required libraries

Nuntium depends on:

RabbitMQ

  1. Follow the http://www.rabbitmq.com/install.html
  2. Run the RabbitMQ server
  3. Once you have it installed, run the following command on your Nuntium directory:
sudo rake rabbit:prepare

This will create the RabbitMQ user and vhost specified in the config/amqp.yml file.

Make sure you have RabbitMQ running before running Nuntium. You can restart the RabbitMQ server by issuing this command:

sudo /etc/init.d/rabbitmq-server restart

Memcached

Follow the http://code.google.com/p/memcached/wiki/NewStart

Make sure you have Memcached running before running Nuntium:

memcached -d

Nokogiri

Follow the http://nokogiri.org/tutorials/installing_nokogiri.html

Running in development mode

Nuntium Services

You can use the script in script/nuntium_service.sh to start the Nuntium services in daemon mode e.g.

# cd <<nuntium_clone_dir>>
# ./script/nuntium_service.sh cron_daemon_ctl.rb start development
# ./script/nuntium_service.sh cron_daemon_ctl.rb start development
# ./script/nuntium_service.sh generic_worker_daemon_ctl.rb start development slow 1
# ./script/nuntium_service.sh generic_worker_daemon_ctl.rb start development fast 1
# ./script/nuntium_service.sh managed_processes_daemon_ctl.rb start development
# ./script/nuntium_service.sh scheduled_jobs_service_daemon_ctl.rb start development

To start the services manually (useful for debugging)

# cd <<nuntium clone dir>>
# bundle exec ruby ./lib/services/cron_daemon.rb
# bundle exec ruby ./lib/services/generic_worker_daemon.rb development slow 1
# bundle exec ruby ./lib/services/generic_worker_daemon.rb development fast 1
# bundle exec ruby ./lib/services/managed_processes_daemon.rb development
# bundle exec rails server

Running in production mode

To avoid problems issues with different versions of Ruby, it's recommended to use https://rvm.io

If you do this in your production environment ensure that you uninstall the system installed ruby to avoid conflicts

# sudo apt-get uninstall ruby1.8

You might want to use passenger for the web server and monit for monitoring the services.

Set up passenger

Follow the http://www.modrails.com/install.html

  • Put the Virtual Host configuration (instructions given when installing passenger) in /etc/apache2/sites-enabled/nuntium.conf e.g.
<VirtualHost *:80>
  ServerName your_elastic_ip_or_dns
  DocumentRoot path/to/nuntium/public
  PassengerSpawnMethod conservative
  <Directory path/to/nuntium/public>
    AllowOverride all
    Options -MultiViews
  </Directory>
</VirtualHost>
  • Remember to restart apache sudo apachectl restart
  • Test it out by pointing your browser to your_elastic_ip

RabbitMQ Management Plugin

RabbitMQ

Monit

Monit

Installing on EC2

EC2

Configuring a VPN connection

Vpn

Running the tests

If you run the tests and they pass there is a very high chance that Nuntium is correctly installed on your system. ;-)

  • Run the RabbitMQ rake task for test environment:
RAILS_ENV=test rake rabbit:prepare
  • Prepare the database for testing:
rake db:test:prepare
  • Run the tests:
rake test

FAQ

You get {{{eventmachine not initialized: evma_install_oneshot_timer}}}

That probably means you don't have #RabbitMQ.

More help

Please send a message to our http://tech.groups.yahoo.com/group/nuntiumusers/.