Nutch是一个完整的开源全文检索软件,它是建立在lucene java之上增加,增加了一些web特性,
如网络爬虫,link-graph数据库,HTML文本解析和其他格式文档解析,等等。
下载nutch
1.选择安装nutch的目录,我就直接安装到/home/admin下
[root@search-test1 ~]# cd /home/admin/
2.下载nutch-1.0:
[root@search-test3 admin]# wget "http://labs.xiaonei.com/apache-mirror/lucene/nutch/nutch-1.0.tar.gz"
3.解压nutch-1.0.war,建立软链
[root@search-test3 admin]# tar -zxf nutch-1.0.tar.gz
[root@search-test3 admin]# ln -s nutch-1.0 nutch
/home/admin下nutch的目录列表
[root@search-test3 admin]# ll|grep 'nutch'
lrwxrwxrwx 1 root root 9 01-12 14:57 nutch -> nutch-1.0
drwxr-xr-x 9 root root 4096 2009-03-24 nutch-1.0
-rw-r--r-- 1 root root 86557549 2009-03-28 nutch-1.0.tar.gz
内部爬虫的配置
1.在/home/admin/nutch下建立一个urls目录,在urls下建立一个taizhou.txt,爬台州的一个网站(很多大的网站对这中野爬虫都做了屏蔽,最后才选择了taizhou.com)。
[root@search-test3 nutch]# mkdir /home/admin/nutch/urls;touch /home/admin/nutch/urls/taizhou.txt
.....
[root@search-test3 nutch]# cat /home/admin/nutch/urls/taizhou.txt
http://www.taizhou.com
2.编辑conf/crawl-urlfilter.txt,替换“MY.DOMAIN.NAME”为“taizhou.com”,如下所示:
+^http://([a-z0-9]*\.)*taizhou.com/
3.编辑conf/nutch-site.xml,配置爬虫携带的http头的信息,这里只是部分属性
[root@search-test3 conf]# cat nutch-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>http.agent.name</name>
<value>8qiu-spider</value>
<description>HTTP 'User-Agent' request header. MUST NOT be empty -
please set this to a single word uniquely related to your organization.
NOTE: You should also check other related properties:
http.robots.agents
http.agent.description
http.agent.url
http.agent.email
http.agent.version
and set their values appropriately.
</description>
</property>
<property>
<name>http.agent.description</name>
<value>this is a crawler of 8qiu</value>
<description>Further description of our bot- this text is used in
the User-Agent header. It appears in parenthesis after the agent name.
</description>
</property>
<property>
<name>http.agent.url</name>
<value>www.8qiu.com</value>
<description>A URL to advertise in the User-Agent header. This will
appear in parenthesis after the agent name. Custom dictates that this
should be a URL of a page explaining the purpose and behavior of this
crawler.
</description>
</property>
<property>
<name>http.agent.email</name>
<value>javalover@yeah.net</value>
<description>An email address to advertise in the HTTP 'From' request
header and User-Agent header. A good practice is to mangle this
address (e.g. 'info at example dot com') to avoid spamming.
</description>
</property>
</configuration>
4.启动爬虫程序
/home/admin/nutch/bin/nutch crawl /home/admin/nutch/urls/ -dir /home/admin/nutch/crawl -depth 3 -topN 100
安装Web运行环境
1.安装tomcat,我的tomcat目录/usr/local/tomcat
2.把nutch.1.0的war包移到webapp目录下
mv nutch-1.0.jar /usr/local/tomcat/webapps/
3.启动tomcat
[root@search-test3 nutch]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.6.0_10
必须要在/home/admin/nutch下敲如下命令,切记,否则它会找不到/home/admin/nutch/crawl目录
启动完成之后,检查一下tomcat的日子:/usr/local/tomcat/logs/catalina.out
如果一切都正常, http://192.168.110.12:8080/nutch-1.0/search.jsp,就能搜索到结果了
分享到:
相关推荐
Nutch 是一个开源Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。包括全文搜索和Web爬虫。
Eclipse 中编译 Nutch-1.0 运行源代码
nutch-1.0-dev.jar nutch devlope
Nutch-1.0分布式安装手册.rar,完整的
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
$ tar zxvf nutch-1.0.tar.gz 在e盘下面出现nutch-0.9文件夹说明解压成功了.然后环境变量设置为NUTCH_JAVA_HOME=C:\Program Files\Java\jdk1.5.0(也就是说跟JAVA_HOME是相同的).测试nutch是否安装成功,只需要执行...
Nutch 是一个开源Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。包括全文搜索和Web爬虫。
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。 nutch 1.0
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。 nutch 1.0
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。 nutch 1.0
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
Nutch 是一个开源的、Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。
ant-eclipse-1.0 nutch
apache-nutch-2.3.1-src.tar.gz
apache-nutch-1.19 java编写的网络爬虫项目,可用于生产环境的高度可扩展、可伸缩的网络爬虫
nutch配置nutch-default.xml
基于Apache Nutch 1.8和Htmlunit组件,实现对于AJAX加载类型页面的完整页面内容抓取解析。 According to the implementation of Apache Nutch 1.8, we can't get dynamic ...