Linux几种服务器(dhcp、dns、http、ftp)的配置

DHCP服务器

DHCP服务器的dhcpd.conf配置信息:(vi /etc/dhcp/dhcpd.conf)
Linux几种服务器(dhcp、dns、http、ftp)的配置

服务器ifcfg-eth2配置信息:(vi /etc/sysconfig/network-scripts/ifcfg-eth2)
Linux几种服务器(dhcp、dns、http、ftp)的配置
DHCP服务器配置完成,重启网络服务及DHCP服务
Linux几种服务器(dhcp、dns、http、ftp)的配置
客户机三块网卡配置:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
重启客户机的网络服务,自动获取IP成功:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Ifconfig -a查看三个网卡的信息:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
客户机ping服务器:
Linux几种服务器(dhcp、dns、http、ftp)的配置
服务器分别ping客户机的三个地址:
Linux几种服务器(dhcp、dns、http、ftp)的配置
后来做了dns ftp www服务器后,突然不能正常分配,很难受,最终找到解决方法,因为开始没碰到这种情况,网络适配器选择如下图即可,影响不大
Linux几种服务器(dhcp、dns、http、ftp)的配置
VMware8是NAT,其下面有自动分配选项,若选择了NAT连接,并且不关闭VMware的DHCP服务,则会分配下图的107网段地址。
Linux几种服务器(dhcp、dns、http、ftp)的配置
要关注下图任务里的它,会变,每次VMware启动时,服务会自动开启或者不开启,最初是连外网时无法分配,原因:VMware的dhcp服务停止,开启后可以分配,连接外网,后来,服务器改为静态IP时,分配到范围以外的地址,原因,VMware的DHCP先于虚拟服务器的dhcp分配,关掉即可,若都不行,关虚拟机,关VMware,重启宿主机
Linux几种服务器(dhcp、dns、http、ftp)的配置

DNS服务器

DNS服务器主配置文件
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
正反向解析文件:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
第一次解析不成功原因,文件权限问题:
Linux几种服务器(dhcp、dns、http、ftp)的配置
改成:
Linux几种服务器(dhcp、dns、http、ftp)的配置
正反向解析成功:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
解析外网地址www.babidu.com 有如下两行/etc/resolve.conf只能在桥接模式下解析外网
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置

http 服务器

使用yum安装 yum install httpd -y
此安装步骤须保证虚拟机联网
Linux几种服务器(dhcp、dns、http、ftp)的配置
修改Server Name 为本机地址,且保证客户机与此虚拟服务器能互相ping通
关闭防火墙 service iptables stop
Linux几种服务器(dhcp、dns、http、ftp)的配置
在下图路径下写一个html文件,默认放在html目录下,若放在别的目录下,须在浏览器加相关路径才能访问到
Linux几种服务器(dhcp、dns、http、ftp)的配置

ftp服务器

修改vsftp.conf文件:
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
编辑etc/selinux/config修改selinux 为disabled
Linux几种服务器(dhcp、dns、http、ftp)的配置
getsebool -a|grep ftp

分别在/var/ftp/pub和桌面创建两个文件用来下载和上传
下图为上传lhjup.txt
Linux几种服务器(dhcp、dns、http、ftp)的配置
Linux几种服务器(dhcp、dns、http、ftp)的配置
下图为从/var/ftp/pub中下载文件
Linux几种服务器(dhcp、dns、http、ftp)的配置
Lcd 下载路径可指定下载路径,下图为指定在桌面
Linux几种服务器(dhcp、dns、http、ftp)的配置

注:匿名用户只能进入pub中下载满权限的文件,只能上传在pub中,lhj用户可通过绝对路径下载pub的所有文件,默认上传到home/lhj中,亦可在conf文件中指定目录如
在/etc/vsftpd/vsftpd.conf文件添加一行
local_root=/var/www/html
Linux几种服务器(dhcp、dns、http、ftp)的配置