ubuntu下用service httpd restart重启apache

来源:互联网 发布:地下交通站 知乎 编辑:程序博客网 时间:2024/05/29 05:12

转自:http://blog.csdn.net/zwfcan/article/details/8231864

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
原创粉丝点击