测试日志

win7+leanote+mongodb+nginx+php

1、安装数据库Mongodb

下载地址https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.5-signed.msi

 

Mongodb安装服务
D:\MongoDB>mongod --install --logpath=d:\MongoDB\logs --auth --bind_ip 127.0.0.1 --port 59983 --dbpath=d:\MongoDB\data
安装好服务之后,先不启动,用命令行无验证启动下,

D:\MongoDB>mongod --logpath=d:\MongoDB\logs --bind_ip 127.0.0.1 --port 59983 --dbpath=d:\MongoDB\data

连接数据库添加权限
D:\MongoDB>mongo --host 127.0.0.1 --port 59983
2015-08-19T00:37:38.351+0800 I CONTROL  Hotfix KB2731284 or later update is not
installed, will zero-out data files
MongoDB shell version: 3.0.5
connecting to: 127.0.0.1:59983/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
>

 

2、安装leanote

官网 http://leanote.org/

下载leanote http://pan.baidu.com/s/1nt7mONB

解压

导入leanote数据
mongorestore -h 127.0.0.1 --port 59983 -d leanote --dir d:\leanote\mongodb_backup\leanote_install_data

    导入成功的数据已经包含2个用户

    user1 username: admin, password: abc123 (管理员, 只有该用户可以管理后台) 
    user2 username: [email protected], password: [email protected] (仅供体验使用)

添加mongo数据库用户,使用mongoVUE或者命令行
leanote
OhyesGo4Mo

db.createUser({
    user: 'leanote',
    pwd: 'Oh',
    roles: [{role: 'dbOwner', db: 'leanote'}]
});

最后
d:\leanote\bin>run.bat
listen 9000

即运行成功

 

 

3、nginx反代及401 Basic认证配置

 

修改nginx配置

    server {
        listen       80;
        server_name  tra.cker.in ;

        location / {

             proxy_redirect off ;
             #proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header REMOTE-HOST $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             client_max_body_size 50m;
             client_body_buffer_size 256k;
             proxy_connect_timeout 30;
             proxy_send_timeout 30;
             proxy_read_timeout 60;
             proxy_buffer_size 256k;
             proxy_buffers 4 256k;
             proxy_busy_buffers_size 256k;
             proxy_temp_file_write_size 256k;
             proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
             proxy_max_temp_file_size 128m;
            proxy_pass    http://127.0.0.1:9000;
            proxy_set_header Host "godblind.xicp.net";

            auth_basic            "Auth Restricted";
            auth_basic_user_file  webpass;        }
        }

 

 

webpass文件放在nginx\conf\目录下,存储的是htpasswd加密的用户密文,

htpasswd -dmbc webpass 用户名 密码。

源链接

Hacking more

...