Linux: Apache_MySQL is disabled at random startup.

Source: Internet
Author: User
In Linux, Apache starts cpusrlocalapachebinapachectletcrc. dinit. dapachedchmod + xetcrc. dinit. dap at random.

In Linux, Apache randomly starts cp/usr/local/apache/bin/apachectl/etc/rc. d/init. d/apached chmod + x/etc/rc. d/init. d/ap

Apache originated from the NCSAhttpd server and has been modified many times to become one of the most popular Web server software in the world. Apache is taken from the pronunciation of "a patchy server", which means a server full of patches, because it is a free software, so there are people who constantly develop new functions, new features, and modify the original defects for it. Apache is simple, fast, and stable, and can be used as a proxy server.

Apache random startup in Linux

Cp/usr/local/apache/bin/apachectl/etc/rc. d/init. d/apached
Chmod + x/etc/rc. d/init. d/apached
Ln-s/etc/rc. d/init. d/apached/etc/rc3.d/S100apache
Ln-s/etc/rc. d/init. d/apached/etc/rc0.d/K100apache

Mysql random start
Default Configuration

Cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysql
Chmod + x/etc/rc. d/init. d/mysql
Ln-s/etc/rc. d/init. d/mysql/etc/rc3.d/S100mysql
Ln-s/etc/rc. d/init. d/mysql/etc/rc0.d/K100mysql

Non-default installation. For example, create the Startup File/opt/mysql_server/start. sh in/opt/mysql_server.

#! /Bin/sh
Rundir = "/opt/mysql_server ";
Echo $ rundir;
/Usr/local/mysql/bin/mysqld_safe -- defaults-file = "$ rundir"/my. cnf -- pid-file = "$ rundir"/mysql. pid -- datadir = "$ rundir"/data -- socket = "$ rundir"/mysql. sock -- user = mysql -- log-error = "$ rundir"/error. log -- log-slow-queries = "$ rundir"/slow_query.log &

Create a stop file/opt/mysql_server/stop. sh

#! /Bin/sh
Rundir = "/opt/mysql_server ";
Echo $ rundir;
/Usr/local/mysql/bin/mysqladmin-uroot-pctech -- socket = "$ rundir"/mysql. sock shutdown

Create the configuration file my. cnf
[Mysqld]
Port = 8211
Skip-locking
Skip-innodb
Skip-name-resolve
Set-variable = back_log = 600
Set-variable = key_buffer = 4 M
Set-variable = max_allowed_packet = 2 M
Set-variable = table_cache = 512
Set-variable = sort_buffer = 16 M

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.