Skip to content

Instantly share code, notes, and snippets.

@classpro
Forked from sheikhwaqas/setup-mongodb.sh
Created May 10, 2016 16:39
Show Gist options
  • Save classpro/acec8737782bd36ef13c9556b39d1058 to your computer and use it in GitHub Desktop.
Save classpro/acec8737782bd36ef13c9556b39d1058 to your computer and use it in GitHub Desktop.

Revisions

  1. @sheikhwaqas sheikhwaqas revised this gist Aug 4, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-mongodb.sh
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ ufw allow 27019
    ufw allow 28017

    # Install essential packages
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop
    apt-get -y install git zsh curl htop

    # Install MongoDB Server
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  2. @sheikhwaqas sheikhwaqas revised this gist Feb 19, 2014. 1 changed file with 9 additions and 14 deletions.
    23 changes: 9 additions & 14 deletions setup-mongodb.sh
    Original file line number Diff line number Diff line change
    @@ -8,21 +8,16 @@ dpkg-reconfigure -f noninteractive tzdata
    # Enable Ubuntu Firewall and allow SSH & MySQL Ports
    ufw enable
    ufw allow 22
    ufw allow 3306
    ufw allow 27017
    ufw allow 27018
    ufw allow 27019
    ufw allow 28017

    # Install essential packages
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.5 mysql-server/root_password password root" | sudo debconf-set-selections
    echo "mysql-server-5.5 mysql-server/root_password_again password root" | sudo debconf-set-selections
    apt-get -y install mysql-server-5.5


    # Run the MySQL Secure Installation wizard
    mysql_secure_installation

    sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mysql/my.cnf
    mysql -uroot -p -e 'USE mysql; UPDATE `user` SET `Host`="%" WHERE `User`="root" AND `Host`="localhost"; DELETE FROM `user` WHERE `Host` != "%" AND `User`="root"; FLUSH PRIVILEGES;'

    service mysql restart
    # Install MongoDB Server
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
    echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
    apt-get update
    apt-get install mongodb-10gen
  3. @sheikhwaqas sheikhwaqas created this gist Feb 19, 2014.
    28 changes: 28 additions & 0 deletions setup-mongodb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    # Download and Install the Latest Updates for the OS
    apt-get update && apt-get upgrade -y

    # Set the Server Timezone to CST
    echo "America/Chicago" > /etc/timezone
    dpkg-reconfigure -f noninteractive tzdata

    # Enable Ubuntu Firewall and allow SSH & MySQL Ports
    ufw enable
    ufw allow 22
    ufw allow 3306

    # Install essential packages
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.5 mysql-server/root_password password root" | sudo debconf-set-selections
    echo "mysql-server-5.5 mysql-server/root_password_again password root" | sudo debconf-set-selections
    apt-get -y install mysql-server-5.5


    # Run the MySQL Secure Installation wizard
    mysql_secure_installation

    sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mysql/my.cnf
    mysql -uroot -p -e 'USE mysql; UPDATE `user` SET `Host`="%" WHERE `User`="root" AND `Host`="localhost"; DELETE FROM `user` WHERE `Host` != "%" AND `User`="root"; FLUSH PRIVILEGES;'

    service mysql restart