Site icon TestingDocs.com

How to create a Windows Service for Apache Server

Introduction

In this post, we will create Apache as a Windows Service. We can view Windows Services by opening the Windows Service manager. We can type services.msc on the run command.

Create Service

To add Apache HTTP Server as a Windows Service, follow the steps:

Launch Command Prompt with Administrator privileges.

Navigate to the Apache server bin directory.

Issue the following command.

> httpd.exe -k install -n “Apache Server”

 

 

C:\Windows\system32>httpd.exe -k install -n “Apache Server”
Installing the ‘Apache Server’ service
The ‘Apache Server’ service is successfully installed.
Testing httpd.conf….
Errors reported here must be corrected before the service can be started.

Common Mistake

The common mistake is to open the command prompt without admin privileges. Trying to create a service without admin would result in the error.

Installing the ‘Apache Server’ service
(OS 5)Access is denied. : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Administrator?

Start Service

Open the services tab on the run command. Type “services.msc

Right-click on the Apache server service.

Click on the Start option to start the Apache service.

 

 

Alternatively, we can click on the Properties option and click on the Start button. After a successful start, the status of the service should change to the Running state.

Stop Service

We can click on the Properties option and click on the Stop button to stop the service.

More Information on Apache Web server:

https://httpd.apache.org/

Exit mobile version