巡风安装

目录

 

参考资料

下载mongodb

设置mongo环境变量

文档中启动数据库mongo 127.0.0.1:65521/xunfeng

调试run.py:

成功后开启流程


参考资料

巡风是用python的web框架flask写的

https://xycsec.cn/?p=151

https://www.cnblogs.com/bayueman/articles/6604507.html

官方部署

https://www.anquanke.com/post/id/85165

 

github

https://github.com/ysrc/xunfeng

安装pip

https://jingyan.baidu.com/article/ff42efa9d630e5c19e220207.html

pip自动生成和安装requirements.txt

https://blog.csdn.net/NockinOnHeavensDoor/article/details/80340820

pip freeze > requirements.txt

pip install -r requirements.txt

Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

Looking in indexes: http://pypi.douban.com/simple/

用pip安装依赖库这一步遇到点问题

 

pip install -r requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

failed with error code 1 in c:\users\lenovo\appdata\local\temp\pip-build-y1omou\pycrypto\

pip install -r requirements.py -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

报错Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' 按百度查的解决方法做了之后,变成只有Looking in indexes: http://pypi.douban.com/simple/的提示,还是没装上依赖库

卸载pip

python -m pip uninstall pip

安装包解压问题

https://blog.csdn.net/cn_1937/article/details/81449484

--extra-index-url

pip install --extra-index-url http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

ERROR: You must give at least one requirement to install (see "pip help install")

关于requirements.txt介绍https://www.jb51.net/article/107325.htm

解决You are using pip version 9.0.1, however version 9.0.3 is available. You should consider upgra

python -m pip install --upgrade pip

解决python “No module named pip

python -m ensurepip

easy_install pip

requirements.txt文件在巡风下载的文件下

running build_ext

    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

    building 'Crypto.Random.OSRNG.winrandom' extension

error: [WinError 3] 系统找不到指定的路径。: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'

http://ju.outofmemory.cn/entry/356779

https://blog.csdn.net/yingzoe/article/details/81095044

pycrypto模块编译需要依赖Visual C++ 14.0的编译工具,Build Tools

https://blog.csdn.net/bbhdeal/article/details/81144783

解决:error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

building 'Crypto.Random.OSRNG.winrandom' extension

https://blog.csdn.net/a624806998/article/details/78596543

VCINSTALLDIR

VCINSTALLDIR

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC

 

报错:

Command "d:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\lenovo\\appdata\\local\\temp\\pip-build-y1omou\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\lenovo\appdata\local\temp\pip-x13ed1-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\lenovo\appdata\local\temp\pip-build-y1omou\pycrypto\

下载mongodb

启动数据库

DBData为指定的数据库保存路径

mongod.exe --port 65521 --dbpath D:\Program Files\MongoDB\DBData

解决目标计算机积极拒绝

https://blog.csdn.net/weixin_37807794/article/details/80568728

mongod.exe --port 65521 --dbpath "D:\Program Files\MongoDB\DBData"

 

2018-09-21T19:20:06.719-0700 I STORAGE  [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: D:\Program Files\MongoDB\DBData, terminating

 

数据库存储路径只读,换D:\MongoDB\DBData

mongod.exe --port 65521 --dbpath "D:\MongoDB\DBData"

 

在bin下启动服务net start mongodb

Mongodb使用:https://jingyan.baidu.com/article/6b97984dbeef881ca2b0bf3e.html

https://www.cnblogs.com/lemon-le/p/7132038.html

账号密码:'scan',pwd:'your password'

mongorestore导入数据库

 

启动服务

D:\Program Files\MongoDB\Server\3.4\bin

mongod.exe --port 65521

停止服务: 

Ctrl + c 关闭mongodb服务

导入数据库

db 文件夹位于xunfeng代码目录中:

https://blog.csdn.net/qq_16399991/article/details/70473929

mongorestore.exe -h 127.0.0.1 --port 65521 -d xunfeng db

解决:[ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK

https://blog.csdn.net/dashen180309/article/details/81138730

 

the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead

2018-09-27T18:52:56.026+0800    Failed: mongorestore target 'db' invalid: GetFileAttributesEx db: The system cannot find the file specified.

解决Failed: mongorestore target 'dump' invalid: GetFileAttributesEx dump: The system cannot find the file specified.

mongorestore.exe -h 127.0.0.1 --port 65521 -d xunfeng  --dir "D:\Program Files\xunfeng\db"

windows找不到文件’mongod.exe’请确定文件名是否正确后再试一次

巡风地址D:\Program Files\xunfeng-master

Mongo计算机积极拒绝,data log config

start "D:\Program Files\xunfeng-master\Run.bat"

启动:http://127.0.0.1:8000/

设置mongo环境变量

https://www.cnblogs.com/tim100/p/6721415.html

不通过创建服务的方式,我们也可以在bin目录下打开命令行输入: mongod.exe --dbpath "d://MongoDB//data" --logpath "d://MongoDB//log//mongodb.log" --logappend

  同样可以启动MongoDB 

  (解析:mongod --dbpath 命令是创建数据库文件的存放位置,启动mongodb服务时需要先确定数据库文件存放的位置,否则系统不会自动创建,启动会不成功。)

--logpath 表示日志文件存放的路径     --logappend  表示以追加的方式写日志文件

bin目录下创建windows服务:

sc create mongodb binPath= "d:\MongoDB\Server\3.4\bin\mongod.exe --service --dbpath d:\MongoDB\data --logpath=d:\MongoDB\log\mongodb.log --logappend --directoryperdb"

修改为本地路径执行:

sc create mongodb binPath= "D:\Program Files\MongoDB\Server\3.4\bin\mongod.exe --service --dbpath d:\MongoDB\DBData --logpath=d:\MongoDB\log\mongodb.log --logappend --directoryperdb"

services.msc查看服务,启动失败

配置环境变量:在path中加入mongobin目录

解决:Failed to connect to 127.0.0.1:27017, reason: 由于目标计算机积极拒绝,无 法连接。

https://www.cnblogs.com/meitian/p/4614389.html

在启动Mongo时出现了错误:Failed to connect 127.0.0.1:27017,reason:errno:10061由于目标计算机积极拒绝,无法连接

原因:必须先启动Mongod才可以去启动Mongo

启动Mongod服务

https://blog.csdn.net/wangyibo5843/article/details/52070791

http://www.runoob.com/mongodb/mongodb-window-install.html

创建cfg配置文件

systemLog:

    destination: file

    path: c:\data\log\mongod.log

storage:

    dbPath: c:\data\db

启动

mongod.exe --config "D:\Program Files\MongoDB\Server\3.4\bin\mongod.cfg" --install

读取配置文件时出错:参数无效有可能是因为粘贴路径时有空格

显示:

2019-02-23T13:56:50.884+0800 I CONTROL  [main] log file "D:\MongoDB\log\MongoDB.log" exists; moved to "D:\MongoDB\log\MongoDB.log.2019-02-23T05-56-50".

删除服务后再次添加服务,这次没有输出,启动成功

启动服务时net start MongoDB

发生系统错误 1067

进程意外终止。

移除 MongoDB 服务:mongod.exe remove

启动服务成功后可直接在cmd中mongo:

mongod.exe --install --logpath=F:\PHP\mongo\log\mongo.log --dbpath=F:\PHP\mongo\data

有的mongodb版本不支持--config,那么就直接这样:

mongod --logpath "E:\mongodb\log\MongoDB.log" --logappend --dbpath "E:\mongodb\data" --directoryperdb --serviceName "mongodb" –install

设置log

mongod.exe --port 65521 --dbpath "D:\MongoDB\DBData"

mongod.exe --install  --dbpath "D:\MongoDB\DBData" --logpath "D:\MongoDB\log\mongo.log"

mongod.exe --port 65521 --dbpath "D:\MongoDB\DBData" --logpath "D:\MongoDB\log\mongo.log" --logappend

 

https://blog.csdn.net/lycit/article/details/78523580

https://blog.csdn.net/u013249965/article/details/52318920

尝试启动cmd时增加权限,X

 

文档中启动数据库mongo 127.0.0.1:65521/xunfeng

https://www.jb51.net/article/135439.htm?utm_source=debugrun&utm_medium=referral

添加--auth参数授权启动

localhost,127.0.0.1 和 本机IP 三者的区别

1、127.0.0.1是回送地址,指本地机,一般用来测试使用。回送地址是本机回送地址(Loopback Address),即主机IP堆栈内部的IP地址,主要用于网络软件测试以及本地机进程间通信,无论什么程序,一旦使用回送地址发送数据,协议软件立即返回,不进行任何网络传输。

2、localhost是本地DNS解析的127.0.0.1的域名,这个你打开本机的hosts文件就可以看到,一般位于c:\windows\system32\driver\etc下,一般在最后有这么一行:

127.0.0.1 localhost

而这个localhost你可以随意更改,如果改成百度,新浪之类的www.baidu.com重启你再试一下,就会发现很有意思了。

3、本机IP则指你连到网络上的IP地址,可以是内网地址,当然也可能是公网IP,这个就是你实际利用TCP/IP协议与网上计算机通信时使用的IP了。

 

调试run.py:

https://www.cnblogs.com/bayueman/articles/6604507.html

巡风的Python版本是2.7的,如果是3.*的版本,在运行python run.py时会报错(语法不兼容,抛出异常)应当在环境变量path切换Python以及Python/Scripts两个路径的版本,并重启命令行

成功后开启流程

D:\Program Files\MongoDB\Server\3.4\bin>mongod.exe --port 65521 --dbpath DBData

run.bat

浏览器登录localhost:8000

(端口为自己配置的)

账号admin

密码xunfeng321

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值