Warning: session_start(): open(/var/cpanel/php/sessions/alt-php74/sess_bdf2ce542f38f1b42da09053aca008f4, O_RDWR) failed: No such file or directory (2) in /home/xsofthost/public_html/help/wp-content/plugins/accelerated-mobile-pages/includes/redirect.php on line 358

Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/alt-php74) in /home/xsofthost/public_html/help/wp-content/plugins/accelerated-mobile-pages/includes/redirect.php on line 358
How to Restart Apache On Linux Using SSH Commands - XsoftHost

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

 

Share on facebook
Share on twitter
Share on linkedin
Share on telegram
Share on whatsapp

Related Posts