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 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 386
  • 570,741

DesignLinux.com © All rights reserved

Go to mobile version