Current time: 11-27-2024, 10:14 AM Hello There, Guest! (LoginRegister)


Post Reply 
Apache - Reload instead of Restart
Author Message
Ballistic509 Offline
Junior Member
*

Posts: 24
Joined: May 2007
Reputation: 0
Post: #1
Apache - Reload instead of Restart
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..
05-21-2007 05:06 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: Apache - Reload instead of Restart
engine/ispcp-serv-mngr
sub restart_httpd {... }

should work, but restart is safer :-) (but takes more time in big installations)
05-21-2007 05:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
raphael Offline
Member
***

Posts: 474
Joined: Apr 2007
Reputation: 8
Post: #3
RE: Apache - Reload instead of Restart
Open a ticket
05-21-2007 05:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ballistic509 Offline
Junior Member
*

Posts: 24
Joined: May 2007
Reputation: 0
Post: #4
RE: Apache - Reload instead of Restart
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.
(This post was last modified: 05-21-2007 05:52 AM by Ballistic509.)
05-21-2007 05:43 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: Apache - Reload instead of Restart
well, try it out - should work...

maybe "reload" is not _that_ official in all *nix...
05-21-2007 07:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ballistic509 Offline
Junior Member
*

Posts: 24
Joined: May 2007
Reputation: 0
Post: #6
RE: Apache - Reload instead of Restart
"reload" works on Debian lol..I guess if it don't work I'll get an error or something somewhere lol
05-21-2007 07:23 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #7
RE: Apache - Reload instead of Restart
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...
05-21-2007 07:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ballistic509 Offline
Junior Member
*

Posts: 24
Joined: May 2007
Reputation: 0
Post: #8
RE: Apache - Reload instead of Restart
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.
05-21-2007 07:37 AM
Find all posts by this user Quote this message in a reply
Ballistic509 Offline
Junior Member
*

Posts: 24
Joined: May 2007
Reputation: 0
Post: #9
RE: Apache - Reload instead of Restart
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.
05-21-2007 07:49 AM
Find all posts by this user Quote this message in a reply
raphael Offline
Member
***

Posts: 474
Joined: Apr 2007
Reputation: 8
Post: #10
RE: Apache - Reload instead of Restart
An other way is: apache2 graceful
05-21-2007 08:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)