码迷,mamicode.com
首页 > Web开发 > 详细

Linux下将自己安装的Apache(httpd)新增为系统服务,开机自启动

时间:2020-03-14 01:23:12      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:解决   nbsp   执行   支持   lis   conf   自己的   desc   code   

1> 查看一下/etc/init.d/下是否存在httpd这个服务

ls /etc/init.d/   |  grep httpd      如果没有执行下一步

2>将自己安装目录下的apachect1复制到该目录下并改为httpd

cp /home/houqingdong/http-exe/bin/apachect1   /etc/init.d/httpd      注:红色为自己的安装目录

3>执行 chkconfig --add httpd    目的是想新增所制定的系统服务   但是会出现以下警告:

技术图片

这里说的是httpd服务不支持chkconfig , 添加支持:    vi /etc/init.d/httpd      在 #!/bin/sh  下添加这两句:

#chkconfig:345 85 15

#description:Start and stop the Apache HTTP Server

最终结果为:

技术图片

4> 执行:   chkconfig --add httpd

 chkconfig httpd on     就可以添加成功了

5>查看一下是否添加成功:

chkconfig --list httpd

技术图片

该问题的解决方法参考链接:http://callan.iteye.com/blog/1099648   注:链接上还有设置mysql为开机自启动的系统服务的方法。

Linux下将自己安装的Apache(httpd)新增为系统服务,开机自启动

标签:解决   nbsp   执行   支持   lis   conf   自己的   desc   code   

原文地址:https://www.cnblogs.com/mxci/p/12490084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!