Linux下将Mysql和Apache加入到系统服务里的方法
发布日期:2022-04-15 14:34 | 文章来源:源码中国
Apache加入到系统服务里面:
cp /安装目录下/apache/bin/apachectl /etc/rc.d/init.d/httpd
修改httpd
在文件头部加入如下内容:
###
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description:http server
###
保存
在打入
#chkconfig --add httpd
#chkconfig --level 345 httpd on
MySQL加入到系统服务里面
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
#把msql的脚本文件拷到系统的启动目录下
cd /etc/init.d/
chkconfig --add mysqld #将mysql加到启动服务列表里
chkconfig mysqld on #让系统启动时自动打开mysql服务
Apache加入启动项里面:
echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local
cp /安装目录下/apache/bin/apachectl /etc/rc.d/init.d/httpd
修改httpd
在文件头部加入如下内容:
###
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description:http server
###
保存
在打入
#chkconfig --add httpd
#chkconfig --level 345 httpd on
MySQL加入到系统服务里面
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
#把msql的脚本文件拷到系统的启动目录下
cd /etc/init.d/
chkconfig --add mysqld #将mysql加到启动服务列表里
chkconfig mysqld on #让系统启动时自动打开mysql服务
Apache加入启动项里面:
echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local
版权声明:本站文章来源标注为YINGSOO的内容版权均为本站所有,欢迎引用、转载,请保持原文完整并注明来源及原文链接。禁止复制或仿造本网站,禁止在非www.yingsoo.com所属的服务器上建立镜像,否则将依法追究法律责任。本站部分内容来源于网友推荐、互联网收集整理而来,仅供学习参考,不代表本站立场,如有内容涉嫌侵权,请联系alex-e#qq.com处理。
相关文章