How Do I Do The Equivalent of "apachectl configtest" With Apache For Windows?

What is the equivalent of apachectl configtest on Apache for Windows?

According to the current Apache 2.4 documentation for apachectl, configtest is equivalent to httpd -t. For reference, httpd -t allows you to:

Run syntax tests for configuration files only. The program immediately exits after these syntax parsing tests with either a return code of 0 (Syntax OK) or return code not equal to 0 (Syntax Error). If -D DUMP_VHOSTS is also set, details of the virtual host configuration will be printed. If -D DUMP_MODULES is set, all loaded modules will be printed.

Configuration errors for both httpd.conf and any virtual host files will also typically be caught with a manual, non-service manager service start-up (httpd -k start) ex.

command line Apache test options - screenshot

You will need to stop any running Apache service before attempting httpd -k start (httpd -t should have no such requirement).


Note that while the question is in regards to Apache 2.2, the general documentation for apachectl configtest and httpd -t hasn't changed between versions 2.2. and 2.4.


I have Apache 2.2 for Windows installed on my laptop.

As of this writing, Apache 2.2 is officially End-of-Life. As of January 1st, 2018:

Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases [...] and no further evaluation of security risks will be published for 2.2.x releases.

If you don't have a compelling reason to stick with version 2.2 (ex. it's for personal use and you don't need some specialized module(s), etc.), you may want to seriously consider upgrading.

I would recommend the native (non-Cygwin) Windows builds from Apache Lounge. They generally keep pace with the latest official Apache Foundation releases (or aren't far behind) and have a decent selection of common optional modules.

(As a small FYI, upgrading from version 2.2 to 2.4 will require some small syntax changes in your configuration files but nothing major).


While this doesn't really answer my configtest question, I was able to determine why httpd won't start by looking in:

c:\Apache2.2\logs\error.log

There were many repitions of:

 (OS 3)The system cannot find the path specified.  : httpd.exe: could not open error log file C:/cygwin64/home/Thunderball/_Websites/Soggy/logs/error.log.
 Unable to open logs

Going back to cygwin I got the bad news that all but one of the folders in my home directory no longer exist!

Sucks to be me. :-(

I recently got the idea that my Acer's hard drive was failing. I can't find anything in my history that would have accidentally blown all of my data away.

Perhaps Right Now would be a good time to stop using my Acer. I'm mostly OK as I have good backups, and a Mac mini at home. I can't buy a replacement drive until I complete my project for my current contract. Until then I'm going to be a little short of cash.

I'm mostly happy with my Acer Aspire E 15, so I will replace its drive, mostly likely with an SSD, as well as its screen which is badly scratched.