1.
1开机自启动:进入rc.local目录。cd /etc/init.d/rc.local ,加入以下语句
/usr/apache/bin/apachectl –k start(注意:centos,redhat 目录是在etc/rc.d/init.d/rc.local下)
2 .加入服务:进入cd /etc/init.d/ 目录下,copy apachectl文件到该目录下:cp /usr/apache/bin/apachectl apachectl。重命名apachectl为httpd:mv apachectl httpd,。注册服务:chkconfig –add httpd ,启动服务.