I installed Apache in it’s default directory under C:\Program Files\Apache Software Foundation\Apache2.2. During the installation process, a service Apache2.2 was created.
When using the Apache Monitor application or the Windows Services tool as a user with administrator privileges, I am able to start and stop the service without problem and it serves websites and everything seems to work fine.
For security reasons, I would like to start the httpd server from a user account with limited privileges.
After digging through some documentation and using ProcessMonitor to debug any file and registry access problems, I think I got the permissions for the files and directories right – only a few failed accesses to C:\ and to the EventLog registry entry show up in ProcessMonitor when trying to start the service.
Nevertheless, it fails with the error message
Windows could not start the Apache2.2 on Local Computer. For more information, review the System Event Log. (…)
This event log shows the following message:
(20024)The given path is misformatted or contained invalid characters: Invalid config file path C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
Since I read that httpd doesn’t accept backslashes (although they seem to work when started by a user with administrator rights), I changed the services’ parameters to use forward-slashes, quoted, unquoted, removed them, made them relative (in order to remove spaces from them) such as ../conf/httpd.conf and other variants, but without success so far.
The Apache webserver seems to traverse all directories starting from
C:\down the hierarchy until it reaches the directory where it findshttpd.conf. For the question, these directories are:To solve the problem, all these directories need to have the List Folder Contents privilege set for the user account under which
httpdis executed.The error messsage it gives in the event log is therefore misleading, the path is correct.
To avoid having to change the permission settings for all these folders, I would recommend installing Apache in a direct subdirectory of
C:\, such asC:\Apache2.2\.