The following are commands to start, stop, and restart the Apache web server from the terminal. The commands are broken into different sections for different operating systems. Depending on which operating system your server is using, the command to use to stop, start, or restart Apache may vary.
CentOS (version 7.x)
To stop the Apache web server under CentOS:
systemctl stop httpd.service
To start the Apache web server under CentOS:
systemctl start httpd.service
To restart the Apache web server under CentOS:
systemctl restart httpd.service
Debian (version 8.x aka Jessie)
To stop the Apache web server under Debian:
service apache2 stop
To start Apache web server under Debian:
service apache2 start
To restart the Apache web server under Debian:
service apache2 restart
FreeBSD (version 10.x)
To stop the Apache web server under FreeBSD:
service apache24 stop
To start the Apache web server under FreeBSD:
service apache24 start
To restart the Apache web server under FreeBSD:
service apache24 restart