httpd添加开机启动 centos7

/usr/lib/systemd/system/httpd.service

systemctl命令的系统目录

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)

[Service]
Type=forking
ExecStart=/usr/local/apache2/bin/apachectl start
ExecReload=/usr/local/apache2/bin/apachectl restart
ExecStop=/usr/local/apache2/bin/apachectl stop
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target

centos7 chkconfig 失效 不起作用 开机启动

systemctl daemon-reload转载请注明出处:

转载自http://lxfamn.cn/blog

未经允许不得转载:lxfamn » httpd添加开机启动 centos7

赞 (0) 打赏

置顶推荐

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏