2653885 发表于 2018-11-28 12:20:26

linux设置mysql,apache,tomcat开机启动

  一.mysql设为linux服务
  cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld
  chkconfig --add mysqld
  chkconfig --level 2345 mysqld on
  chown mysql:mysql -R /usr/local/mysql5/
  service mysqld start
  二.apache设为linux服务
  cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
  vi /etc/init.d/httpd
  在在#!/bin/sh后面加入下面两行
  #chkconfig:345 85 15
  #description: Start and stops the Apache HTTP Server.
  然后
  chmod +x /etc/rc.d/init.d/httpd
  chkconfig --add httpd
  三.tomcat设为linux服务
  1.vi /etc/rc.d/rc.local
  2.加入export JDK_HOME=/usr/java/jdk1.6.0_13
  export JAVA_HOME=/usr/java/jdk1.6.0_13
  /usr/local/tomcat5.5.27/bin/startup.sh
  ok!

页: [1]
查看完整版本: linux设置mysql,apache,tomcat开机启动