Linux to add Mysql and Apache to the system service method

原地址

Apache added to the system service: Cp / installation directory /apache/bin/apachectl /etc/rc.d/init.d/httpd Modify httpd Add the following to the header of the file: ### # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 90 90 # description:http server ### Save Break in #chkconfig --add httpd #chkconfig --level 345 httpd onMySQL added to the system servicecp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld #Copy the msql script file to the system startup directory Cd /etc/init.d/ Chkconfig --add mysqld #Add mysql to the startup service list Chkconfig mysqld on #When the system starts, it automatically opens the mysql service Apache to join the startup item:echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local