Home > Database > Mysql Tutorial > Linux:Apache_MySQL随机启动关闭

Linux:Apache_MySQL随机启动关闭

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:54:29
Original
1459 people have browsed it

Linux下Apache随机启动 cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apached chmod +x /etc/rc.d/init.d/ap

  Apache源于NCSAhttpd服务器,经过多次修改,成为世界上最流行的Web服务器软件之一。Apache取自“a patchy server”的读音,意思是充满补丁的服务器,因为它是自由软件,所以不断有人来为它开发新的功能、新的特性、修改原来的缺陷。Apache的特点是简单、速度快、性能稳定,,并可做代理服务器来使用。

  Linux下Apache随机启动

  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随机启动
  默认配置

  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

  非默认安装 比如配置在/opt/mysql_server中 创建启动文件/opt/mysql_server/start.sh

  #!/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&

  创建停止文件/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

  创建配置文件my.cnf
  [mysqld]
  port = 8211
  skip-locking
  skip-innodb
  skip-name-resolve
  set-variable = back_log=600
  set-variable = key_buffer=4M
  set-variable = max_allowed_packet=2M
  set-variable = table_cache=512
  set-variable = sort_buffer=16M

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Apache automatically stops
From 1970-01-01 08:00:00
0
0
0
apache restart failed
From 1970-01-01 08:00:00
0
0
0
apache error
From 1970-01-01 08:00:00
0
0
0
How apache logs
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template