将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啦
[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啦