centos restart apache code example
Example 1: centos stop apache
systemctl restart httpd.service
systemctl start httpd.service
systemctl stop httpd.service
Example 2: restart apache
sudo systemctl restart apache2
# or
sudo service apache2 restart
Example 3: restart apache
/usr/sbin/httpd -k restart