After CentOS has installed apache, mysql, and other server programs, it is not set to enable automatically after startup. to avoid restarting, you must manually enable the web and other servers, in fact, the setting is very simple. just run the chkconfig command. For example, to automatically start mysql, apache, and vsftpd services after the instance is started, run the following command: chkconfigmysqldonchkconfi
After CentOS has installed apache, mysql, and other server programs, it is not set to enable automatically after startup. to avoid restarting, you must manually enable the web and other servers, in fact, the setting is very simple.ChkconfigCommand.
For example, to automatically start mysql, apache, and vsftpd services after the instance is started, run the following command:
Chkconfig mysqld on chkconfig httpd on chkconfig vsftpd on
To disable automatic startupOnChangeOffThat's all.
Chkconfig mysqld off chkconfig httpd off chkconfig vsftpd off
However, if a service has not been added to the chkconfig list-- AddAdd the following parameters:
Chkconfig -- add postfix
To query all the automatically started Services, enter:
Chkconfig -- list
However, this shows that there are too many things and it looks dizzy. What if I only want to view the specified service? At this time, you only need to-List"And then add the service name. for example, to check whether the httpd service is automatically started, enter:
Chkconfig -- ist httpd
Output result at this time:
Httpd 0: off 1: off 2: off 3: off 4: off 5: off 6: off
At this time, 0 ~ If both are off, the httpd service will not be automatically started when the system starts. We enterChkconfig httpd onThen, check the output result again:
Httpd 0: off 1: off 2: on 3: on 4: on 5: on 6: off
2 ~ If all five are on, it indicates that it will be automatically started.