14

I am new to Windows and I am trying to figure out what user Apache is running on. In Linux I had a simple command ps aux | grep apache. How do I find that out in windows? Is it some where in httpd.conf file?

Linger
  • 14,942
  • 23
  • 52
  • 79
John Harris
  • 159
  • 1
  • 3
  • 8

4 Answers4

14

You can include a line of code in your PHP script:

echo exec('whoami');
PPPPPPPPP
  • 660
  • 7
  • 14
10

By default the Apache services are registered to run as the system user (the LocalSystem account).

The section "Running Apache as a Service" in the help documentation below might help you configure Apache the way that you want to.

http://httpd.apache.org/docs/2.0/platform/windows.html

David Kartik
  • 454
  • 4
  • 9
9
  1. Bring up the task manager by pressing Ctrl+Shift+Esc.
  2. Go to the Processes tab and sort by Image Name. In Server 2012, go to the Details tab and sort by Name.
  3. Look for apache.exe (or httpd.exe) and check the User Name column.
Mike Sherrill 'Cat Recall'
  • 91,602
  • 17
  • 122
  • 185
dwurf
  • 12,393
  • 6
  • 30
  • 42
1

In Powershell you can interrogate the registry for the user context the service is running under:

(Get-ItemProperty HKLM:\system\CurrentControlSet\Services\Apache2.4).ObjectName
leancz
  • 688
  • 5
  • 21