{"id":2504,"date":"2018-06-17T16:18:28","date_gmt":"2018-06-17T16:18:28","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=2504"},"modified":"2024-08-05T17:30:08","modified_gmt":"2024-08-05T17:30:08","slug":"how-to-create-a-windows-service-for-apache-server","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-create-a-windows-service-for-apache-server\/","title":{"rendered":"How to create a Windows Service for Apache Server"},"content":{"rendered":"<h2>How to create a Windows Service for Apache Server<\/h2>\n<p>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 <strong>services.msc<\/strong> on the run command.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.testingdocs.com\/questions\/download-install-apache-http-server-on-windows\/\">Install Apache Server on Windows<\/a><\/li>\n<\/ul>\n<h2>Create Service<\/h2>\n<p>To add Apache HTTP Server as a Windows Service, follow the steps:<\/p>\n<p>Launch Command Prompt with Administrator privileges.<\/p>\n<p>Navigate to the Apache server <strong>bin<\/strong> directory.<\/p>\n<p>Issue the following command.<\/p>\n<p><strong>&gt; httpd.exe -k install -n &#8220;Apache Server&#8221;<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2522 size-full\" title=\"Windows Service for Apache Server\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install.png\" alt=\"Windows Service for Apache Server\" width=\"1918\" height=\"986\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install.png 1918w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install-300x154.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install-1024x526.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install-768x395.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Apache-Server-Service-Install-1536x790.png 1536w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>C:\\Windows\\system32&gt;httpd.exe -k install -n &#8220;Apache Server&#8221;<br \/>\nInstalling the &#8216;Apache Server&#8217; service<br \/>\nThe &#8216;Apache Server&#8217; service is successfully installed.<br \/>\nTesting httpd.conf&#8230;.<br \/>\nErrors reported here must be corrected before the service can be started.<\/p>\n<h3>Common Mistake<\/h3>\n<p>The common mistake is to open the command prompt without admin privileges. Trying to create a service without admin would result in the error.<\/p>\n<p>Installing the &#8216;Apache Server&#8217; service<br \/>\n(OS 5)Access is denied. : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Administrator?<\/p>\n<h3>Start Service<\/h3>\n<p>Open the services tab on the run command. Type &#8220;<strong>services.msc<\/strong>&#8221;<\/p>\n<p>Right-click on the Apache server service.<\/p>\n<p>Click on the Start option to start the Apache service.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2525\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service.png\" alt=\"Start Apache Service\" width=\"1626\" height=\"1041\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service.png 1626w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service-300x192.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service-1024x656.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service-768x492.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Start-Apache-Service-1536x983.png 1536w\" sizes=\"auto, (max-width: 1626px) 100vw, 1626px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Alternatively, we can click on the Properties option and click on the Start button.\u00a0After a successful start, the status of the service should change to the <strong>Running<\/strong> state.<\/p>\n<h2>Stop Service<\/h2>\n<p>We can click on the <strong>Properties<\/strong> option and click on the <strong>Stop<\/strong> button to stop the service.<\/p>\n<p>More Information on Apache Web server:<\/p>\n<ul>\n<li><a href=\"https:\/\/httpd.apache.org\/\" target=\"_blank\" rel=\"noopener\">https:\/\/httpd.apache.org\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How to create a Windows Service for Apache Server : In this post, we will create Apache as a Windows Service. We can view Windows Services<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-2504","post","type-post","status-publish","format-standard","hentry","category-windows","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=2504"}],"version-history":[{"count":8,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2504\/revisions"}],"predecessor-version":[{"id":23550,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2504\/revisions\/23550"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=2504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=2504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=2504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}