restart apache in ubuntu (start | stop | reload | config test) centos debian mac linux windows 10 xampp. learn more about very useful commands for apache server.
3 ways to restart apache in ubuntu & debian
sudo service apache2 restart
or
sudo /etc/init.d/apache2 restart
ot
systemctl restart apache2
3 ways to stop apache web server in ubuntu & debian
sudo service apache2 stop
or
sudo /etc/init.d/apache2 stop
ot
systemctl stop apache2
start apache web server in ubuntu & debian
sudo service apache2 start
or
sudo /etc/init.d/apache2 start
ot
systemctl start apache2
start / stop / restart Apache on a Linux Unix
apachectl -k stop
apachectl -k restart
apachectl -k graceful
Restart apache in CentOS/RHEL (Red Hat) Linux version
systemctl start httpd.service
systemctl stop httpd.service
systemctl restart httpd.service
Start restart stop apache in new version Debian Ubuntu Linux 8+
systemctl start apache2.service
systemctl stop apache2.service
systemctl restart apache2.service
Check apache server status running or inactive
systemctl status apache2.service
or
systemctl status apache2
or
service status apache2
Restart apache in ubuntu using service command
service apache2 start
service apache2 stop
service apache2 status
service apache2 restart
Test apache config file errors
sudo apachectl config test
ok
httpd -t
How do I restart Apache on Windows 10?
net stop Apache2.2-Zend && net start Apache2.2-Zend
GUI, I selected Start->Programs->Administrative Tools->Services
cd C:\Apache24\bin and then used command httpd -k restart to restart the Apache service.
How do I start Apache in Linux?
you can use same commands as above or just use systemctl or service to restart apache in ubuntu and debian or centos, RHEl.
service start apache2
How do I restart apache on AWS?
if you installed apache server on separate instance or virtual machine or kubernetes cluster you can restart apache within aws control panel.
or you can alternatively use linux terminal ssh command.
grab your apache server ip.
login using ssh client like putty.
run this command
service restart apache2 // works in ubuntu debian as well as centos, fedora rhel.