Linux下注册Apache,mysql为系统服务

时间:2023-02-15 16:11:09

一.注册Apache

 

  
 
 
  1. cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd  
  2. vi httpd  
  3. 找到:#!/bin/sh  
  4. 另起一行,增加:  
  5. # chkconfig: 35 70 30  
  6. # description: Apache  
  7.  
  8. 保存退出  
  9. chkconfig --add httpd  
  10. chkconfig httpd on  
  11. chkconfig --list httpd 

 

 

二.注册mysql

 

  
 
 
  1. cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld   
  2. chkconfig --add mysqld   
  3. chkconfig  mysqld on  
  4. chkconfig --list httpd 

参考:http://blog.163.com/wxiuhui@126/blog/static/202023692010058177879/