前面做了一個Heritrix1.14.1在Eclipse下的配置總結,那種配置方法雖然可以在Eclipse把Heritrix運作起來,但是存在在WUI下建立JOB時,存在“Modules界面不能改變選擇項”的問題。
是以又試了一下,如果能夠按以下方法配置,即可正常啟動,并且不再發生上面提到的問題。簡要說明如下:
1、下載下傳heritrix-1.14.1-src.zip和heritrix-1.14.1.zip兩個壓縮包,并解壓,以後分别簡稱SRC包和ZIP包;
2、在Eclipse下建立Java項目,取名Heritrix.1.14.1;
3、複制SRC包下面src/java檔案夾下org和st兩個檔案夾到項目中的src包下;
4、複制SRC包下src下conf檔案夾到項目根目錄;
5、複制SRC包下lib檔案夾到項目根目錄;
6、複制ZIP包下webapps檔案夾到項目根目錄;
7、修改項目下conf下heritrix.properties檔案(修改内容同前)
8、在項目上右鍵選擇建構路徑->配置建構路徑->庫頁籤->添加Jar,将lib目錄下的所有.jar檔案選中,點選完成!
9、在項目/src/org.archive.crawler包下Heritrix.java上點選右鍵選運作方式->運作->java應用程式->命名為Heritrix->類路徑頁籤->進階->添加檔案夾->選擇項目下conf檔案夾,最後點選運作
運作後控制台資訊如下:
10:47:59.929 EVENT Starting Jetty/4.2.23
10:48:00.054 WARN!! Delete existing temp dir C:\DOCUME~1\ycf\LOCALS~1\Temp\Jetty_127_0_0_1_8088__ for WebApplicationContext[/,jar:file:/E:/projects/eclipse_workspace/HERITRIX1.14.1b/webapps/admin.war!/]
10:48:00.398 EVENT Started WebApplicationContext[/,Heritrix Console]
10:48:01.163 EVENT Started SocketListener on 127.0.0.1:8088
10:48:01.163 EVENT Started [email protected]
Heritrix version: 1.14.1
heritrix.properties
##############################################################################
# HERITRIX PROPERTIES
##############################################################################
# Properties with prefixes 'heritrix.', 'org.archive.', or 'system.' prefix
# get copied into System.properties on startup so available via
# System.getProperties. (For 'system.' properties, that prefix is stripped.
# (See Heritrix.loadProperties()).
# Version is filled in by the maven.xml pregoal. It copies here the project
# currentVersion property.
heritrix.version = 1.14.1
# Location of the heritrix jobs directory.
heritrix.jobsdir = jobs
# Default commandline startup values.
# Below values are used if unspecified on the command line.
heritrix.cmdline.admin = admin:admin
heritrix.cmdline.port = 8088
heritrix.cmdline.run = false
heritrix.cmdline.nowui = false
heritrix.cmdline.order =
heritrix.cmdline.jmxserver = false
heritrix.cmdline.jmxserver.port = 8081
##############################################################################
# LOGGING
##############################################################################
在浏覽器位址欄輸入:http://127.0.0.1:8088/即可登入WUI,輸入使用者名:admin密碼:admin,即可登入設定抓取任務。