“安装笔记” 标签页面:

  • 安装aria2及使用yaaw配置WebGUI界面

    现在一般的linux发行版的gcc都不太新,而aria2 1.18之后需要gcc 4.8,所以只能装之前的版本咯。反正下载功能没有区别,都支持http、ftp、bt、magnet磁力链接等协议。

    wget http://jaist.dl.sourceforge.net/project/aria2/stable/aria2-1.17.1/aria2-1.17.1.tar.gz
    tar zxf aria2-1.17.1.tar.gz
    cd aria2-1.17.1
    ./configure --prefix=/usr/local/blog.creke.net/aria2 --enable-static=true --enable-shared=true --enable-libaria2 --with-tcmalloc --with-sqlite3=/usr/local
    #注:configure输出最主要看Xml-RPC是yes就行
    make
    make install

    然后摸一下session文件:

    touch /home/blog.creke.net/work/aria2/aria2.session

    配置(/home/blog.creke.net/work/aria2/aria2.conf):

    #Basic
    dir=/home/blog.creke.net/work/aria2/download
    continue=true

    #HTTP
    user-agent=Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0

    #BT
    enable-dht=true
    seed-time=0
    dht-listen-port=6882
    dht-entry-point=loki.uplinklabs.net:33445

    #network
    max-overall-download-limit=5M
    max-overall-upload-limit=1M
    max-upload-limit=512K

    #RPC
    enable-rpc=true
    #rpc-listen-all=true
    rpc-allow-origin-all=true
    rpc-listen-port=35002
    #rpc-user=none
    #rpc-passwd=none

    #Advanced

    配置nginx代理aria2的jsonrpc:

    location /aria2/jsonrpc {
    proxy_pass http://localhost:35002/jsonrpc;
    proxy_redirect off;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    安装web gui:

    wget https://github.com/binux/yaaw/archive/master.zip
    mv master yaaw.zip
    unzip yaaw.zip
    mv yaaw-master/ yaaw/

    值得一提的是,yaaw不支持用户名密码,所以用nginx进行反向代理。修改
    打开yaaw的js目录中aria2.js和yaaw.js,搜寻端口号,改成自己定义的端口号和路径。

    附:init.d适用的自动启动脚本如下:

    #! /bin/sh
    # chkconfig: 2345 55 25
    # Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
    # run 'update-rc.d -f nginx defaults', or use the appropriate command on your
    # distro. For CentOS/Redhat run: 'chkconfig --add aria2'

    ### BEGIN INIT INFO
    # Provides:          aria2c
    # Required-Start:    $all
    # Required-Stop:     $all
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: starts aria2c
    # Description:       starts aria2c as a service
    ### END INIT INFO

    # Author:   Creke
    # website:  http://blog.creke.net/

    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DESC="aria2c daemon"
    NAME=aria2c
    DAEMON=/usr/local/blog.creke.net/aria2/bin/$NAME
    CONFPATH=/home/blog.creke.net/work/aria2/aria2.conf
    SESSION=/home/blog.creke.net/work/aria2/aria2.session
    #PIDFILE=/usr/local/haproxy/etc/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    USER="blog.creke.net"

    set -e
    [ -x "$DAEMON" ] || exit 0

    do_start() {
    su - $USER -c "$DAEMON --conf-path=$CONFPATH -D --input-file=$SESSION --save-session=$SESSION" || echo -n "aria2c already running"
    }

    do_stop() {
    killall -INT $NAME || echo -n "aria2c not running"
    }

    do_reload() {
    kill -HUP $NAME || echo -n "aria2c can't reload"
    }

    case "$1" in
    start)
    echo -n "Starting $DESC: $NAME"
    do_start
    echo "."
    ;;
    stop)
    echo -n "Stopping $DESC: $NAME"
    do_stop
    echo "."
    ;;
    reload|graceful)
    echo -n "Reloading $DESC configuration..."
    do_reload
    echo "."
    ;;
    restart)
    echo -n "Restarting $DESC: $NAME"
    do_stop
    do_start
    echo "."
    ;;
    *)
    echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
    exit 3
    ;;
    esac

    exit 0

     

    2016.08.30 / 暂无评论 / 1,285 次点击 / 分类: 所谓技术

  • Zabbix安装简记

    安装zabbix:

    wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
    tar zxf zabbix-2.2.6.tar.gz
    cd zabbix-2.2.6
    ./configure --prefix=/usr/local/zabbix --enable-server --with-mysql=/usr/local/mysql/bin/mysql_config --with-libcurl --enable-proxy --enable-agent
    make
    make install

    配置zabbix:

    编辑/usr/local/zabbix/conf/zabbix_server.conf。按照自己的需求对照编辑即可。

    配置开机自动启动服务:

    cd zabbix-2.2.6/misc/init.d/fedora
    cp core5/zabbix_server /etc/init.d/

    编辑/etc/init.d/zabbix_server其中的ZABBIX_BIN的值为"/usr/local/zabbix/sbin/zabbix_server"

    增加用户组及用户:

    groupadd -g 601 zabbix
    useradd -u 601 -s /sbin/nologin -d /dev/null -M -g zabbix zabbix

    导入初始数据库:

    cd zabbix-2.2.6/database/mysql
    mysql -ucreke -p
    > use creke_zabbix;
    > source schema.sql;
    > source images.sql;
    > source data.sql;
    > quit;

    复制php前端:

    cp -r zabbix-2.2.6/frontends/php /home/wwwroot/default/zabbix
    cd /home/wwwroot/default/zabbix
    cp conf/zabbix.conf.php.example conf/zabbix.conf.php
    编辑conf/zabbix.conf.php的数据库配置

    默认帐号:admin,密码:zabbix

    Zabbix简要安装说明,也只是装着玩玩,并没有深究。一般情况下,个人的服务器监控需求,还是使用监控宝、360网站监控之类的服务,会比自己搭建维护成本低。

     

    2016.08.29 / 暂无评论 / 965 次点击 / 分类: 所谓技术