Friday, July 6, 2012

Set up mongodb and cluster

install mongodb

install rock_mongo

  • sudo apt-get install php-pear
  • install php_mongo extension: sudo pecl install mongo
  • configure php_mongo extension: add extension=mongo.so to /etc/php5/apache2/php.ini
  • download rock_mongo and cp -r to /var/www/vhosts/mongo.admin
  • configure dnamasq alias "*admin"now Apache, map a "mongo.admin" to a vhost. 
  • (For Replication web admin) cat /etc/apache2/mods-enabled/vhost_alias.conf
    • set up url rewrite
      RewriteCond %{HTTP_HOST} ^mongo.dev$
      RewriteRule (.*) http://localhost:28017/_replSet
  • sudo service apache2 restart