Apache:
cp /usr/sbin/apachectl /etc/rc.d/init.d/httpd 增加httpd服务
vi /etc/rc.d/init.d/httpd
在第2行加入
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
然后执行
chkconfig –add httpd
如此可以使用service httpd start来启动apache了
Mysql:
cd /usr/local/mysql/share/mysql
cp mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
service mysqld restart
如此可以使用service mysqld start来启动mysql了
另外一种办法:
https://blog.csdn.net/detiantian/article/details/52187902