{"id":8558,"date":"2020-04-30T13:55:14","date_gmt":"2020-04-30T17:55:14","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=8558"},"modified":"2021-12-08T10:15:12","modified_gmt":"2021-12-08T15:15:12","slug":"stop-start-restart-apache-service","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/stop-start-restart-apache-service\/","title":{"rendered":"How to Stop, Start and Restart Apache Service"},"content":{"rendered":"\n
One thing you will eventually need to know as you crawl through web servers is how to stop, start and restart the Apache service. <\/p>\n\n\n\n
The reason you will need to do this is usually Apache requires a restart when there is a change in configuration for the changes to take effect.<\/p>\n\n\n\n
There is a slight problem. Apache<\/a> is a cross-platform web server. Not only do these servers have different names, but the installation locations vary, there are different scripts used to manage the server depending on the distro.<\/p>\n\n\n\n Seeing that different platforms might use different binary or script names it might be good to get that out of the way.<\/p>\n\n\n\n Generally, Debian, Ubuntu<\/a>, and their variants use apache2 as the binary name. All other major Linux and Unix<\/a> distros like openSUSE, SLES, Fedora Core, CentOS, RHEL, and macOS use httpd. Windows uses httpd.exe.<\/p>\n\n\n\n Stop, Start and Restart Apache Service Using httpd<\/p>\n\n\n\n Method 1: System V. Init scripts<\/strong><\/p>\n\n\n\n On Ubuntu or Debian\u2026<\/p>\n\n\n\n Method 2: Systemd<\/strong><\/p>\n\n\n\n On Ubuntu or Debian\u2026<\/p>\n\n\n\n Method 3: service command<\/strong><\/p>\n\n\n\n On Ubuntu or Debian\u2026<\/p>\n\n\n\n Method 4: Apache binary script<\/strong><\/p>\n\n\n\n or<\/p>\n\n\n\n Where the user is not root which is most of the time, you will need to prepend One thing you will eventually need to know as you crawl through web servers is how to stop, start and restart the Apache service. The reason you will need to…<\/p>\n","protected":false},"author":1,"featured_media":8559,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,27,14,28,16],"tags":[58,164,320,354,359,424,531,544,598,635,636,638,646],"yoast_head":"\n$ sudo \/etc\/init.d\/httpd\/restart\n$ sudo \/etc\/init.d\/httpd\/start\n$ sudo \/etc\/init.d\/httpd\/stop\n$ sudo \/etc\/init.d\/httpd\/status<\/code><\/pre>\n\n\n\n
$ sudo \/etc\/init.d\/apache2\/restart\n$ sudo \/etc\/init.d\/apache2\/start\n$ sudo \/etc\/init.d\/apache2\/stop\n$ sudo \/etc\/init.d\/apache2\/status<\/code><\/pre>\n\n\n\n
$ sudo systemctl restart httpd\n$ sudo systemctl start httpd\n$ sudo systemctl stop httpd\n$ sudo systemctl status httpd<\/code><\/pre>\n\n\n\n
$ sudo systemctl restart apache2\n$ sudo systemctl start apache2\n$ sudo systemctl stop apache2\n$ sudo systemctl status apache2<\/code><\/pre>\n\n\n\n
$ sudo service httpd restart\n$ sudo service httpd start\n$ sudo service httpd stop\n$ sudo service httpd status<\/code><\/pre>\n\n\n\n
$ sudo service apache2 restart\n$ sudo service apache2 start\n$ sudo service apache2 stop\n$ sudo service apache2 status<\/code><\/pre>\n\n\n\n
$ sudo apachectl restart\n$ sudo apachectl start\n$ sudo apachectl stop\n$ sudo apachectl status<\/code><\/pre>\n\n\n\n
$ sudo apache2ctl restart\n$ sudo apache2ctl start\n$ sudo apache2ctl stop\n$ sudo apache2ctl status<\/code><\/pre>\n\n\n\n
sudo <\/code>as shown in the above commands.<\/p>\n","protected":false},"excerpt":{"rendered":"