pwnlandia / mhn

Modern Honey Network
GNU Lesser General Public License v2.1
2.43k stars 630 forks source link

Modify MHN Server install scrips so they work on Debian #102

Closed jatrost closed 5 years ago

jatrost commented 9 years ago

Use the mods that worked in an email from Josh Pyorre:

I was playing around with the guide on https://github.com/threatstream/mhn over the weekend and managed to easily install mhn on an Ubuntu server in a VM. However, I want to install the server portion on a Debian system, since that's what I'm running on a VPS. When one of the scripts attempts to finalize the installation of Mongodb, it stops with the following error (first part left in for context):

Adding group `mongodb' (GID 106) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.

invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100
Setting up mongodb-org-mongos (2.6.5) ...
E: Sub-process /usr/bin/dpkg returned an error code (1) 

After working on it a while, I found the way to get past this and successfully install the server portion on Debian.

Before running any of the scripts (install_hpfeeds.sh, install_mnemosyne.sh and install_honeymap.sh), mongodb should be installed with the following steps:

(sourced from here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/)

Import the public key used by the package management system by issuing the following command to add the MongoDB public GPG Key to the system key ring:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

Create a /etc/apt/sources.list.d/mongodb.list file for MongoDB:

echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Reload local package database:

sudo apt-get update

Install the MongoDB packages:

sudo apt-get install -y mongodb-org-server

Hopefully this helps someone who might be having trouble getting it installed on other systems. I'm sure it would be fairly easy to modify the install scripts to install mongodb on Debian and comment out the Ubuntu mogodb installation.

mortera26 commented 9 years ago

This really helped me thank you very much for your contributions !

d1str0 commented 5 years ago

Currently only supporting latest Ubuntu systems. May support other OSs in the future and will always be open to PRs with working support.