在Linux fedora 5上安装本地dictd server的方法

1.  使用root登录后,在命令行提示符下用:
[root@localhost ~]# yum install dictd
安装上dictd,你可以在命令行上使用如下三个命令:
a.   [root@localhost ~]# dictd  结果是:
      [root@localhost ~]#
b.   [root@localhost ~]# dict 结果为:
dict 1.9.15/rf on Linux 2.6.15-1.2054_FC5smp
Copyright 1997-2002 Rickard E. Faith (faith@dict.org)

Use --help for help
[root@localhost ~]#
c. [root@localhost ~]# dictfmt 结果为:
[root@localhost ~]# dictfmt
dictfmt v. 1.9.15 December 2000
Copyright 1997-2000 Rickard E. Faith (faith@cs.unc.edu)

Usage: dictfmt [-c5|-t|-e|-f|-h|-j|-p] -u url -s name [options] basename
Create a dictionary databse and index file for use by a dictd server

-c5       headwords are preceded by a line containing at least
                5 underscore (_) characters
。。。。。。
以上结果表明dictd 安装正确。
    说明:1.  在/usr/bin/下有dict、dictfmt命令;在/usr/sbin/下有dictd命令;在/etc/init.d/目录下有dictd文件用来启动dictd server,后面我会谈到如何启动。
                2. 你可以到ftp://ftp.dict.org/pub/dict/下载
dictd-1.9.15.tar.gz 解压缩,照着文件中的去做,但我在make的时候出现了编译错误,所以没法分享
2. 编写配置文件和下载字典数据库
  现在本地dictd server还不能工作,你必须写两个配置文件dictd.conf和dict.conf(存储到/etc/目录下)他们的内容如下:
dictd.conf:
  access {allow localhost allow *}
  database web1913   { data "/usr/local/lib/dict/web1913.dict.dz"
                           index "/usr/local/lib/dict/web1913.index" }
dict.conf:
server localhost
从dictd.conf文件中可以看到web1913.dict.dz和web1913.index是两个文件,这就是字典数据库文件,你可以从
ftp://ftp.dict.org/pub/dict/pre下载 dict-web1913-1.4-pre.tar.gz后,解压缩到/usr/local/lib/dict/目录下。他们的名字分别为:web1913.dict.dz和web1913.index
Note:如果你想要配置成可以从其他机器查询dictd server,可以参考:http://www.newsmth.net/pc/pccon.php?id=6147&nid=152430
            我上面的配置文件及有关内容,你还可以参考:
http://docs.kde.org/stable/en/kdenetwork/kdict/obtaining-databases.html
3. 测试和启动你的本地dictd server
1. 首先用这些命令:dictd --test-show-info web1913 显示有关数据库web1913的信息,如果没有错误的话,表明一切正常,你可以启动你的dictd server了。
2. 启动
[root@localhost ~]# /etc/init.d/dictd start
接下来:
你可以
[root@localhost ~]# dict word
查找到单词了吧,恭喜你,成功了。
Note:也许你会在执行dictd --test-show-info web1913或任何其他测试有关web1913时,碰到这个错误:
:I: 3817 starting dictd 1.9.15/rf on Linux 2.6.15-1.2054_FC5smp Sun Jul 30 10:06:21 2006
:E: /usr/local/lib/dict/web1913.index is not readable (index file)
:E: /usr/local/lib/dict/web1913.dict.dz is not readable (data file)
:E: for security, this program will not run as root.
:E: if started as root, this program will change to "dictd" or "nobody".
:E: currently running as user 99/nobody, group 99/nobody
:E: config and db files must be readable by that user
dictd (sanity): :E: terminating due to errors. See log file
(sanity) :E: terminating due to errors. See log file
[root@localhost ~]#
恭喜你,你跟我一样惨,还好,我已经知道了,你可以用chmod 777 /usr/local/lib/dict/web1913.index来修改其属性就可以了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值