子恺

Linux上添加服务(htttpd,samba等等)

service httpd restart   出现 httpd:unrecognized service 错误

vi /etc/rc.d/rc.local #在/etc/rc.d/rc.local中增加启动apache的命令
添加:
/usr/local/apache2/bin/apachectl start
或者               

 #将apache注册为系统服务

# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

#chmod 700 /etc/rc.d/init.d/httpd
#vi /etc/rc.d/init.d/httpd
   在第三行后增加
   #Comments to support chkconfig on RedHat Linux
   #chkconfig: 2345 90 90
   #description:http server
注意:没有这几行,在使用chkconfig时会提示你:service httpd does not support chkconfig。
chkconfig --add httpd
chkconfig --level 2345 httpd on

posted @ 2015-11-14 18:36  zikai  阅读(317)  评论(0编辑  收藏  举报

子恺工作室