{"id":4038,"date":"2023-07-26T10:20:08","date_gmt":"2023-07-26T10:20:08","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=4038"},"modified":"2023-10-20T16:43:31","modified_gmt":"2023-10-20T16:43:31","slug":"restart-apache-ubuntu-18","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/","title":{"rendered":"Restart Apache Ubuntu 18 Without Losing Data"},"content":{"rendered":"<p>Apache restart instructions for Restart Apache Ubuntu 18.04. You must reload or restart the daemon after making changes to Apache2&#8217;s settings or updates. You will learn how to restart <a href=\"https:\/\/en.wikipedia.org\/wiki\/Apache_HTTP_Server\" target=\"_blank\" rel=\"noopener\">Apache Web Server<\/a> in Ubuntu Server 18.04 in this article.<\/p>\n<p>Either the systemctl command or the apache2ctl command can be used to restart the Ubuntu Apache2 Web Server.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#In_Ubuntu_restart_Apache2_by_executing_the_systemctl_command\" >In Ubuntu, restart Apache2 by executing the systemctl command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Use_the_apache2ctl_command_to_restart_Apache_Web_Server\" >Use the apache2ctl command to restart Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#In_Ubuntu_Server_1804_Apache_Graceful_Restart_is_used\" >In Ubuntu Server 18.04, Apache Graceful Restart is used.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#How_to_Restart_Apache_Ubuntu\" >How to Restart Apache Ubuntu?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#How_to_launch_shut_down_or_restart_Apache_on_Ubuntu\" >How to launch, shut down, or restart Apache on Ubuntu?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q1_Should_Apache_be_restarted\" >Q#1: Should Apache be restarted?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q2_I_need_to_restart_the_httpd_services\" >Q#2: I need to restart the httpd services.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q3_In_what_command_is_Apache_restarted\" >Q#3: In what command is Apache restarted?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q4_How_can_I_tell_if_Apache_is_active\" >Q#4: How can I tell if Apache is active?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q5_Where_is_Ubuntu_installed_with_apache2\" >Q#5: Where is Ubuntu installed with apache2?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/#Q6_When_a_server_is_restarted_do_the_services_also_restart\" >Q#6: When a server is restarted, do the services also restart?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"In_Ubuntu_restart_Apache2_by_executing_the_systemctl_command\"><\/span><strong>In Ubuntu, restart Apache2 by executing the systemctl command<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Use the systemctl command to restart the apache2 service to restart Apache Server in Ubuntu.<\/p>\n<ul>\n<li><code>restart Apache2.service with sudo<\/code><\/li>\n<\/ul>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service.png\"><img fetchpriority=\"high\" decoding=\"async\" title=\"restart apache2 service\" class=\"wp-image-4039 size-full\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service.png\" alt=\"restart-apache2-service\" width=\"800\" height=\"80\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service.png 800w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service-300x30.png 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service-768x77.png 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service-640x64.png 640w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2022\/10\/restart-apache2-service-400x40.png 400w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>Without restarting the entire HTTP Process, the systemctl commands reload option will reload the configuration file for Apache.<\/p>\n<ul>\n<li><code>systemctl reload apache2.service with sudo<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Use_the_apache2ctl_command_to_restart_Apache_Web_Server\"><\/span><strong>Use the apache2ctl command to restart Apache Web Server<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/arzhost.com\/blogs\/restart-apache-ubuntu-18\/\">Restart Apache Ubuntu 18<\/a><\/strong><\/span>.04 uses the apache2ctl command, which is a relatively straightforward tool, to operate the Apache2 server.<\/p>\n<ul>\n<li><code>restarting sudo apache2ctl<\/code><\/li>\n<\/ul>\n<p>This will restart Ubuntu Server 18.04&#8217;s Apache web server.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"In_Ubuntu_Server_1804_Apache_Graceful_Restart_is_used\"><\/span><strong>In Ubuntu Server 18.04, Apache Graceful Restart is used.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/vKUxRj5nLUc\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Only the apache configuration file will be loaded by the Graceful Restart option. Without having to restart the entire apache2 process, you can use the graceful option to reread the configuration file after making changes to the apache configuration file.<\/p>\n<ul>\n<li><code>apache2ctl sudo graceful<\/code><\/li>\n<\/ul>\n<p>In Ubuntu, you could still use the service Command or the init. d script to restart Apache, but both will instead issue the systemctl command.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Restart_Apache_Ubuntu\"><\/span><strong>How to Restart Apache Ubuntu?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><strong>Ubuntu Linux:<\/strong> restart Apache There are numerous ways to Restart Apache Ubuntu 18, just like many other services. Since systemd is used by Ubuntu 16.04, 18.04, and later editions, you can control any\u2026<\/p>\n<ul>\n<li><code>systemctl reload apache2 with sudo<\/code><\/li>\n<li><code>service apache2 sudo reload<\/code><\/li>\n<li><code>systemctl restart apache2 with sudo<\/code><\/li>\n<li><code>service apache2 restart with sudo<\/code><\/li>\n<li><code>service status systemctl apache2.<\/code><\/li>\n<li><code>apache2 service status<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"How_to_launch_shut_down_or_restart_Apache_on_Ubuntu\"><\/span><strong>How to launch, shut down, or restart Apache on Ubuntu?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Launch the Apache Web Server. Use the following instructions in the terminal window to start Apache for users of Ubuntu 18.04 and 20.04: systemctl start with sudo&#8230;<\/p>\n<ul>\n<li><code>systemctl start apache2 $<\/code><\/li>\n<li><code>systemctl status apache2 $<\/code><\/li>\n<li><code>systemctl stop apache2 with sudo<\/code><\/li>\n<li><code>systemctl status apache2 $<\/code><\/li>\n<li><code>systemctl restart apache2 with sudo<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span><strong>People Also Ask<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Q1_Should_Apache_be_restarted\"><\/span><strong><u>Q#1: Should Apache be restarted?<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When you want changes you make to take effect or when you need to get Apache&#8217;s resource usage back to normal, you might need to restart Apache\u00ae. However, Apache can occasionally fail to restart. In case Apache stops working, this article demonstrates how to examine your configuration settings and restart Apache.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q2_I_need_to_restart_the_httpd_services\"><\/span><strong><u>Q#2: I need to restart the httpd services.<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To start the apache server if you are using the default Listen directive in httpd. conf, which is port 80, you will require root capabilities. \/sbin\/service httpd stop can also be used to terminate HTTPD. The restart option can be used to quickly stop and start the Apache HTTP Server.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q3_In_what_command_is_Apache_restarted\"><\/span><strong><u>Q#3: In what command is Apache restarted?<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The Apache web server can be restarted using the systemctl restart command. The sudo command can be used by regular users to restart apache, however, the service management function requires root capabilities.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q4_How_can_I_tell_if_Apache_is_active\"><\/span><strong><u>Q#4: How can I tell if Apache is active?<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>So, perform the following actions to see if Apache is running on Ubuntu, macOS, or Windows: In most circumstances, typing http:\/\/server-ip:80 on any browser you use will display whether Apache is active or not. To be sure, you can perform a more thorough search by entering the command &#8220;service apache2 status&#8221;.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q5_Where_is_Ubuntu_installed_with_apache2\"><\/span><strong><u>Q#5: Where is Ubuntu installed with apache2?<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Depending on the Linux distribution, there are differences in the configuration file for Apache and the installation process. However, all distributions use \/var\/www\/Html as the default document root. The configuration file for Apache2 is located in \/etc\/apache2\/apache2, and it is referred to as &#8220;Apache2&#8221; in Debian and Ubuntu editions.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q6_When_a_server_is_restarted_do_the_services_also_restart\"><\/span><strong><u>Q#6: When a server is restarted, do the services also restart?<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>All running processes are stopped and restarted when a server is restarted. All active processes are terminated when a server reboots. Rebooting a server is often performed when restarting a server does not fix the problem because it is more disruptive and takes longer.<\/p>\n<p><strong>Read More Articles\u00a0<\/strong><\/p>\n<ul>\n<li><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/arzhost.com\/blogs\/restart-web-server-centos\/\">restart web server centos<\/a><\/span><\/li>\n<li><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/arzhost.com\/blogs\/buy-hosting-with-bitcoin\/\">buy hosting with bitcoin<\/a><\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Apache restart instructions for Restart Apache Ubuntu 18.04. You must reload or restart the daemon after making changes to Apache2&#8217;s settings or updates. You will learn how to restart Apache Web Server in Ubuntu Server 18.04 in this article. Either the systemctl command or the apache2ctl command can be used to restart the Ubuntu Apache2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"table_tags":[],"class_list":["post-4038","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=4038"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4038\/revisions"}],"predecessor-version":[{"id":8806,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4038\/revisions\/8806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6356"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=4038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=4038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=4038"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=4038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}