Linux下Mysql和Apache添加為系統(tǒng)服務(wù) |
發(fā)布時(shí)間: 2012/6/28 16:58:33 |
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)的啟動(dòng)目錄下 cd /etc/init.d/ chkconfig --add mysqld #將mysql加到啟動(dòng)服務(wù)列表里 chkconfig mysqld on #讓系統(tǒng)啟動(dòng)時(shí)自動(dòng)打開mysql服務(wù) Apache加入啟動(dòng)項(xiàng)里面: echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local 本文出自:億恩科技【1tcdy.com】 服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM] |