How to find where Apache httpd.exe is installed?

What is the best way to find out where and where Apache is installed on a Windows machine?

I am writing a script that uses the installed apache, but configures its own config and server-root, and I do not want to hardcode it, and the user does not explicitly install it (if necessary).

I tried to search the registry, but did not find anything useful.

Update for those sending default paths

On my machine, it was in C: / Program Files / Apache Software Foundation / Apache2.2. And if I had 64-bit Vista, it would probably be in the "Program Files (x86)" section. And if the computer does not have an English OS, this is even worse.

Bypass

Suppose I need to check% PROGRAMFILES% for Apache 2.0 or 2.2 by default, and then return to the prompt. It would be nice to read the registry and find out where it is.

Final note

Apache was not installed for "Everything", but only for the current user. This makes searching difficult, as there are no registry services or registry keys / folders to point there.

+4
source share
4 answers

I apparently installed Apache only for me (current user) and not for all users on my machine, so there is no registry key.

If installed for all users, the registry key is here:

HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Apache\2.2.xx\ServerRoot 
+1
source

Not quite the answer, but if I were you, I would use only the default path (% PROGRAMFILES% \ Apache Group \ Apache2 \ bin \ Apache.exe) or a couple of relatively safe default paths and ask if the executable was not found.

Otherwise, a completely unexpected installation may occur. I hate programs that are "too smart."

+1
source

Locate httpd.exe-related registry entry in the HKLM \ Services \ CurrentControlSet section.

+1
source

On Windows, it is installed in c: / Program Files / Apache Group / Apache2 / bin / Apache.exe

The other directories (conf, log, doc-root, etc.) are located in the c: / Program Files / Apache Group / Apache2 directory

0
source

All Articles