How to Restart Apache Linux?

How to Restart Apache Linux?
Contents

Debian/Ubuntu Linux Specific Commands to Start/Stop/Restart Apache

  • Restart Apache 2 web server, enter: # /etc/init.d/apache2 restart. OR. $ sudo /etc/init.d/apache2 restart.
  • To stop Apache 2 web server, enter: # /etc/init.d/apache2 stop. OR.
  • To start Apache 2 web server, enter: # /etc/init.d/apache2 start. OR.

How do I restart Apache httpd?

If you are using the default Listen directive in httpd.conf , which is port 80, you will need to have root privileges to start the apache server. You can also stop httpd using /sbin/service httpd stop . The restart option is a shorthand way of stopping and then starting the Apache HTTP Server.

How do I restart apache on CentOS?

Restarting Apache on CentOS 7

  1. Step 1: Restart Apache Server Using Systemctl Command. Open a terminal window and enter the following: sudo systemctl restart httpd.service.
  2. Step 2: Restart HTTPD Server Using Apachectl Command Script. Apache recommends using a control script to pass commands to the httpd process.
James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.