Linux設置apache,mysql開機啟動
mysql設為linux服務
www.2cto.com
cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/mysql5/
service mysqld start
apache設為linux服務
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
在在#!/bin/sh後面加入下面兩行 www.2cto.com
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
然後
chmod +x /etc/rc.d/init.d/httpd
chkconfig --add httpd
然後可以用setup命令進入服務設置,設置為開機啟動
第二種方法:
在/etc/rc.d/rc.local中增加啟動apache的命令,例如:/usr/local/httpd/bin/apachectl start