博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
从零开始搭建nutch搜索引擎
阅读量:4136 次
发布时间:2019-05-25

本文共 1436 字,大约阅读时间需要 4 分钟。

  1. 我载nutch1.2并解压:
  2. # wget http://apache.etoak.com//nutch/apache-nutch-1.2-bin.tar.gz .
    # tar zxvf apache-nutch-1.2-bin.tar.gz
  3. 下载tomcat6并解压:
  4. # wget http://apache.etoak.com/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
    # tar zxvf apache-tomcat-6.0.32.tar.gz
  5. 设置JAVA环境变量
  6. 在~/.bashrc结尾处添加:export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre,重启终端后生效。
  7. 配置nutch
  8. 创建初始url文件,并写入一个(或多个)url # cd nutch-1.2
    # mkdir urls.test
    # echo http://www.sina.com/ > urls.test/iniurls
    修改文件conf/crawl-urlfilter.txt:将MY.DOMAIN.NAME替换为sina.com,或者干脆去掉,只留+^http:// 修改文件conf/nutch-default.xml:将http.agent.name的value写为my nutch agent(或其他任意值)
  9. 开始抓取网络数据
  10. # ./bin/nutch crawl urls.test/iniurls -depth 3 >& crawl.log
    运行完毕后生成文件夹crawl-20110513015802(文件名标识开始爬虫开始时间),若想指定文件夹名字,可在上述命令中加参数 -dir dirname
  11. 配置搜索引擎
  12. 进入apache-tomcat-6.0.32/webapps/ROOT #cd ../apache-tomcat-6.0.32/webapps/ROOT/
    删除所有文件 # rm -rf * 解压nutch-1.2/nutch-1.2.war到上述目录
    # jar xvf nutch-1.2.war
    修改apache-tomcat-6.0.32/webapps/ROOT/WEB-INF/classes/nutch-site.xml,导入已爬取的网络数据的数据库
  13. 测试搜索引擎
  14. 开启tomcat6
    # cd apache-tomcat-6.0.32
    # ./bin/startup.sh
    若以上顺利,在浏览器中输入http://localhost:8080,会见到nutch的搜索界面
  15. 未完待续(修正中文乱码问题)

转载地址:http://hkavi.baihongyu.com/

你可能感兴趣的文章
Linux initial RAM disk (initrd) overview
查看>>
HOWTO: Booting from SD card using U-Boot
查看>>
HOWTO: Booting from SD card using U-Boot
查看>>
Timestamping Linux kernel printk output in dmesg for fun and profit
查看>>
file lock in the Linux system
查看>>
Increase the android VM heap size.
查看>>
A successful Git branching model
查看>>
Use ADB to connect phone with Windows 7 over tcp
查看>>
The Four-Way Handshake
查看>>
802.11 Authentication and Association
查看>>
Open System authentication
查看>>
Wireless Operating Modes
查看>>
Wifi Connection
查看>>
802.11 Scan and Discovery
查看>>
RTS/CTS协议 (Both wlan and com are using it)
查看>>
Wireless Ad-Hoc Network – Linux
查看>>
802.11ac and 802.11ad
查看>>
IEEE 802 LAN/MAN Standards Committee
查看>>
AES算法分析与实现
查看>>
802.11 Four-way handshake Messages
查看>>