• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

client.sh and Apache

B

bttman

Guest
Hi to all.

This is more of a question, then a problem.

I'm using a php that block's client accounts, once they expire, with a crontab, every day.

The php script uses the following shell command: /usr/local/psa/bin/client.sh --off ' client login' and it works great.

The question is, the client.sh in the end, restarts apache right ? if so, apache fails to restart on my box, only by hand with service httpd restart.

Is there a way to avoid client.sh from restarting apache, since, the apache is restarted every 900 secs. ?

PS: also, the /usr/local/psa/bin/client.sh --on ' client login' does not restart apache, any diference from ON to OFF ?

Thanks in advance
 
Apache will get restarted every 900 seconds (or whichever number you set in Plesk) only if there was some change made that would require an Apache restart.

For example, if there are no changes made to Plesk settings, Apache will not get restarted at all, for hours or days (unlikely, but possible).

But if somebody changes something in Plesk that would need an Apache restart, it won't restart right away. It will restart in 900 seconds.

So your script needs to restart Apache.

You might use a service monitor, such as SIM, to monitor if your httpd is running. Such scripts than automatically restart a service that doesn't run. SIM can be found here.
 
Thank you guys for the replys,

I was thinking of a script to "spy" on apache, if it's down, the script would try to get apache up again.

But I found the solution, it's very simple.

PROBLEM:

the problem is that, the childes were left behind, blocking port 443, and don't allow main apache daemon to start.

SOLUTION:

vim /etc/rc.d/init.d/httpd

put "sleep 5" between stop and start in restart section

That's all, it works...

Thanks again for all the help
 
Back
Top