LinuxAdminToolkitLinuxAdminToolkit
Home
Guide
About Me
GitHub
Home
Guide
About Me
GitHub
  • Administrator's Manual

    • Commands
      • Basic Commands
      • File Management
      • Process Management
      • User and Group Management
      • System Information
      • Disk Usage
    • Networking
      • IP Address
      • Subnetting
      • Routing
      • Firewall
      • Network Tools
    • Services
      • Service Management
      • Service Configuration
      • Common Services
    • Monitoring and Logging
      • System Monitoring
      • Log Management
      • Monitoring Tools
      • Log Analysis Tools
    • Shell Scripting
      • Basic Shell Script Structure
      • Variables
      • Control Structures
      • Functions
      • Input and Output
      • Debugging and Error Handling
      • Advanced Topics
    • Configurations Files
      • System Configuration Files
      • Network Configuration Files
      • Service Configuration Files
      • Application Configuration Files
      • Editing Configuration Files
      • Backup and Restore Configuration Files

Service Management

Starting a Service

  • To start a service, we need to use systemctl start command followed by the service name.
sudo systemctl start apache2

Stopping a Service

  • To stop a service, we need to use systemctl stop command followed by the service name.
sudo systemctl stop apache2

Restarting a Service

  • To restart a service, we need to use systemctl restart command.
  • This is useful for applying configuration changes without rebooting the system.
sudo systemctl restart apache2

Enabling a Service

  • To enable a service to start automatically at boot, we need to use systemctl enable command.
sudo systemctl enable apache2

Disabling a Service

  • To disable a service from starting automatically at boot, we need to use systemctl disable command.
sudo systemctl disable apache2

Checking Service Status

  • To check the status of the service, we need to use systemctl status command.
  • This provides information about the service's current state and any error messages.
sudo systemctl status apache2
Edit this page on GitHub
Last Updated:
Contributors: Jenil Gajjar, jenilgajjar20
Next
Service Configuration