1 #将mysql启动脚本放入所有脚本运行目录/etc/rc.d/init.d 2 cp/lamp/mysql-5.0.41/support-files/mysql.server/etc/rc.d/init.d/mysqld 3 4 #改变权限 5 chown root.root/etc/rc.d/init.d/mysqld 6 7 #所有用户都可以执行, only root can modify the 8 chmod 755/etc/rc.d/init.d/mysql D 9 #将mysqld put into Linux boot management system one by one chkconfig--add mysqld12 #查看全部服务在各运行级状态14 chkconfig--list mysqld15 #运行级别345启动17 Ch Kconfig--level 345 mysqld on
#再次查看全部服务在各运行级状态, you will find the MSYQLD instructions as well as set to boot from Chkconfig--list mysqld
httpd 0: Off 1: Off 2: Off 3: Enable 4: Enable 5: Enable 6: Off
Complete httpd boot up
2, start setting up Apache boot from boot
The first step:
CP/USR/LOCAL/APACHE/BIN/APACHECTL/ETC/RC.D/INIT.D/HTTPD//If there are other versions of Apache, you can also overwrite them directly.
Step Two:
Use the editor to open the httpd file and add two lines of text below the first line #!/bin/sh as follows
# chkconfig:35 70 30
# Description:apache
The first of the three numbers in the second row is the one that starts Apache at run level 3 and 5, and the second to third is about the priority configuration of start and stop, which doesn't matter.
Then register the service
Chkconfig–add httpd
Chkonfig--level 345 httpd on
#会看到httpd已经在开机启动列表里
Ok
Linux under setup MySQL Apache boot automatically after boot