Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find where Apache's httpd.exe is installed?

Tags:

windows

apache

How do I best figure out if and where Apache is installed on a windows machine?

I'm writing a script that uses the installed apache, but sets up it's own config & server-root, and I don't want to hardcode it nor have the user explicitly set it (unless necessary).

I tried to search the registry, but couldn't find anything useful.

Update for those posting default paths

On my machine, it was in C:/Program Files/Apache Software Foundation/Apache2.2. And if I had Vista 64-bit, it'd probably be under 'Program Files (x86)'. And if the computer doesn't have an English OS, it's even worse.

Workaround

Guess I have to check %PROGRAMFILES% for Apache 2.0 or 2.2's default path, then fall back to a prompt. It's be nice to read the registry and find out exactly where it is.

Final note

Apache was not installed for 'Everyone', but only the current user. That makes it a bit more difficult to find as there are no services nor registry keys/folders to point there.

like image 626
Macke Avatar asked Apr 08 '09 14:04

Macke


1 Answers

You can get the path to the service exe in the services.msc too.

(my apache for some reason is installed in AppData. don't know why if it's because I've installed using chocolatey)

enter image description here

then

enter image description here

then

enter image description here

PS: sorry, about the portuguese in the UI. but I guess it still pretty understandable.

--

EDIT

programaticaly you may run this line in cmd and check if it helps: wmic service get PathName | findstr apache

like image 75
mukade Avatar answered Sep 27 '22 17:09

mukade