CentOS Setup boot up Apache and mysql[summary]

Source: Internet
Author: User

1. Preface

Recently learn to build WordPress, need to use APAHCE and MySQL. I download the source code for installation, installed in the/url/local directory, each boot will need to start manually, a bit troublesome. If you want to set up boot, from the online check, how to set up, summarize, convenient for later use.

2. Setting method

There are two ways to modify a configuration file, one by adding a startup item.

Method One: Modify the configuration file according to the system startup initialization process

The operating modes 2, 3, and 5 in CentOS all make/etc/rc.d/rc.local the last one in the init script, so users can add in this file their own commands that need to be executed before the other initialization work. The introduction of RC.D can be consulted: http://blog.csdn.net/it1988888/article/details/8051657.

Edit rc.local file: #vim/etc/rc.d/rc.local

Add the following start command:

#启动apahce

/usr/local/apache/bin/apachectl start

#启动mysql

/usr/local/mysql/bin/mysqld Start or/usr/local/mysql/bin/mysqld start

Method Two: Use the chkconfig command to implement

Chkconfig is often used in command-line operations, and it is easy to set up and query the system service Chkconfig syntax at different run levels :

Chkconfig [--add] [--del] [--list] [System Services] chkconfig [--level/levels] [Level code] [System Services] [On/off/reset] Level code: The operating level of the Linux system. Linux divides the operating environment into the following 7 levels, i.e.
0: Turn off the machine
1: Single user mode (single user, no network)
2: Multi-user mode without network support (multiuser, no network)
3: Multi-user mode with network support (multi-user, network)
4: reserved, not used
5: Network support with X-window support multi-user mode (multi-user, network, X-window interface)
6: Reboot the system, that is, restart with chkconfig list query Apache and MySQL service exists, does not exist and needs to be added manually. Add Apache Service Item command: chkconfig--add httpdTo finish adding the settings startup item: chkconfig--level 2345 httpd on chkconfig--level 2345 mysqld on

Reference:

Http://www.jb51.net/LINUXjishu/86331.html

Http://www.ok165.com/article/5333.html


Source: >  

From for notes (Wiz)

CentOS Setup boot up Apache and mysql[summary]

Related Article

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.