User-Profile-Image
hankin
  • 5
  • 首页
  • 分类
    • Windows
    • Web
    • VoIP
    • Virtualization
    • Trading
    • Smart Home
    • SEO
    • Security
    • Python
    • Program
    • PHP
    • OSX
    • OS
    • OpenSource
    • Nginx
    • MySQL
    • Mood
    • Linux
    • Life
    • Injection
    • Hosting
    • Finance
    • Exploits
    • CDN
  • 页面
    • About
  • 友链
    • 维酷科技
    • Tesra超算网络
Help?

Please contact us on our email for need any support

Support
  • 首页
    首页   ›   Program   ›   Python   ›   正文
Python

SSBC手撕包菜安装配置教程(DHT磁力搜索源码)

2016-09-25 05:14:56
3438  0 0

1、环境配置

[root@localhost ~]# python -V //执行python -V即可获取当前版本
Python 2.7.5
[root@localhost ~]# systemctl stop firewalld.service //关闭firewall防火墙
[root@localhost ~]# systemctl disable firewalld.service //禁止firewall防火墙开机启动
[root@localhost ~]# systemctl stop iptables.service //关闭iptables防火墙
[root@localhost ~]# systemctl disable iptables.service //禁止iptables防火墙开机启动

使用lnmp一键安装包安装Web及数据库环境并给ssbc创建一个数据库
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config


[root@localhost ~]# wget https://github.com/78/ssbc/archive/master.zip
[root@localhost~]# yum -y install unzip
[root@localhost~]# unzip master.zip
[root@localhost ~]# cd ssbc-master
[root@localhost ssbc-master]# wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
[root@localhost ssbc-master]# python get-pip.py
[root@localhost ssbc-master]# pip install -r requirements.txt

yum -y install gcc gcc-c++ python-devel mysql-server

建立文件夹

[root@localhost ssbc-master]# mkdir -p /data/bt/index/db /data/bt/index/binlog /tem/downloads
[root@localhost ssbc-master]# chmod 755 -R /data
[root@localhost ssbc-master]# chmod 755 -R /tem

2、安装Spinx并生成索引

[root@localhost ssbc-master]# yum -y install unixODBC unixODBC-devel postgresql-libs
[root@localhost ssbc-master]# wget http://sphinxsearch.com/files/sphinx-2.2.9-1.rhel7.x86_64.rpm
[root@localhost ssbc-master]# rpm -ivh sphinx-2.2.9-1.rhel7.x86_64.rpm
[root@localhost ssbc-master]# systemctl restart sphnix.service

[root@localhost ssbc-master]# indexer -c sphinx.conf --all //(all 前面是空格减号减号)
[root@localhost ssbc-master]# searchd --config ./sphinx.conf //(config前是空格减号减号)

3、Django初始化并启动

[root@localhost ssbc-master]# python manage.py makemigrations
[root@localhost ssbc-master]# python manage.py migrate
[root@localhost ssbc-master]# nohup python manage.py runserver 0.0.0.0:87 >/dev/zero &

4、爬虫运行及入库

执行:[root@localhost ssbc-master]# python simdht_worker.py 等2分钟出现数据之后CTRL+C停止

执行:[root@localhost ssbc-master]# python index_worker.py 等待10分钟没有出现数据后CTRL+C停止

错误汇总

ln -sf /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config

ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config

sphinx安装错误
yum install mysql-devel

Ubuntu 安装事项

apt-get update
apt-get install -y –force-yes build-essential autoconf libtool libssl-dev curl
apt-get install python-pip git python-m2crypto

apt-get install python2.7 python2.7-dev python3.2 python3.2-dev

去除搜索页 右下角广告
[root@localhost ssbc-master]# cd web/static/js
[root@localhost ssbc-master]# vi ssbc.js 找到如下3行,在前面添加//进行注释,保存
// document.write(‘");
// document.writeln("");

中文搜索乱码解决办法:
搜索中文报UnicodeEncodeError错误,

修改python下的site.py centos7 是/usr/lib64/python2.7/site.py
在import sys下添加2行:
reload(sys)
sys.setdefaultencoding('utf8')

修改/etc/my.cnf (mysql错误2006)
wait_timeout=3000
interactive_timeout=3000
max_allowed_packet=64M

评论 (0)

Click here to cancel reply.

欢迎您 游客  

    ProdigYu
    180文章 77评论 4点赞 554152浏览
    随机文章
    aria2 — Linux 下载工具
    12年前
    CentOS7 Minimal安装后的基本设置
    10年前
    lnmp一键包nginx加装ngx_cache_purge缓存清理模块
    5年前
    vscode不能自动补全HTML代码怎么配置
    5年前
    Mac中如何像windows快速浏览多张图片
    5年前
    Tags
    Apache CentOS CMD DDOS Debian DNS Docker FastCGI Google IIS IP iptables Linux Mac MySQL Nginx Opensource PHP Python Skill SSH Ubuntu Vim VMware VPN web.py Windows 删除 命令 命令提示符 安装 开源 技巧 插件 漏洞 百度 系统 组件 终端 缓存 网络电话 脚本 自建 详解 错误
    Meta
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Copyright © 2025
    主页
    页面
    • About
    博主
    ProdigYu 管理员
    Something about myself
    180 文章 77 评论 554152 浏览
    测试
    测试