Pradeep
Pradeep

Reputation: 116

Apache service wont start through windows services

Using Apache2.4

I could able to start the server and listen on port 8080 through powershell or cmd.

I created a windows service using

httpd.exe -k install

and I could see the service installed as Apache2.4.

When I try to start the server through the windows service it fails with below error, whereas I could able to start the apache server from cmd(run perfectly).

Error output here

Upvotes: 0

Views: 1387

Answers (2)

Jeffrey
Jeffrey

Reputation: 1804

If you can run httpd.exe via command line, but are unable to start it as a service; the problem might be in folder permissions.

(as stated by Pradeep, see:) Run > eventvwr > windows > Application > ...

If the error is:

DocumentRoot must be a directory .

Make sure that all paths with DocumentRoot, you have added in your apache config, can be accessed by the service.

  • Right click the folder
  • Select Properties
  • Go to the "Security" tab
  • Default values (in my case, windows 10 pro) are:
    • Authenticated Users
    • SYSTEM
    • Administrators (PC-Name\Administrators)
    • Users (PC-Name\Users

One of the folders in DocumentRoot did not have the above users listed, but only my hotmail account, meaning the system was unable to access the specific folder.

Upvotes: 0

Pradeep
Pradeep

Reputation: 116

When this problem appears and but running httpd through cmd works fine, Please see in event viewer to see the detailed error

Run -> eventvwr -> windows -> Application ->

Upvotes: 1

Related Questions