下载httpd,
[root@localhost ~]# yum install httpd -y
启动httpd
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl status httpd #查看
进程管理
结束进程:kill -9 PID
例:重复使用dhclient 去启动dhcp,启动失败,使用kill命令结束前一个dhclient进程,下一个dhclient就可以正常启动
[root@localhost ~]# ps -aux #查看当前所有进程信息
[root@localhost ~]# ps -aux |grep httpd
副程序的控制命令systemctl
语法:[root@localhost ~]# systemctl 参数 程序
例如:[root@localhost ~]# systemctl start httpd
一条命令只能写一个参数
参数:
1、start:启动程序
2、stop:停止程序
3、restart:重启程序,先停止,再启动
4、enable:开机启用,开机自启
5、disable:开机禁用
6、reload:重载,重新加载,与restart不同,不停止程序
7、status:查看服务状态信息和日志信息。对于日志信息也可使用tail -f /var/log/messag 查看
关闭防火墙,
[root@localhost ~]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# systemctl stop firewalld.service
只写disable,当前防火墙依旧运行,需要使用stop关闭,或者重启系统
[root@localhost ~]# systemctl status firewalld.service [查看防火墙信息]
● firewalld.service - firewalld - dynamic firewall