Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Start, Stop, or Restart Apache Service - DesignLinux

Aug 29 2020
designlinux 0 Comments
How to Start, Stop, or Restart Apache

Apache is cross-platform and open-source Web server. It is part of the popular LAMP (Linux, Apache, MySQL, PHP) stack of software. This guide will show you how to start, stop, and restart Apache service on Linux systems.

It comes loaded with powerful features and can be further extended with a wide variety of modules. The Apache service managing are different across Linux distributions.

Currently, the latest Linux distributions are using SystemD as the default init system and service manager. So based on this Apache service can be manage and also the name of the service are different across the distributions. For example, in Ubuntu and Debian, the Apache service name is apache2 while in Red Hat based system like CentOS, the Apache service name is httpd.

Prerequisite#

Make sure you are logged in as root or user with sudo privileges.

The SystemD service units script takes the following arguments to manage the Apache service:

  • start: Starts the Apache service.
  • stop: Terminates the Apache service.
  • restart: Stops and then starts the Apache service.
  • reload: Gracefully restarts the Apache service. On reload, the main Apache process shuts down the child processes, loads the new configuration, and starts new child processes.
  • status: Shows the service status.

Start, Stop and Restart Apache on Ubuntu and Debian#

On latest Ubuntu 20.04, 18.04, 16.04 and Debian 10, 9 ships with SystemD as system and service manager.

To start the Apache service run the below command:

sudo systemctl start apache2

Execute the following command to stop the Apache service:

sudo systemctl stop apache2

When you do any changes to the Apache configuration, you need to restart the server processes. Run the following command to restart the Apache service:

sudo systemctl restart apache2

Start, Stop and Restart Apache on RHEL/CentOS#

Also, on RHEL/CentOS 7 and 8 Systemd is the system and service manager.

Start the Apache service:

sudo systemctl start httpd

Stop the Apache service:

sudo systemctl stop httpd

Restart the Apache service:

sudo systemctl restart httpd

Conclusion#

In this article, we show you how to start, stop, and restart Apache service on various Linux systems.

If you have any questions or suggestion, please leave a comment below.

Related

Tags: apache, terminal

The Best Linux Distributions for KDE Plasma 5

Prev Post

How to Install Wine 5.0 on CentOS, RHEL and Fedora

Next Post
Archives
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • CentOS
  • CentOS Stream
  • Cloud Software
  • CMS
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Development Tools
  • Drupal
  • Editors
  • Fedora
  • Firewalls
  • GIMP
  • Hadoop
  • HAProxy
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Linux Commands
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • Open Source
  • OpenSUSE
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Security
  • Shell Scripting
  • SSH
  • Storage
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • Web Browsers
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zorin OS
Visits
  • 0
  • 5,011
  • 20,175

DesignLinux.com © All rights reserved

Go to mobile version