service httpd restart 出现 httpd:unrecognized service 错误
#将apache注册为系统服务
# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
#chmod 700 /etc/init.d/httpd#vi /etc/init.d/httpd
在第一行后增加
#chkconfig: 2345 90 90
#description:http server
注意:没有这几行,在使用chkconfig时会提示你:service httpd does not support chkconfig。
chkconfig --add httpd
chkconfig --level 2345 httpd on
本文介绍了解决在尝试重启httpd服务时遇到的“unrecognized service”错误的方法。通过将Apache注册为系统服务,并正确配置init.d脚本来支持chkconfig,确保服务能够正常启动。

2166

被折叠的 条评论
为什么被折叠?



