linux服务器通过设置mysql,apache为系统服务,实现开机启动

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

相关文章:

  • 2022-12-23
  • 2021-09-22
  • 2021-12-27
  • 2021-04-26
  • 2021-11-22
  • 2022-12-23
  • 2022-02-20
猜你喜欢
  • 2022-02-15
  • 2022-01-07
  • 2021-11-20
  • 2021-04-17
  • 2021-11-22
  • 2021-07-16
相关资源
相似解决方案