After installing the necessary services, it's important not to forget to enable them for automatic startup—so they launch when the operating system boots; otherwise, you'll need to start them manually again.
To enable automatic startup for a service, such as nginx or apache, use the following examples:
1. Enabling automatic startup for services
systemctl enable nginx
systemctl enable apache2
These examples only enable automatic startup for the services but do not start them. If you need to start them immediately, you can do so using the following command:
2. Starting nginx or apache services
service nginx start
service apache2 start
After rebooting the operating system, you can check whether a service is running with the following command:
service nginx status
3. Disabling automatic startup for services
systemctl disable nginx
systemctl disable apache2
Note: In Linux, there is another similar command called sysctl — it is used to modify kernel configuration and is not related to the systemctl — command mentioned above, which is responsible for managing services and the systemd service manager.