# 爱百应 - 百度云搜索引擎,安装部署教程
## 运行环境
开始之前你需要安装
* PHP 5.3.7 +
* MySQL
* Python 2.7 ~
* [xunsearch](http://xunsearch.com/) 搜索引擎
## 获取源码
```
git clone git@github.com:k1995/BaiduyunSpider.git
```
或手动下载
```
https://github.com/k1995/BaiduyunSpider/archive/master.zip
```
下载完毕后,___项目的目录结构___大致是这样的
```
--- indexer/ #索引
--- spider/ #爬虫
--- sql/
--- web/ #网站
--- application/
--- config/ # 配置相关
--- config.php
--- database.php # 数据库配置
...
...
--- static/ # 存放静态资源,css|js|font
--- system/
--- index.php
...
```
## 开始部署
### 创建数据库
创建名为`pan`的数据库,编码设为`utf-8`。然后导入`sql`,完成表的创建。
### 网站部署
支持`nginx`,`apache` 服务器。
__apache__ 需要开启 *mod_rewrite* 。
__nginx__ 配置如下
```
location /
{
index index.php;
try_files $uri $uri/ /index.php/$uri;
}
location ~ [^/]\.php(/|$)
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}
```
#### 配置文件修改
`config.php` 文件修改网站标题,描述等信息
`database.php` 修改数据库账号,密码等信息
> 网站是基于CodeIgniter 框架开发的,如安装,部署,或二次开发有问题,请参考[官网文档]( http://codeigniter.org.cn/user_guide/general/welcome.html)
### 启动爬虫
进入 `spider/`目录,修改`spider.py` 中数据库信息。
__如果你是第一次部署,需运行下面命令,完成做种__
```
python spider.py --seed-user
```
上面其实就是抓取百度云热门分享用户的相关信息,然后从他们开始入手爬取数据
然后运行
```
python spider.py
```
此时爬虫已经开始工作了
### 安装xunsearch
目前使用__xunsearch__作为搜索引擎,后面会更换为`elasticsearch`。
安装过程请参考(不需要安装,PHP SDK,我已经整合到web里了)
http://xunsearch.com/doc/php/guide/start.installation
### 索引数据
上面我们完成了爬虫的数据抓取,网站的搭建,但还不能搜索,下面开始最后一步,索引的建立。
进入 `indexer/`目录,在`indexer.php`中将$prefix,替换为你web的根路径
```
require '$prefix/application/helpers/xs/lib/XS.php';
```
并修改数据库账号密码
然后运行
```
python ./index.php
```
到此为止程序已全部安装完毕,若有疑问请在 [github 中文社区](http://www.githubs.cn/topic/118) 发帖
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
PHP磁力搜索引擎百度云盘搜索引擎爬虫源码.rar (329个子文件)
bootstrap.css 139KB
bootstrap.css 127KB
bootstrap.min.css 115KB
bootstrap-ie6.css 115KB
style.css 2KB
ie.css 1KB
style.css 694B
zzsc.css 0B
glyphicons-halflings-regular.eot 20KB
.htaccess 127B
.htaccess 123B
.htaccess 123B
.htaccess 117B
index.html 142B
index.html 142B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
index.html 131B
favicon.ico 1KB
search.tpl.in 7KB
search.php.in 4KB
suggest.php.in 746B
pan.ini 442B
demo.ini 183B
微信公众号.jpg 20KB
微信公众号.jpg 20KB
微信公众号.jpg 20KB
logo.jpg 4KB
pix.jpg 1KB
bootstrap.js 68KB
bootstrap.min.js 35KB
base64.js 7KB
zzsc.js 5KB
base64.min.js 4KB
login_verify.js 2KB
XS.php 80KB
DB_query_builder.php 61KB
Simple_html_dom.php 57KB
Email.php 49KB
DB_driver.php 43KB
Image_lib.php 42KB
Xmlrpc.php 40KB
Form_validation.php 36KB
Loader.php 35KB
Http_proxy.php 34KB
parser.php 34KB
Upload.php 30KB
Security.php 27KB
Jquery.php 25KB
XSDataSource.class.php 24KB
DB_forge.php 23KB
Encryption.php 23KB
form_helper.php 22KB
Input.php 22KB
Common.php 21KB
Javascript.php 20KB
Session.php 20KB
Profiler.php 20KB
共 329 条
- 1
- 2
- 3
- 4
资源评论
依星net188.com
- 粉丝: 7784
- 资源: 2098
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功