我是靠谱客的博主 酷炫蜜蜂,最近开发中收集的这篇文章主要介绍CentOS6.x与CentOS7.x-启动服务管理命令,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

CentOS 6.x 的服务启动管理命令

手动:service 服务名称 start|stop|restart|...
自动:chkconfig --level 35 服务名称 on|off

chkconfig命令 管理软件自启动的工具

查看所有服务的自启动状态

chkconfig --list
chkconfig --list 服务名

修改服务的开机自启状态

chkconfig --level N 服务名称 on|off
N指的是(运行级别,0-6级别)

CentOS 7.x 的服务启动管理命令

手动:systemctl start|stop|restart|... 服务名
自动:systemctl enable|disabled 服务名

6.x 和 7.x 安装的源码软件的管理:
手动:使用安装的绝对路径进行管理:
/usr/local/apache2/bin/apachectl start|stop|restart|… (可用别名)
自动:
自己编写管理该软件的脚本,将脚本放在PATH环境变量所在目录

ip、关闭防火墙、关闭SELinux、挂载光盘(自动挂载)、yum源(或网络yum源)

6.x 关闭防火墙:iptables
查看规则:iptables -L

临时关闭:service iptables stop
清空规则:iptables -F

永久关闭:chkconfig iptables off

7.x 关闭防火墙:firewalld

查看:systemctl status firewalld
临时关闭:systemctl stop firewalld
永久关闭:systemctl disabled firewalld

网络yum源

基础源:
	6.x: http://mirrors.aliyun.com/repo/Centos-6.repo
	7.x: http://mirrors.aliyun.com/repo/Centos-7.repo
扩展源:(epel)
	6.x: http://mirrors.aliyun.com/repo/epel-6.repo
	7.x: http://mirrors.aliyun.com/repo/epel-7.repo

Linux不靠文件名识别yum配置文件,靠后缀识别是否要加载
若要加载,则在通过文件内容区分是哪一种yum源,yum源之间关系是并存的。

最后

以上就是酷炫蜜蜂为你收集整理的CentOS6.x与CentOS7.x-启动服务管理命令的全部内容,希望文章能够帮你解决CentOS6.x与CentOS7.x-启动服务管理命令所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(77)

评论列表共有 0 条评论

立即
投稿
返回
顶部