apache與mysql添加進系統服務並設置開機啓動
apache
1 cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
2 chkconfig --add httpd
出現錯誤service httpd does not support chkconfig
打開 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面)
# chkconfig: 345 85 15
# description: Activates/Deactivates Apache Web Server
345代表哪些Linux級別需要啓動httpd, 啓動序號是85, 關閉序號是15
3 chkconfig httpd on
mysql
1 cp /root/tools/mysql-5.1.72/support-files/mysql.server /etc/init.d/mysqld
1.1 chmod 700 /etc/init.d/mysqld
2 chkconfig --add mysqld
3 chkconfig mysqld on
由此來總結添加方法。
本文出自博客http://xiangji.blog.51cto.com,請務必保留此出處。