服务器搭建简易版(linux)
## 服务器搭建
-----------------------------------------------------------
#### 1. DHCP服务器
```shell
[root@server ~]# vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
#忽略客户端的 DNS更新功能
ignore client-updates;
## 预设租期
default-lease-time 259200;
## 最大租期
max-lease-time 518400;
## 动态分配的 IP
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.31 192.168.10.254;
## DHCP客户端的默认的转发地址
option routers 10.1.160.55;
## DHCP客户端的子网掩码
option subnet-mask 255.255.255.0;
}
```
-----------------------------------------------------------
#### 2. NFS服务器
```shell
# yum -y install nfs-utils rpcbind
创建目录 /nfstest
chmod -R 777 /nfstest
编辑/etc/exports 文件,添加
/nfstest *(rw)
# showmount -e IP
```
-----------------------------------------------------------
#### 3. 代理服务器
```sh
搭建代理服务器
# yum install squid -y
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl start squid
# systemctl enable squid
使用代理服务器
# vim /etc/profile
添加
export http_proxy=http://172.30.202.151:3128
# source /etc/profile
# echo $http_proxy
# curl www.baidu.con
```
-----------------------------------------------------------
#### 4.
httpd服务
安装httpd
# yum install -y httpd
启动httpd
# systemctl start httpd
11111