linux中xinetd.conf,配置redhat linux 7.0中的xinetd

在redhat linux 7.0中,用xinetd来启动一些守护进程,而这一工具在相关资料中介绍并不多,为此,本人在配置时,很是头疼了一阵。现在,终于配好了,不感独占,拿出来,与各位同人分享。如有错误,也请各位大虾指正。

下面,以我配置的proftpd为例,说一下。

首先,我们先看一下/etc/xinetd.conf文件。

<1> [wc@dns wc]$ cat /etc/xinetd.conf

<2> #

<3> # Simple configuration file for xinetd

<4> #

<5> # Some defaults, and include /etc/xinetd.d/

<6>

<7> defaults

<8> {

<9> instances = 60

<10> log_type = SYSLOG authpriv

<11> log_on_success= HOST PID

<12> log_on_failure= HOST RECORD

<13> }

<14>

<15> includedir /etc/xinetd.d

在defaults中定义了几项默认设置,我们不用去管它。我们最关心的是最后一行(15行):“includedir/etc/xinetd.d”,它说明了xinetd的配置文件在/etc/xinetd.d/目录中。到/etc/xinetd.d/目录里看看吧。

[wc@dns wc]$ cd /etc/xinetd.d

[wc@dns xinetd.d]$ ls -l

total 75

-rw-r--r-- 1 root root 298 Apr 22 11:38 chargen

-rw-r--r-- 1 root root 313 Apr 22 11:38 chargen-udp

-rw-r--r-- 1 root root 298 Apr 22 11:38 daytime

-rw-r--r-- 1 root root 313 Apr 22 11:38 daytime-udp

-rw-r--r-- 1 root root 290 Apr 22 11:38 echo

-rw-r--r-- 1 root root 304 Apr 22 11:38 echo-udp

-rw-r--r-- 1 root root 318 Apr 22 11:38 finger

-rw-r--r-- 1 root root 345 Apr 22 11:38 linuxconf-web

-rw-r--r-- 1 root root 259 Apr 22 11:38 ntalk

-rw-r--r-- 1 root root 362 Apr 22 11:38 rexec

-rw-r--r-- 1 root root 377 Apr 22 11:38 rlogin

-rw-r--r-- 1 root root 430 Apr 22 11:38 rsh

-rw-r--r-- 1 root root 359 Apr 22 11:38 swat

-rw-r--r-- 1 root root 247 Apr 22 11:38 talk

-rw-r--r-- 1 root root 305 Apr 22 11:38 telnet

-rw-r--r-- 1 root root 498 Apr 22 11:38 tftp

-rw-r--r-- 1 root root 322 Apr 22 11:38 time

-rw-r--r-- 1 root root 309 Apr 22 11:38 time-udp

哈哈,全都在呀。现在,我开始配置proftpd的启动文件吧。到这一步时,我已经装好了proftpd,并且对proftpd配置文件/usr/local/etc/proftpd.conf做了两处修改:

(1),将ServerType standalone改为:ServerType inetd

(2),将Group nogroup改为:Group nobody

好了,现在应该是以root的身份在/etc/xinetd.d/目录中编辑文本文件proftpd,内容如下:

<1> # default: on

<2> # description: The proftpd server serves proftpd sessions;

<3> service proftpd

<4> {

<5> disable = no

<6> port = 21

<7> socket_type = stream

<8> protocol = tcp

<9> user = root

<10> server = /usr/local/sbin/in.proftpd

<11> type = UNLISTED

<12> wait = no

<13> }

第一和第二行是注释行,不用管它。第三行是定义服务的名称为proftpd。

第五行disable的意思是禁用,那么,disable=no就是启动。

第六行是指定该服务的端口,ftp的端口是21。如果你不用21端口,可以根据proftpd.conf文件作相应的改变。

第七行是socket的类型,这里我们设为stream(流)。

第八行是指定协议,这里我们设为tcp协议。

第九行是启动该服务的用户,我们设为root。

第十行是指定运行文件的路径。

第十二行是不等待到启动完成。

好了,文件编好后,运行:#killall -HUP xinetd。然后让我们试一试吧:#ftp localhost,怎么样,反正我得proftpd是搞定了。如果还不行,参考一下该目录中的别的启动文件。

总结一下,实际上,对于配置来说,就是把以前/etc/inetd.conf文件中得一行换为现在/etc/xinetd.d/目录中的一个文件。

down_info.asp?id=2721

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值