zoukankan      html  css  js  c++  java
  • Install the mongdb

    #!/bin/bash
    #Function: Install the mongdb
    #Author: WangDonghui
    #Date: 20180124

    #Installing mongdb
    echo "===========Installing mongdb!!!=============="
    mkdir /opt/server/mongodb
    mkdir /opt/server/mongodb/data
    mkdir /opt/server/mongodb/logs
    cd /root/package
    curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.1.tgz
    tar xf mongodb-linux-x86_64-3.2.1.tgz
    cd mongodb-linux-x86_64-3.2.1
    cp -rp * /opt/server/mongodb
    cat > /etc/profile.d/mongo.sh << EOF
    export PATH=$PATH:/home/mongodb/bin

    EOF
    source /etc/profile.d/mongo.sh
    cat >/opt/server/mongodb/mongodb.conf << EOF
    dbpath=/opt/server/mongodb/data
    logpath=/opt/server/mongodb/logs/mongodb.log
    pidfilepath=/opt/server/mongodb/mongodb.pid
    port=27017
    directoryperdb=true
    logappend=true
    oplogSize=2000
    fork=true
    #replSet=
    bind_ip=192.168.20.169

    EOF
    /opt/server/mongodb/bin/mongod -f /opt/server/mongodb/mongodb.conf


    #Installing the php mongdb module
    echo "===========Installing the php mongdb module!!!=============="
    cd /root/package
    wget http://pecl.php.net/get/mongo-1.4.5.tgz
    tar zxf mongo-1.6.14.tgz
    cd mongo-1.6.14
    /opt/server/php/bin/phpize
    ./configure --with-php-config=/opt/server/php/bin/php-config
    make && make install


    cat >>/opt/server/php/lib/php.ini<< EOF
    extension=mongo.so
    EOF

    ps -ef |grep mongdb

    /opt/server/php/bin/php -m


    echo '======install complete '

  • 相关阅读:
    Nodejs学习笔记(三)--- 模块
    Nodejs学习笔记(二)--- 事件模块
    Nodejs学习笔记(一)--- 简介及安装Node.js开发环境
    leetcode题解实践
    坑爹的bugsbunnyctf复现
    两道interesting的题目
    python 习题集
    数据结构与算法--java描述
    pentestbox下运行ssh报错,命令报错
    ntfs交换数据流在隐写
  • 原文地址:https://www.cnblogs.com/donghui521/p/9755864.html
Copyright © 2011-2022 走看看