1、Apache加入到系統服務裏面
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
但是在執行:
chkconfig --add httpd
chkconfig httpd on
的時候出現錯誤:service httpd does not support chkconfig
解決辦法:
打開 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面)
#chkconfig: 2345 10 90
#description: Activates/Deactivates Apache Web Server加上上面這兩行就可以,#必須有
其中:2345是設爲要啓動的運行級別,10是啓動優先級,90是殺死進程的優先級,誰優先誰先掛的意思。
2、MySQL加入到系統服務裏面
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
#把msql的腳本文件拷到系統的啓動目錄下cd /etc/init.d/
chkconfig --add mysqld #將mysql加到啓動服務列表裏
chkconfig mysqld on #讓系統啓動時自動打開mysql服務