Basic Service Installation:
[Email protected] ~]# mount/dev/cdrom/mnt
Mount:block Device/dev/sr0 is write-protected, mounting read-only
[[email protected] ~]# yum-y install vsftpd bind bind-chroot bind-utils DHCP
1. Configure the DHCP service:
[Email protected] ~]# vi/etc/dhcp/dhcpd.conf
: R/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample # #读取模板配置
:%g/^#/d # #删除注释
:%g/^$/d # #删除空行
Option Domain-name "linuxfan.cn";
Option Domain-name-servers 192.168.100.110;
Default-lease-time 600;
Max-lease-time 7200;
Log-facility Local7;
Subnet 192.168.100.0 netmask 255.255.255.0 {
Range 192.168.100.50 192.168.100.99;
Option routers 192.168.100.117;
Next-server 192.168.100.110;
FileName "pxelinux.0";
}
: Wq
[[email protected] ~]#/ETC/INIT.D/DHCPD start
Starting dhcpd: [OK]
[Email protected] ~]# chkconfig dhcpd on
[[email protected] ~]# NETSTAT-UTPLN |grep DHCP
UDP 0 0 0.0.0.0:67 0.0.0.0:* 1264/DHCPD
2. Configure the FTP service:
1) Modify the VSFTPD configuration and implement the requirements:
[Email protected] ~]# cd/etc/vsftpd/
[email protected] vsftpd]# CP vsftpd.conf Vsftpd.conf.bak # #备份配置文件
[Email protected] vsftpd]# VI vsftpd.conf
:%g/^$/d
:%g/^#/d
Modify the following:
Anonymous_enable=yes
Local_enable=yes
Write_enable=yes
local_umask=022
Dirmessage_enable=yes
Xferlog_enable=yes
Connect_from_port_20=yes
Xferlog_std_format=yes
Chroot_local_user=yes
Ls_recurse_enable=no
Listen=yes
Pam_service_name=vsftpd
Userlist_enable=yes
Tcp_wrappers=yes
Pasv_enable=yes
pasv_min_port=24500
pasv_max_port=24600
Chown_uploads=yes
Chown_username=u01
local_root=/var/ftproot/
anon_root=/var/ftproot/
Ftpd_banner=welcome to linuxfan.cn FTP service.
Anon_upload_enable=no
listen_address=192.168.100.110
local_umask=022
: Wq
[[email protected] vsftpd]# useradd-d/var/ftproot-c "FTP Admin user"-U u01; echo [email protected] |passwd--stdin u01
[[email protected] vsftpd]# ID u01
uid=110 (u01) gid=500 (u01) group =500 (U01)
[[email protected] vsftpd]# grep u01/etc/passwd
U01:X:110:500:FTP Admin User:/var/ftproot:/bin/bash
[Email protected] vsftpd]# chmod 755/var/ftproot/
[Email protected] vsftpd]#/etc/init.d/vsftpd restart
[[email protected] vsftpd]# NETSTAT-UTPLN |grep FTP
TCP 0 0 192.168.100.110:21 0.0.0.0:* LISTEN 1310/vsftpd
[Email protected] vsftpd]# chkconfig vsftpd on
2) Access test:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/80/15/wKiom1c22fXDw26QAAEDxXYlMcM384.png "title=" 1.png " alt= "Wkiom1c22fxdw26qaaedxxylmcm384.png"/>
3. Configure the DNS service:
To modify a configuration file:
[Email protected] ~]# cd/var/named/chroot/etc/
[Email protected] etc]# cp/usr/share/doc/bind-9.8.2/sample/etc/named.conf.
[[Email protected] etc]# VI named.conf # Master config file
Modify the following:
Options
{
Directory "/var/named"; "Working" directory
Dump-file "Data/cache_dump.db";
Statistics-file "Data/named_stats.txt";
Memstatistics-file "Data/named_mem_stats.txt";
Listen-on Port 53 {192.168.100.110;};
allow-query {192.168.100.0/24;};
Allow-query-cache {192.168.100.0/24;};
recursion Yes;
};
Logging
{
Channel Default_debug {
File "Data/named.run";
Severity dynamic;
};
};
Zone "." in {
Type hint;
File "/var/named/named.ca";
};
Zone "linuxfan.cn." in {
Type master;
File "Linuxfan.cn.zone";
};
Zone "100.168.192.in-addr.arpa" in {
Type master;
File "192.168.100.arpa";
};
: Wq
[Email protected] etc]# CD. /var/named/
[Email protected] named]# cp/usr/share/doc/bind-9.8.2/sample/var/named/named.localhost.
[Email protected] named]# MV Named.localhost Linuxfan.cn.zone
[[Email protected] named]# VI linuxfan.cn.zone # # forward parsing configuration file
Modify the following:
$TTL 1D
@in SOAlinuxfan.cn. root.linuxfan.cn. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@inNSns.linuxfan.cn.
MailinMX tenmail.linuxfan.cn.
@inA192.168.100.110
NSinA192.168.100.110
FTPinCNAMENS
DHCPinCNAMENS
MailinA192.168.100.113
wwwinA192.168.100.111
DBinA192.168.100.112
TechinA192.168.100.114
KVMinA192.168.100.115
MonitorinA192.168.100.116
GatewayinA192.168.100.117
: Wq
[email protected] named]# CP Linuxfan.cn.zone 192.168.100.ARPA
[[Email protected] named]# VI 192.168.100.arpa # # Reverse parsing configuration file
Modify the following:
$TTL 1D
@in SOAlinuxfan.cn. root.linuxfan.cn. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
@inNSns.linuxfan.cn.
MailinMX tenmail.linuxfan.cn.
inPTRns.linuxfan.cn.
FTPinCNAMENS
DHCPinCNAMENS
113inPTRmail.linuxfan.cn.
111inPTRwww.linuxfan.cn.
the db.linuxfan.cninPTR.
inPTRtech.linuxfan.cn.
kvm.linuxfan.cn inPTR.
monitor.linuxfan.cn inPTR.
117inPTRgateway.linuxfan.cn.
: Wq
[Email protected] named]# cp/usr/share/doc/bind-9.8.2/sample/var/named/named.ca.
[Email protected] named]# named-checkzone linuxfan.cn.zone 192.168.100.arpa # #测试配置文件
Zone linuxfan.cn.zone/in:mail.linuxfan.cn.zone/mx ' mail.linuxfan.cn ' (out of zone) have no addresses records (A or AAAA)
Zone linuxfan.cn.zone/in:loaded Serial 0
Ok
[Email protected] named]#/etc/init.d/named restart
Stop named: [OK]
Start named: [OK]
[Email protected] named]# chkconfig named on
[Email protected] ~]# NETSTAT-UTPLN |grep 53
TCP 0 0 192.168.100.110:53 0.0.0.0:* LISTEN 1987/named
TCP 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1987/named
TCP 0 0:: 1:953:::* LISTEN 1987/named
UDP 0 0 192.168.100.110:53 0.0.0.0:* 1987/named
Using the Nslookup test
This article from "Lp-linux" blog, reproduced please contact the author!
Common service---DNS+FTP+DHCP for Linux Enterprises