service httpd start

来源:互联网 发布:适用于mac的办公软件 编辑:程序博客网 时间:2024/06/05 10:38
将apache当作系统服务用service httpd start启动之的方法:
[root@localhost ~]# cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
[root@localhost ~]# chmod 700 /etc/rc.d/init.d/httpd
[root@localhost ~]# vi /etc/rc.d/init.d/httpd
在第三行加入(我不明白为啥要在第三行,呵呵,权当为了好看好了)
#Comments to support chkconfig on RedHat Linux
#chkconfig: 2345 90 90
#description:http server
chkconfig --add httpd
chkconfig --level 2345 httpd on

OK啦

原创粉丝点击