{"id":1908,"date":"2019-01-26T13:00:30","date_gmt":"2019-01-26T13:00:30","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=1908"},"modified":"2019-01-20T23:36:50","modified_gmt":"2019-01-20T23:36:50","slug":"install-apache-as-a-service-on-windows","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/1908\/install-apache-as-a-service-on-windows\/","title":{"rendered":"Install Apache as a Service on Windows"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"1950\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/1908\/install-apache-as-a-service-on-windows\/install_apache_as_service\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"install_apache_as_service\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?resize=678%2C254\" alt=\"\" class=\"wp-image-1950\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_as_service.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>Today I share how you can install the Apache webserver as a Windows service.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Why install Apache as a service?<\/h2>\n\n\n\n<p>By installing Apache as a service you are able to have it start automatically on boot.<\/p>\n\n\n\n<p>In addition to this, running Apache as a windows service allows you to easily restart it. When running as a service you can monitor the program through the services panel in Windows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Apache as a Windows Service<\/h2>\n\n\n\n<p>To install Apache as a service you need to use an admin command prompt. This can be opened by typing <code>cmd<\/code> in the search bar and right clicking it to select &#8220;Run as administrator&#8221;.<\/p>\n\n\n\n<p>Once the command window is open you need to <code>cd<\/code> into the bin directory of the apache folder. This is the folder that holds <code>httpd.exe<\/code>.<\/p>\n\n\n\n<p>To install the service with the default name, run the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">httpd.exe -k install<\/pre>\n\n\n\n<p>By default, for Apache 2.4 this will a service with the name &#8220;Apache2.4&#8221;.<\/p>\n\n\n\n<p>To install the service with a custom name, use the <code>-n<\/code> flag. In the below example I have called my service &#8220;Apache HTTP Server&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">httpd.exe -k install -n \"Apache HTTP Server\"<\/pre>\n\n\n\n<p>Using these commands you can install Apache as a Windows service to help manage it and run at start up.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I share how you can install the Apache webserver as a Windows service.<\/p>\n","protected":false},"author":1,"featured_media":1952,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I post a quick post describing how you can Install #Apache as a #Service on #Windows","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[68,252,29],"class_list":["post-1908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informational","tag-apache","tag-webserver","tag-windows"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/install_apache_windows_service.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-uM","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1911,"url":"https:\/\/chewett.co.uk\/blog\/1911\/uninstall-apache-as-a-service-on-windows\/","url_meta":{"origin":1908,"position":0},"title":"Uninstall Apache as a Service on Windows","author":"Chewett","date":"February 9, 2019","format":false,"excerpt":"Today I share how you can uninstall the Apache Windows service. Why uninstall the Apache Service If you want to reinstall Apache you will want to remove the service first. This ensures you will be able to fully uninstall apache before reinstall. In other situations you might want to reinstall\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/uninstall_apache_windows_service.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/uninstall_apache_windows_service.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/uninstall_apache_windows_service.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/uninstall_apache_windows_service.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1900,"url":"https:\/\/chewett.co.uk\/blog\/1900\/adding-a-virtual-host-in-apache\/","url_meta":{"origin":1908,"position":1},"title":"Adding a Virtual Host in Apache","author":"Chewett","date":"February 27, 2019","format":false,"excerpt":"This post includes a short snippet and some explanation about how you can use Virtual Hosts with Apache. Why use a Virtual Host To run multiple sites with a single Apache install you can use Virtual Hosts. This is a feature where Apache will load different webserver configurations depending on\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/virtual_host_with_apache.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/virtual_host_with_apache.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/virtual_host_with_apache.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/virtual_host_with_apache.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":490,"url":"https:\/\/chewett.co.uk\/blog\/490\/setting-ssl-certbot-apache-fedora\/","url_meta":{"origin":1908,"position":2},"title":"Setting up SSL with certbot with Apache and Fedora","author":"Chewett","date":"August 16, 2017","format":false,"excerpt":"This post describes how to set \u00a0up a SSL certificate with Certbot on Apache and Fedora. The guide primarily follows the guide on the certbot website however adds some additional information for if auto configuration fails. Running Certbot on Fedora On Fedora running certbot is relatively easy as it is\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/ssl_with_apache_fedora_and_certbot.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":982,"url":"https:\/\/chewett.co.uk\/blog\/982\/fixing-letsencrypt-validation-failed-selected-authenticator-not-support-combination-challenges\/","url_meta":{"origin":1908,"position":3},"title":"Fixing Letsencrypt validation failed with selected authenticator does not support any combination of challenges","author":"Chewett","date":"January 31, 2018","format":false,"excerpt":"This post goes through the steps of fixing Letsencrypt with the issue \"Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.\". Why Letsencrypt fails to validate domains When trying to set up a new https website with Letsencrypt you may get\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/fixing_letsencrypt_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/fixing_letsencrypt_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/fixing_letsencrypt_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/fixing_letsencrypt_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":148,"url":"https:\/\/chewett.co.uk\/blog\/148\/location-geoip-dat-php\/","url_meta":{"origin":1908,"position":4},"title":"Location of GeoIP.dat for PHP","author":"Chewett","date":"September 1, 2013","format":false,"excerpt":"To find the location of GeoIP for PHP you can ssh into the server and use the \"find\" command. find \/ -iname GeoIP.dat Will return a list of file paths where the file with this name is found. In my case I found: \/usr\/share\/GeoIP\/GeoIP.dat \/usr\/local\/share\/GeoIP\/GeoIP.dat \/opt\/geoip\/share\/GeoIP\/GeoIP.dat In my case the\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":82,"url":"https:\/\/chewett.co.uk\/blog\/82\/raspberry-pi\/","url_meta":{"origin":1908,"position":5},"title":"Raspberry Pi!","author":"Chewett","date":"January 22, 2013","format":false,"excerpt":"During Christmas I got a raspberry pi and I have been waiting to start playing around with it for ages. Finally I decided to order the remaining pieces for it such as the power cable and SD card. Since I didn't have a HDMI TV around I decided to plug\u2026","rel":"","context":"In \"Linux\"","block_context":{"text":"Linux","link":"https:\/\/chewett.co.uk\/blog\/tag\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=1908"}],"version-history":[{"count":4,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1908\/revisions"}],"predecessor-version":[{"id":1955,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1908\/revisions\/1955"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/1952"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=1908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=1908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=1908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}