Can someone tell me the scenarios when I have to restart apache2 in apache2 and mod_php setup? do we need to restart apache2 for every code deploy?
I am new here and confused on when to restart apache2 .
Can someone tell me the scenarios when I have to restart apache2 in apache2 and mod_php setup? do we need to restart apache2 for every code deploy?
I am new here and confused on when to restart apache2 .
I am trying to understand your question although I may be reading it wrong. I will tell you this though, Joe Conlin is right. You do not have to restart apache2 unless you make changes to configuration files or modify the server in some way. If you are trying to restart the server after installing a module or after changing conf files you can use "sudo systemctl reload apache2" to restart apache2 without dropping connections. Otherwise, use "sudo systemctl restart apache2" to stop and then restart apache2.
Generally, it is good practice to restart after making some kind of server-side modification, in any form. I hope this helps!
The only time there is a need to restart your Apache server is when you make changes to the conf file or change the server config in some way. While working in the web directory, you should never have to restart Apache. Also remember, you can use .htaccess to further avoid restarting Apache.