二、关闭不必要的服务
  小化安装的Centos7系统并没有nano、vim、wget、curl、ifconfig、lsof命令,这里首先安装一下:
  yum -y install nano vim wget curl net-tools lsof
  可以通过netstat和lsof查看系统都运行了哪些服务,将不必要的进行关闭
systemctl stop postfix
systemctl stop avahi-daemon
systemctl disable postfix
systemctl disable avahi-daemon
systemctl list-unit-files    查看正在运行服务的状态报告
systemctl start httpd.service    启动服务
systemctl stop  httpd.service    关闭服务
systemctl restart  httpd.service 重启服务
systemctl reload   httpd.service 重新加载服务
systemctl disable  httpd.service 开机不启动
systemctl enable   httpd.service 开机启动
systemctl status   httpd.service 查看服务运行状态
systemctl show     httpd.service 显示服务或任务的属性
systemctl list-dependencies  httpd.service  检查服务依赖关系
systemctl is-enabled  httpd.service  检查服务是否开机启动及级别
systemctl -H 192.168.117.128 start httpd.service   启动192.168.117.128机器上的httpd服务