sudo service apache2 restart for the way that's borrowed from Red Hat.
sudo service apache2 restart for the way that's borrowed from Red Hat.
Do you want to restart Apache, or do you want to gracefully reload its configuration?
Everyone was answering the first question; you can do the second with
sudo service apache2 reload
Gracefully reloading is a bit faster, and there's no downtime.
There's one caveat: if your apache config files contain an error (e.g. configures a log file in a directory that doesn't exist), the server may silently exit without printing any error messages to the console. Most other errors are caught by the apache2ctl configtest that service apache2 reload runs before doing the actual reload with apache2ctl graceful.
Videos
How do I make Apache start automatically after a reboot?
Where are the Apache log files?
How do I check if Apache is running?
you type >which apachetl,
if result is such below
/usr/bin/which: no lsasd in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/turkcell/wlsadmin/bin)
you have to add its full path to PATH enviroment in order to execute command at any directory.
PATH=$PATH:/usr/local/services/apache2-2/bin
apachectl may not be on your PATH so your OS doesn't know what that command is or where it is (even though you cd into the folder).
If you provide a path to the command Linux will know what to do with it.
If you cd into the folder and do ./apachectl restart it should work as well.