How to restart Apache Server in Linux using Terminal

How to restart Apache Server in Linux using Command Line Terminal

Restart Apache Server in Linux using command line terminal, is just matter of executing commands through terminal in linux, mac or putty in windows. But for different operating systems these commands are different. Here we have commands for all major server operating systems like CentOs, Ubuntu, Redhat and other operating systems.

1

In centos

This below command is used to start the apache server in Centos.
[bash]sudo service httpd start[/bash] This below command is used to stop the apache server in Centos.
[bash]sudo service httpd stop[/bash] This below command is used to restart the apache server in Centos.
[bash]sudo service httpd restart[/bash]

2

In Ubuntu

This below command is used to start the apache server in Ubuntu.
[bash]sudo service apache2 start[/bash] This below command is used to stop the apache server in Ubuntu.
[bash]sudo service apache2 stop[/bash] This below command is used to reload the apache server in Ubuntu.
[bash]sudo service apache2 reload[/bash] This below command is used to restart the apache server in Ubuntu.
[bash]sudo service apache2 restart[/bash]

3

In Redhat

This below command is used to start the apache server in Redhat.
[bash]/etc/init.d/httpd start[/bash] This below command is used to stop the apache server in Redhat.
[bash]/etc/init.d/httpd stop[/bash] This below command is used to restart the apache server in Redhat.
[bash]/etc/init.d/httpd restart[/bash]

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: