Linux下把Mysql和Apache加入到系統(tǒng)服務(wù)里
作者:haohtml
本文主要介紹Linux下注冊Apache與MySQL為系統(tǒng)服務(wù)的具體方法。
Linux下注冊Apache與MySQL為系統(tǒng)服務(wù)
Apache加入到系統(tǒng)服務(wù)里面:
cp /安裝目錄下/apache/bin/apachectl /etc/rc.d/init.d/httpd
修改httpd
在文件頭部加入如下內(nèi)容:
### # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 90 90 # description:http server ###
保存
在打入
#chkconfig --add httpd #chkconfig --level 345 httpd on
MySQL加入到系統(tǒng)服務(wù)里面
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
#把msql的腳本文件拷到系統(tǒng)的啟動目錄下
cd /etc/init.d/ chkconfig --add mysqld #將mysql加到啟動服務(wù)列表里 chkconfig mysqld on #讓系統(tǒng)啟動時(shí)自動打開mysql服務(wù)
Apache加入啟動項(xiàng)里面:
echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local
【編輯推薦】
- Linux、Apache和Nginx之間的“三角戀”
- 使用Eucalyptus打造自己的云測試平臺(CentOS+Apache+MySQL)
- 詳解FreeBSD 8下部署Apache+MySQL+PHP 5
責(zé)任編輯:黃丹
來源:
haohtml's blog