ispCP - Board - Support
Apache - Reload instead of Restart - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: Apache - Reload instead of Restart (/thread-619.html)

Pages: 1 2


Apache - Reload instead of Restart - Ballistic509 - 05-21-2007 05:06 AM

Is it possible to have ispCP use the reload command for apache instead of restart or is this unsafe? If It can be done, where can I edit the script or command that controls this?

Thanks..


RE: Apache - Reload instead of Restart - joximu - 05-21-2007 05:31 AM

engine/ispcp-serv-mngr
sub restart_httpd {... }

should work, but restart is safer :-) (but takes more time in big installations)


RE: Apache - Reload instead of Restart - raphael - 05-21-2007 05:39 AM

Open a ticket


RE: Apache - Reload instead of Restart - Ballistic509 - 05-21-2007 05:43 AM

So just to double check this, If I made the following change would this be correct? lol

Original
Code:
sub restart_httpd {

    my ($cmd, $rs, $rdata) = (undef, undef, undef);

    push_el(\@main::el, 'restart_httpd()', 'Starting...');

    $cmd = $main::cfg{'CMD_HTTPD'};

    sys_command_rs("$cmd stop");

    sleep(5);

    sys_command_rs("$cmd start");

    sleep(5);

    push_el(\@main::el, 'restart_httpd()', 'Ending...');

}


Change
Code:
sub restart_httpd {

    my ($cmd, $rs, $rdata) = (undef, undef, undef);

    push_el(\@main::el, 'restart_httpd()', 'Starting...');

    $cmd = $main::cfg{'CMD_HTTPD'};

    sys_command_rs("$cmd reload");

    sleep(5);

    push_el(\@main::el, 'restart_httpd()', 'Ending...');

}


raphael Wrote:Open a ticket

I figured there was really no error, or bug in this so I thought I would ask here.


RE: Apache - Reload instead of Restart - joximu - 05-21-2007 07:15 AM

well, try it out - should work...

maybe "reload" is not _that_ official in all *nix...


RE: Apache - Reload instead of Restart - Ballistic509 - 05-21-2007 07:23 AM

"reload" works on Debian lol..I guess if it don't work I'll get an error or something somewhere lol


RE: Apache - Reload instead of Restart - joximu - 05-21-2007 07:30 AM

Sure it works on Debian but I don't know i it works on any BSD - maybe that's why the developer took "stop" and "start"....
I was just thinking if it's a good idea to change it in the trunk...


RE: Apache - Reload instead of Restart - Ballistic509 - 05-21-2007 07:37 AM

True. It's needed for a script on my server that I run. If Apache is restarted then I get errors so for my personal use I can change it if needed, as can other users.


RE: Apache - Reload instead of Restart - Ballistic509 - 05-21-2007 07:49 AM

All appears to be working. No errors found in logs when adding sub-domain and I'm assuming that this is when apache would run that piece of code to update the virtual hosts.


RE: Apache - Reload instead of Restart - raphael - 05-21-2007 08:51 AM

An other way is: apache2 graceful