今天在装Apache的时候,启动服务时报错:
- service httpd status 查看服务状态
- service httpd start
- service httpd stop
- service httpd restart
报错:httpd: unrecognized service 不能识别的服务
将httpd service注册为系统服务即可,类比于其它服务都是一样的。
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd:将Apache安装目录的bin目录下的apachectl 文件复制到/etc/init.d目录下,并命名为httpd
vim httpd :编辑这个httpd文件,在第一行#!/bin/sh下面加上下面这行代码即可:
#chkconfig: 2345 50 90 # description:Activates/Deactivates Apache Web Server)