RabbitMQ

Setup on Mac OS X

Download standalone tarball from:
http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.2/rabbitmq-server-mac-standalone-3.1.2.tar.gz
and extract binary files somewhere

Start:
$ /rabbitmq_home/sbin/rabbitmq-server -detached

Stop:
$ /rabbitmq_home/sbin/rabbitmqctl stop

Check status:
$ /rabbitmq_home/sbin/rabbitmqctl status

Nginx

Setup on Mac with MacPorts

$ sudo apt-get install

On OS X (macports):
$ port install nginx

To run at system start: 
$ sudo port load nginx

Config files and folders

- /etc/nginx/

On OS X (macport):
- /opt/local/etc/nginx/

Activate default configuration

Start by setting the default config files:

$ cd /opt/local/etc/nginx
$ sudo cp nginx.conf.default nginx.conf
$ sudo cp mime.types.default mime.types
    
Load http://localhost in your browser to see that it's working.

Reload

$ sudo nginx -s stop; sudo nginx
or, if you just need updating config 
$ sudo nginx -s reload

OS X uses launchd so the process of starting/stopping daemons is slightly different.

$ sudo port unload nginx
$ sudo port load nginx

Make Browsers Cache Static Files On nginx

location /static {
    alias {{django.static_root}};

    # Make Browsers Cache Static Files On nginx
    # See: http://www.howtoforge.com/make-browsers-cache-static-files-on-nginx
    # and  http://serverfault.com/questions/370525/nginxdjango-serving-static-files
    access_log   off;
    expires modified 1m;
}

saltstack

Config files

/etc/salt/master
/etc/salt/minion

/srv/salt/top.sps

Masterless quickstart

Install as follows:

$ wget -O - http://bootstrap.saltstack.org | sudo sh

then, for example:

$ salt-call --local state.highstate -l debug

Install master and minion on OS X

- Install pre-requisites as explained here:  
http://docs.saltstack.com/topics/installation/osx.html

- Download salt source to retrieve missing "master" and "minion" config files:
$ git clone https://github.com/saltstack/salt

- Copy default config files:
$ sudo cp salt/conf/master /etc/salt/
$ sudo cp salt/conf/minion /etc/salt/

- Add these settings to /etc/salt/minion:
master: localhost
id: minion1

- Run master and minion in interactive mode:
$ sudo salt-master -l debug
$ sudo salt-minion -l debug

- Accept minion key
$ sudo salt-key -A
$ sudo salt-key -L

- Test:
$ sudo salt '*' test.ping
$ sudo salt '*' cmd.run "uptime"

Provisioners

$ vagrant plugin install vagrant-salt

Postgresql

Setup on Mac with MacPorts

$ sudo port install postgresql91 postgresql91-server

To create a database instance, after install do
 sudo mkdir -p /opt/local/var/db/postgresql91/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql91/defaultdb
 # sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -D /opt/local/var/db/postgresql91/defaultdb' 
 sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -D /opt/local/var/db/postgresql91/defaultdb --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8"' 

To tweak your DBMS, consider increasing kern.sysv.shmmax by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf

Now you can start the database server using:

$ sudo su postgres -c '/opt/local/lib/postgresql91/bin/pg_ctl -D /opt/local/var/db/postgresql91/defaultdb -l logfile start'

To start the service automatically:
$ sudo launchctl load -w -F /Library/LaunchDaemons/org.macports.postgresql84-server.plist

Reload

$ sudo /etc/init.d/postgresql {start|stop|restart|reload|force-reload|status}

Reload (on Mac)

$ sudo launchctl unload /Library/LaunchDaemons/org.macports.postgresql84-server.plist
$ sudo launchctl load /Library/LaunchDaemons/org.macports.postgresql84-server.plist

Vedere anche : http://www.jonathandean.com/2011/08/postgresql-8-4-on-mac-os-x-10-7-lion/

Oppure:

    1) Using the superuser account you can query the location of the data directory through SQL:
    # select name, setting from pg_settings where name = 'data_directory';

    2) With that information you can supply the data directory to the pg_ctl command using the -D switch:
    $ sudo su
    # su postgres
    $ pg_ctl -D PATH restart

    Thanks to: http://stackoverflow.com/questions/7990539/restarting-postgres-on-mac