Enable services in Linux

This article describes how to set services to start up when you start up your Linux® operating systems. This
practice ensures that critical services start automatically when the server reboots.

Ubuntu and Debian systems

With Ubuntu® and Debian® systems, use the following command:

systemctl enable apache2

To stop the service from starting on start up, use the following command:

systemctl disable apache2

CentOS and RHEL systems

With CentOS® and RHEL® systems, use the following command:

chkconfig httpd on

To stop the service from starting on start up, use the following command:

chkconfig httpd off

Note: With CentOS and RHEL 7 systems, you can use either the systemctl or chkconfig commands.