您的位置:首页 > 运维架构 > Linux

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

2015-11-14 18:36 525 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: