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.
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]
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]
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]