安装虚拟机后,修改Linux的基本配置
- 修改主机名
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server1.itcast.cn
- 修改ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
- 修改ip地址和主机名的映射关系
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.101 server1.itcast.cn
- 关闭iptables并设置其开机启动/不启动
service iptables stop
chkconfig iptables on
chkconfig iptables off