Surf the Dream A discourse of links and articles from Justin Avery

How to test restart apache

If you’re new to Linux, and to Apache, chances are you are going to make a couple of mistakes when updating configuration files.

Fortunately there are a few commands to help you fix these issues before you make the changes matter.

With most changes to the Apache configuration file, you are required to restart Apache for the changes to take affect, but if you’ve made a mistake in your reconfiguration then Apache will still restart with those mistakes present, or what’s worse it won’t restart at all and you’ll be without a website.

That’s when a nice little command like

sudo /usr/sbin/apache2ctl configtest


sudo /usr/sbin/apachectl graceful

come in very handy. These commands return any error messages that you might receive if you were to reboot.

Once you’re happy the changes you have made are right to go, use the trusty

sudo /etc/init.d/apache2 restart

Surf the Dream is a blog that has been running since the mid 2000's when it started on BlogSpot. Over the years it's been rebranded as (now my resume) and (which now redirects back to this site).

I offer consultation services through Simple Things, produce a range of high quality pocket notebooks(including a Solar System Notebook, Space Notebook, and a Guitar Notebook), write about the Universe and run a responsive web design knowledge hub and a RWD Weekly Newsletter.