{"id":452,"date":"2018-10-17T11:41:10","date_gmt":"2018-10-17T11:41:10","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/check-out-ways-to-stop-and-restart-apache-on-linux-systems\/"},"modified":"2018-10-17T11:41:10","modified_gmt":"2018-10-17T11:41:10","slug":"check-out-ways-to-stop-and-restart-apache-on-linux-systems","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/check-out-ways-to-stop-and-restart-apache-on-linux-systems\/","title":{"rendered":"Check Out Ways to Stop and Restart Apache on Linux Systems"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"stop and restart apache linux\" height=\"341\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/09\/stop-and-restart-apache-on-linux.png\" width=\"713\" \/><\/p>\n<p>As we all know, Apache is a free and open source cross-platform web server that is used to serve both static and dynamic web pages. on the web. In this article, we&#8217;ll focus on how you can start and restart Apache web server on Linux systems using the apache2 command.<\/p>\n<h2>On Ubuntu\/Debian Linux<\/h2>\n<p>Let&#8217;s see how we can start, stop and restart apache2 web server in Ubuntu and Debian versions<\/p>\n<h2>Apache2 Restart\/Start\/Stop\/<\/h2>\n<p>For Ubuntu and Debian Systemd users &#8211; Ubuntu 18.04,16.04 and Debian 9.x later use below commands.<\/p>\n<p>Start Apache2 by running<\/p>\n<p># systemctl start apache2<\/p>\n<p>Stop Apache2 by running<\/p>\n<p># systemctl stop apache2<\/p>\n<p>Restart Apache2 by running<\/p>\n<p># systemctl restart apache2<\/p>\n<p>To check Apache2 status on the terminal run<\/p>\n<p># systemctl status apache2<\/p>\n<p>Sample Output<\/p>\n<p>\u25cf apache2.service &#8211; LSB: Apache2 web server&#xD;<br \/>\n Loaded: loaded (\/etc\/init.d\/apache2; bad; vendor preset: enabled)&#xD;<br \/>\n Drop-In: \/lib\/systemd\/system\/apache2.service.d&#xD;<br \/>\n \u2514\u2500apache2-systemd.conf&#xD;<br \/>\n Active: active (running) since Tue 2018-09-11 12:49:03 UTC; 26s ago&#xD;<br \/>\n Docs: man:systemd-sysv-generator(8)&#xD;<br \/>\n CGroup: \/system.slice\/apache2.service&#xD;<br \/>\n \u251c\u250028788 \/usr\/sbin\/apache2 -k start&#xD;<br \/>\n \u251c\u250028791 \/usr\/sbin\/apache2 -k start&#xD;<br \/>\n \u2514\u250028792 \/usr\/sbin\/apache2 -k start<\/p>\n<p>To verify whether the web server is indeed running, open your browser and enter your server&#8217;s IP address<\/p>\n<p>http:\/\/server-ip-address\/<\/p>\n<p>You should be able to view Apache&#8217;s default page as shown below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"restart Apache web server on Linux Systems\" height=\"568\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/09\/apache2-start.png\" width=\"1141\" \/><\/p>\n<p>For older versions of Ubuntu -14.10 and older and Debian older<\/p>\n<p>Start Apache2 service by running<\/p>\n<p># sudo service apache2 start&#xD;<br \/>\nor&#xD;<br \/>\n# \/etc\/init.d\/apache2 start&#xD;<br \/>\nor&#xD;<br \/>\n# sudo \/etc\/init.d\/apache2 start<\/p>\n<p>Stop Apache2 service by running<\/p>\n<p># sudo service apache2 stop&#xD;<br \/>\nor&#xD;<br \/>\n# \/etc\/init.d\/ apache2 stop<\/p>\n<p>Restart Apache2 service by running<\/p>\n<p># sudo service apache2 restart&#xD;<br \/>\nor&#xD;<br \/>\n# \/etc\/init.d\/ apache2 restart&#xD;<br \/>\nor&#xD;<br \/>\n# sudo \/etc\/init.d\/ apache2 restart<\/p>\n<p>Sample Output<\/p>\n<p>[ ok ] Restarting apache2 (via systemctl): apache2.service.<\/p>\n<p>Check Apache2 status run<\/p>\n<p># sudo service apache2 status&#xD;<br \/>\nor&#xD;<br \/>\n# \/etc\/init.d\/ apache2 status&#xD;<br \/>\nor&#xD;<br \/>\n# sudo \/etc\/init.d\/ apache2 status<\/p>\n<p>Sample Output<\/p>\n<p>\u25cf apache2.service &#8211; LSB: Apache2 web server&#xD;<br \/>\n Loaded: loaded (\/etc\/init.d\/apache2; bad; vendor preset: enabled)&#xD;<br \/>\n Drop-In: \/lib\/systemd\/system\/apache2.service.d&#xD;<br \/>\n \u2514\u2500apache2-systemd.conf&#xD;<br \/>\n Active: active (running) since Tue 2018-09-11 12:49:03 UTC; 26s ago&#xD;<br \/>\n Docs: man:systemd-sysv-generator(8)&#xD;<br \/>\n CGroup: \/system.slice\/apache2.service&#xD;<br \/>\n \u251c\u250028788 \/usr\/sbin\/apache2 -k start&#xD;<br \/>\n \u251c\u250028791 \/usr\/sbin\/apache2 -k start&#xD;<br \/>\n \u2514\u250028792 \/usr\/sbin\/apache2 -k start<\/p>\n<h2>On RHEL\/CentOS<\/h2>\n<h2>Apache2 Restart\/Start\/Stop<\/h2>\n<p>For newer versions of RHEL \/ CentOS (Versions 7.x and later)<\/p>\n<p>Start Apache2 by running<\/p>\n<p># systemctl start httpd&#xD;<br \/>\nor&#xD;<br \/>\n# systemctl start httpd.service<\/p>\n<p>Stop Apache2 by running<\/p>\n<p># systemctl stop httpd&#xD;<br \/>\nor&#xD;<br \/>\n# systemctl stop httpd.service<\/p>\n<p>Restart Apache2 by running<\/p>\n<p># systemctl restart httpd&#xD;<br \/>\nor&#xD;<br \/>\n# systemctl restart httpd.service<\/p>\n<p>To verify\/check the status of Apache2<\/p>\n<p># systemctl status httpd<\/p>\n<p>Sample Output<\/p>\n<p>\u25cf httpd.service &#8211; The Apache HTTP Server&#xD;<br \/>\n Loaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; disabled; vendor prese t: disabled)&#xD;<br \/>\n Active: active (running) since Tue 2018-09-11 17:33:28 UTC; 6min ago&#xD;<br \/>\n Docs: man:httpd(8)&#xD;<br \/>\n man:apachectl(8)&#xD;<br \/>\n Main PID: 1450 (httpd)&#xD;<br \/>\n Status: &#8220;Total requests: 0; Current requests\/sec: 0; Current traffic: 0 B\/s ec&#8221;&#xD;<br \/>\n CGroup: \/system.slice\/httpd.service&#xD;<br \/>\n \u251c\u25001450 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n \u251c\u25001451 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n \u251c\u25001452 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n \u251c\u25001453 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n \u251c\u25001454 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n \u2514\u25001455 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n&#xD;<br \/>\nSep 11 17:33:28 ip-172-31-16-67.us-east-2.compute.internal systemd[1]: Starti&#8230;&#xD;<br \/>\nSep 11 17:33:28 ip-172-31-16-67.us-east-2.compute.internal systemd[1]: Starte&#8230;&#xD;<br \/>\nHint: Some lines were ellipsized, use -l to show in full.&#xD;<\/p>\n<p>For older versions (CentOS\/RHEL (Red Hat) Linux version 4.x\/5.x\/6.x )<\/p>\n<p>Start Apache2 by running<\/p>\n<p># service httpd start<\/p>\n<p>Stop Apache2 by running<\/p>\n<p># service httpd stop<\/p>\n<p>Restart Apache2 by running<\/p>\n<p># service httpd restart<\/p>\n<p>To check the status of Apache web server<\/p>\n<p># service httpd status<\/p>\n<p>sample output<\/p>\n<p>\u25cf httpd.service &#8211; The Apache HTTP Server&#xD;<br \/>\nLoaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; disabled; vendor preset: disabled)&#xD;<br \/>\nActive: active (running) since Tue 2018-09-11 19:46:30 UTC; 1 weeks 1 days ago&#xD;<br \/>\nDocs: man:httpd(8)&#xD;<br \/>\nman:apachectl(8)&#xD;<br \/>\nProcess: 9118 ExecStop=\/bin\/kill -WINCH $ (code=exited, status=0\/SUCCESS)&#xD;<br \/>\nProcess: 22055 ExecReload=\/usr\/sbin\/httpd $OPTIONS -k graceful (code=exited, status=0\/SUCCESS)&#xD;<br \/>\nMain PID: 9122 (httpd)&#xD;<br \/>\nStatus: &#8220;Total requests: 0; Current requests\/sec: 0; Current traffic: 0 B\/sec&#8221;&#xD;<br \/>\nCGroup: \/system.slice\/httpd.service&#xD;<br \/>\n\u251c\u2500 9122 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022058 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022059 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022060 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022061 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022062 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u251c\u250022149 \/usr\/sbin\/httpd -DFOREGROUND&#xD;<br \/>\n\u2514\u250027556 \/usr\/sbin\/httpd -DFOREGROUND<\/p>\n<p>Just like in Debian systems, you can verify that the web server is running by opening your browser and typing your server&#8217;s IP address<\/p>\n<p>http:\/\/server-ip-address\/<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"restart Apache web server on Linux Systems\" height=\"558\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/09\/Apache2-start-RedHat.png\" width=\"1366\" \/><\/p>\n<h2>On Fedora<\/h2>\n<h2>Apache2 Restart\/Start\/Stop<\/h2>\n<p>For Fedora Systems (22 and later)<\/p>\n<p>Start Apache2 by running<\/p>\n<p># systemctl start httpd&#xD;<br \/>\nor&#xD;<br \/>\n# apachectl start<\/p>\n<p>Stop Apache2 by running<\/p>\n<p># systemctl stop httpd&#xD;<br \/>\nor&#xD;<br \/>\n# apachectl -k stop<\/p>\n<p>To restart Apache2 run<\/p>\n<p>apachectl -k restart<\/p>\n<p>To check Apache2 status<\/p>\n<p>systemctl status httpd<\/p>\n<p>To confirm that the server is up and running on a web browser, type the server&#8217;s IP<\/p>\n<p>http:\/\/server-ip-address\/<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"restart Apache web server on Linux Systems\" height=\"732\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/09\/Fedora-22-Apache-Default-Page.png\" width=\"1126\" \/><\/p>\n<p>In this article, we focussed on How you can start, stop and restart Apache2 web server on Linux Systems such as Ubuntu\/Debian and Redhat systems. We hope that this tutorial has been helpful.<\/p>\n<h3>Read Also:<\/h3>\n<ul>\n<li><a href=\"https:\/\/linoxide.com\/linux-how-to\/convert-use-pkcs12pfx-certificate-apache\/\" target=\"_blank\">How to Convert and Use PKCS#12\/PFX Certificate on Apache<\/a><\/li>\n<li><a href=\"https:\/\/linoxide.com\/webserver\/install-wordpress-freebsd-11-apache-php-mysql\/\" target=\"_blank\">How to Install WordPress on FreeBSD 11 with Apache, PHP and MySQL<\/a><\/li>\n<li><a href=\"https:\/\/linoxide.com\/linux-how-to\/install-lamp-stack-ubuntu\/\" target=\"_blank\">How to Install LAMP Stack on Ubuntu 18.04<\/a><\/li>\n<\/ul>\n<p> <a href=\"https:\/\/linoxide.com\/linux-how-to\/find-how-to-stop-and-restart-apache-on-linux-systems\/\" target=\"_blank\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we all know, Apache is a free and open source cross-platform web server that is used to serve both static and dynamic web pages. on the web. In this article, we&#8217;ll focus on how you can start and restart Apache web server on Linux systems using the apache2 command. On Ubuntu\/Debian Linux Let&#8217;s see &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/check-out-ways-to-stop-and-restart-apache-on-linux-systems\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Check Out Ways to Stop and Restart Apache on Linux Systems&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-452","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=452"}],"version-history":[{"count":0,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}