Centos下,手动安装手撕包菜磁力搜索

一.确认python版本,获取ssbc源代码,关闭防火墙

1.环境检测(Ssbc当前版本是基于django1.8.1开发,所需python环境为python2.7.5以上。)

python -V Python 2.7.5 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 gcc-c++ python-devel mariadb mariadb-devel mariadb-server cd ssbc-master wget https://bootstrap.pypa.io/get-pip.py python get-pip.py pip install -r requirements.txt

2.创建ssbc数据库

systemctl start mariadb.service mysql -uroot -p Enter password: MariaDB [(none)]> create database ssbc default character set utf8; MariaDB [(none)]> \q

三.安装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 sphinx.service

四. 建立文件夹,创建以下文件夹并赋予755权限

mkdir  -p  /data/bt/index/db /data/bt/index/binlog  /tem/downloads chmod  755 -R /data chmod  755 -R /tem

五. 生成索引

systemctl restart mariadb.service systemctl enable mariadb.service indexer -c sphinx.conf --all searchd --config ./sphinx.conf

确定没有报错,继续下一步

六.Web主机设置并启动

python manage.py makemigrations python manage.py migrate nohup python manage.py runserver 0.0.0.0:8080 >/dev/zero &

按回车键继续,这里可以使用其他端口然后前端再使用nginx做反向代理。 浏览器输入http://IP:8080,网站能打开

七. 开启爬虫(workers目录下)

cd workers python simdht_worker.py #爬虫运行,等2分钟出现数据之后CTRL+C停止 nohup python simdht_worker.py > /dev/zero #让爬虫在后台运行

按回车键继

python index_worker.py #入库索引,等待10分钟出现数据后CTRL+C停止 nohup python index_worker.py >/dev/zero #让索引在后台运行

按回车键继

增加后台管理员

cd .. python manage.py createsuperuser

输入管理员用户名 输入管理员邮箱 输入管理员密码 确认密码,完成 管理员登录地址:http://IP:8080/admin

转自:https://www.jiloc.com/42351.html

推荐站内搜索:扬州双线服务器、成都虚拟主机免费ip代理、如何注销域名备案、国外虚拟主机ip地址查找、免备案、香港服务器、动态拨号vps主机、河南虚拟主机、