可以使用systemctl來(lái)啟動(dòng)/停止/重啟服務(wù)。
要啟動(dòng)一個(gè)服務(wù),你需要使用如下命令:
# systemctl start httpd.service
這會(huì)啟動(dòng)httpd服務(wù),對(duì)我們而言就是Apache HTTP服務(wù)器。
要停止它,需要以root身份使用該命令:
# systemctl stop httpd.service
如果要重啟,你可以使用restart選項(xiàng),如果服務(wù)在運(yùn)行中,它將重啟服務(wù);如果服務(wù)不在運(yùn)行中,它將會(huì)啟動(dòng)。
推薦教程:centos教程