实验目标

 安装vsftpd,httpd软件包    

 判断是独立还是临时服务    

 启动这2个服务

 确保开机启动 

 安装telnet-server,判断是临时还是独立

 启动

 实验环境

虚拟机

 实验步骤

一、环境准备

1. 配置yum仓库

[root@localhost ~]# cd /etc/yum.repos.d/

 [root@localhost yum.repos.d]# ls

rhel-debuginfo.repo

[root@localhost yum.repos.d]# cp rhel-debuginfo.repo rhel.repo

[root@localhost yum.repos.d]# vim rhel.repo

[rhel]

name=Red Hat Enterprise Linux

baseurl=file:///misc/cd/Server

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

2. 清除旧的数据库,查看yum的安装包数量

[root@localhost yum.repos.d]# yum clean all

[root@localhost yum.repos.d]# yum list |wc -l

3348

 

3. 安装三个软件包

[root@localhost ~]# yum -y install vsftpd httpd telnet-server

Running Transaction

  Installing     : telnet-server                                                                                  1/3 

  Installing     : httpd                                                                                          2/3 

  Installing     : vsftpd                                                                                         3/3 

 

Installed:

  httpd.x86_64 0:2.2.3-74.el5         telnet-server.x86_64 1:0.17-41.el5         vsftpd.x86_64 0:2.0.5-28.el5        

 

Complete!

 

 结果验证

 

一、判断三个服务是独立的还是临时的

[root@localhost ~]# rpm -ql vsftpd | grep init.d

/etc/rc.d/init.d/vsftpd

[root@localhost ~]# rpm -ql httpd |grep init.d

/etc/rc.d/init.d/httpd

[root@localhost ~]# rpm -ql telnet-server |grep init.d

[root@localhost ~]# rpm -ql telnet-server |grep xinetd.d

/etc/xinetd.d/telnet

 

 

二、启动服务,确保开机启动

[root@localhost ~]# /etc/init.d/vsftpd status

vsftpd 已停

[root@localhost ~]# /etc/init.d/vsftpd start

为 vsftpd 启动 vsftpd:                                    [确定]

[root@localhost ~]# /etc/init.d/httpd status

httpd 已停

[root@localhost ~]# /etc/init.d/httpd start

启动 httpd:                                               [确定]

[root@localhost ~]# chkconfig --list vsftpd 

vsftpd          0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭

[root@localhost ~]# chkconfig vsftpd on

[root@localhost ~]# chkconfig --list vsftpd 

vsftpd          0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

[root@localhost ~]# chkconfig --list httpd

httpd           0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭

[root@localhost ~]# chkconfig httpd on

[root@localhost ~]# chkconfig --list httpd

httpd           0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

 

 

3. 启动临时服务

[root@localhost ~]# chkconfig telnet

[root@localhost ~]# service xinetd restart

停止 xinetd:                                              [确定]

启动 xinetd:                                              [确定]

 

 

 

 问题和经验总结

故障现象:yum库配置不正确 

解决办法: 运行yum list |wc l

 

 

故障现象:临时服务不能用绝对路径和service 

 

故障现象:开启临时服务 要开启xinetd