How to Restart Apache in Ubuntu?
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 gracefully?

Restarting Apache Web Server from the command line

  1. Start Apache. apachectl start.
  2. Stop Apache. apachectl stop. Graceful Stop apachectl graceful-stop.
  3. Restart Apache. apachectl restart. Graceful restart apachectl graceful.
  4. To find the Apache version. httpd -v.

How do I know if Apache is running on Ubuntu?

How to check running status of LAMP stack

  • For Ubuntu: # service apache2 status.
  • For CentOS: # /etc/init.d/httpd status.
  • For Ubuntu: # service apache2 restart.
  • For CentOS: # /etc/init.d/httpd restart.
  • You can use mysqladmin command to find out whether mysql is running or not.
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest