Linux

How to Restart Apache On Linux Using SSH Commands

What are the differences between apache2 and httpd Service

First on this article you may see different service name for the Apache (apache2 and httpd) .Actually httpd and apache2 are the same both refer to Apache service the only difference is that apache2 is the name of the service on Debian/Ubuntu Linux and httpd is the name of the service on RedHat, CentOS, Fedora Linux OS.

Why you need to Restart Apache Service

In most cases you only need to restart Apache if you change any Apache .conf file , other configurations may need it for any sites can overrides by editing .htaccess file .

How To Restart Apache Service under Linux / UNIX

The following examples using the restart command in case you want to stop the service you can use stop command and use start command to start stopped service.

You have run these command under root/administrator privileges .

Restart Apache Service On Debian/Ubuntu Linux

/etc/init.d/apache2 restart
Or
sudo /etc/init.d/apache2 restart

Restart Apache on CentOS/RHEL/Red Hat Linux version 4.x/5.x/6.x

service httpd start

Restart Apache on CentOS/RHEL/Red Hat Linux version 7.x

systemctl restart httpd.service

 

XsoftHost Support

Share

Recent Posts

Add Extra IP addresses to server configuration On Ubuntu 17.10 and later

Each failover IP address will need its own line in the configuration file. The configuration…

4 years ago

Create RAID Arrays with mdadm on Ubuntu

What is mdadm? The mdadm utility can be used to create and manage storage arrays…

4 years ago

How to change the maximum upload file size for PHP

There are several scenarios that you might need to increase or decrease your php maximum…

6 years ago

How to install Let’s Encrypt Plugin in WHM/cPanel

What is Let’s Encrypt? Let’s Encrypt is a free certificate authority provided by the Internet…

6 years ago

How to install python in my cPanel and add py extension

Python normally installed on all cPanel hosting server because most of Centos/red hat update system…

6 years ago

How to install and enable GUI GNOME Desktop on centos 7

Usually CentOS 7 comes in a numbers of variants, For most users, there are two…

6 years ago