手撕包菜磁力搜索12月新版安装教程

操作系统:centos7.0 64位

一.确认python版本,获取ssbc源代码,关闭防火墙
1.环境检测(ssbc当前版本是基于django1.8.1开发,所需python环境为python2.7.5以上。)
python -V
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop iptables.service
systemctl disable iptables.service
2.获取ssbc安装包并解压
wget https://github.com/78/ssbc/archive/master.zip
yum -y install unzip
unzip master.zip
解压后 源码在/root/ssbc-master目录
二.安装MariaDB,创建数据库
1.安装数据库及所需环境
yum -y install gcc
yum -y install gcc-c++
yum -y install python-devel
yum -y install mariadb
yum -y install mariadb-devel
yum -y install mariadb-server
cd ssbc-master
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
pip install -r requirements.txt
pip install pygeoip
2.创建ssbc数据库
systemctl start mariadb.service
mysql -uroot -p
Enter password: (回车即可)
create database ssbc default character set utf8;
quit;
三. 建立文件夹
创建以下文件夹并赋予755权限
mkdir -p /data/bt/index/db /data/bt/index/binlog /tem/downloads
chmod 755 -R /data
chmod 755 -R /tem
四. 安装Sphinx并生成索引

yum -y install unixODBC unixODBC-devel postgresql-libs
wget http://sphinxsearch.com/files/sphinx-2.2.9-1.rhel7.x86_64.rpm
rpm -ivh sphinx-2.2.9-1.rhel7.x86_64.rpm
systemctl restart mariadb.service
systemctl enable mariadb.service
searchd --config ./sphinx.conf
python manage.py makemigrations
python manage.py migrate
indexer -c sphinx.conf --all

确定没有报错,继续下一步
五.启动网站、爬虫、索引,添加网站管理员
nohup python manage.py runserver 0.0.0.0:80 >/dev/zero &
//启动网站并在后台运行
按回车键继续
浏览器输入http://IP,网站能打开
cd workers
执行: python simdht_worker.py
等2分钟出现数据之后CTRL+C停止,此脚本作用是获取DHT资源
执行: nohup python simdht_worker.py >/dev/zero & 让爬虫在后台运行
按回车键继续
执行: python index_worker.py
等待2分钟出现数据后CTRL+C停止,此脚本作用是每10分钟定时索引
执行: nohup python index_worker.py >/dev/zero & 让定时索引在后台运行
按回车键继续
增加后台管理员
cd ..
python manage.py createsuperuser
输入管理员用户名
输入管理员邮箱
输入管理员密码
确认密码,完成
管理员登录地址:http://IP/admin

点赞