Linux under setup MySQL Apache boot automatically after boot

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.