centos7 网络sshd配置、域名配置
时间:2016-02-01 18:03 来源:linux.it.net.cn 作者:IT
#centos7 网络sshd配置
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:E5:9C:5F"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="9663d550-4153-44b2-b5f6-8e49fc89a7e7"
IPADDR=172.16.3.98
NETMASK=255.255.255.0
GATEWAY=172.16.3.254
DNS1=10.1.1.4
DNS2=210.22.70.3
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain #配置这个主机名
GATEWAY=172.16.3.254
[root@localhost ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
nameserver 10.1.1.4
nameserver 210.22.70.3
###CentOS 7下Apache HTTP Server安装配置。
yum -yinstall httpd
修改配置文件(修改前备份一下:cp httpd.conf httpd.conf.origin)
```
cd
/etc/httpd/conf
ls
httpd.conf
```
###设置为自动启动
systemctl enable httpd.service
###配置网络配置文件绑定域名
cd /etc/sysconfig/network-scripts/ #进入网络配置文件目录
vi ifcfg-eno16777736 #编辑配置文件,添加修改以下内容
主要设置dns服务器
(责任编辑:IT)
#centos7 网络sshd配置 [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" BOOTPROTO="static" HWADDR="00:0C:29:E5:9C:5F" IPV6INIT="no" NM_CONTROLLED="no" ONBOOT="yes" TYPE="Ethernet" UUID="9663d550-4153-44b2-b5f6-8e49fc89a7e7" IPADDR=172.16.3.98 NETMASK=255.255.255.0 GATEWAY=172.16.3.254 DNS1=10.1.1.4 DNS2=210.22.70.3 [root@localhost ~]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain #配置这个主机名 GATEWAY=172.16.3.254 [root@localhost ~]# cat /etc/resolv.conf ; generated by /sbin/dhclient-script search localdomain nameserver 10.1.1.4 nameserver 210.22.70.3 ###CentOS 7下Apache HTTP Server安装配置。 yum -yinstall httpd 修改配置文件(修改前备份一下:cp httpd.conf httpd.conf.origin) ``` cd /etc/httpd/conf ls httpd.conf ``` ###设置为自动启动 systemctl enable httpd.service ###配置网络配置文件绑定域名 cd /etc/sysconfig/network-scripts/ #进入网络配置文件目录 vi ifcfg-eno16777736 #编辑配置文件,添加修改以下内容 主要设置dns服务器 (责任编辑:IT) |