Heritrix配置

来源:互联网 发布:虚拟社交网络是什么 编辑:程序博客网 时间:2024/04/29 06:43

转自http://yourlei.blog.sohu.com/111046417.html

自己上班搞了2年多的蜘蛛和采集,只是一直是使用自己的程序,今天抽时间想看看其他蜘蛛的情况,于是下载了heritrix-1.14.2。搜索了一下相关的安装介绍。基本步骤如下:

    (1)解压下载的heritrix-1.14.2.zip的压缩包,如将其放在E:\datasource\heritrix-1.14.2.

    (2)以文本方式打开conf文件下的heritrix.properties文件,在"heritrix.cmdline.admin="后面增加账户和密码,比如heritrix.cmdline.admin=admin:admin

    (3)复制conf目录下的jmxremote.password.template文件,放到根目录heritrix-1.14.2下。重命名为jmxremote.password,修改两个管理员账号内容,
    motitorRole @PASSWORD@
    controlRole @PASSWORD@
    修改后的内容为实际工作中使用的密码,
    motitorRole admin
    controlRole admin

    (4)将jmxremote.password改为只读属性。

    (5)打开bin文件,新建一个批处理文件start.bat,文件的内容是调用bin下的"heritrix.cmd",start.bat的文件内容如下:
    heritrix.cmd --admin=admin:admin
    双击start.bat启动heritrix,产生两个窗口,运行成功后显示版本等信息。此时可以在浏览器端进行访问了。

    自己试了几次,都提示“错误:必须限制口令文件读取访问:E:\heritrix-1.14.2\jmxremote.password 请按任意键继续。。。”。网上找了些帮助,都说是要更改为只读权限,但自己早已修改过,还是不能成功,有些纳闷。中文网页无果之后,就求助于英文网页,幸得一篇文章,其中描述到:

The start script tried to fix the JMX permissions, but you still get a permissions error:

This can happen if the owner of jmxremote.password is not the same as the current user (e.g. ownership is set to a group of user, like "Administrators"):
To check this, right click on the file, select "Properties", switch to the "Security" tab, click on "Advanced", switch to the tab "Owner", select your username from the list and click on "Apply".

按照上述方法修改后重新运行start.bat,没有报错,访问http://127.0.0.1:8080,顺利打开管理页面。 微笑