Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

I need to restart web server via cron

General questions about VestaCP
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
pipoy
Posts: 112
Joined: Mon Sep 11, 2017 8:02 am

Os: CentOS 6x
Web: apache
I need to restart web server via cron
  • Quote

Post by pipoy » Fri Apr 03, 2020 6:14 am

Hi,

For some reason, these don't work via cron and even in crontab via root

sudo /usr/local/vesta/bin/v-restart-web
sudo service httpd restart

But if I manually run them on ssh, they work.

What am I missing?
Top

youradds
Posts: 130
Joined: Tue Sep 01, 2015 10:16 am

Re: I need to restart web server via cron
  • Quote

Post by youradds » Sat Apr 04, 2020 2:10 pm

Hi,
sudo /usr/local/vesta/bin/v-restart-web
I'm not sure what that is supposed to do?

For "sudo service httpd restart", what is the exact cron you are using? I would set a custom mailto for that command - something like:

Code: Select all

[email protected]
@daily sudo service httpd restart
Then when it runs, you should get emailed the output (error message included)

Also, what server type are you using?

Hope that helps

Andy
Top

pipoy
Posts: 112
Joined: Mon Sep 11, 2017 8:02 am

Os: CentOS 6x
Web: apache
Re: I need to restart web server via cron
  • Quote

Post by pipoy » Sat Apr 04, 2020 6:03 pm

youradds wrote: ↑
Sat Apr 04, 2020 2:10 pm
Hi,
sudo /usr/local/vesta/bin/v-restart-web
I'm not sure what that is supposed to do?

For "sudo service httpd restart", what is the exact cron you are using? I would set a custom mailto for that command - something like:

Code: Select all

[email protected]
@daily sudo service httpd restart
Then when it runs, you should get emailed the output (error message included)

Also, what server type are you using?

Hope that helps

Andy

/bin/systemctl restart httpd.service seems to work on cron.

Reason being is I need to restart apache because my wordpress websites eat a lot of ram.
3 of them to be exact. But it only needs 1 wordpress to crash the system. For some reason, the 3 of them share the same resources. If I disable one of the website, RAM gets freed up.

Ram is 4gb

Restarting apache is my workaround until I come up a way to limit the ram usage for wordpress. But none of the solutions I have found works. This looks like another problem for not related to vesta. But if you can recommend something, I am all ears right here.

As my profile shows, I am running Centos7
Top

youradds
Posts: 130
Joined: Tue Sep 01, 2015 10:16 am

Re: I need to restart web server via cron
  • Quote

Post by youradds » Sun Apr 05, 2020 7:58 am

Hi,

Probably not the answer you were hoping for - but you *really* should update your install Centos 7 is 2014 - so 6 years old. Its end of life is in a couple of months so you will be screwed. Not only will newer versions have better security, you should also find performance better.

Secondly - who do you host with? The type of server you use can also be an issue (I use Linode, and have never had any issues with performance - even with large sites)

Also - I'm more an Ubuntu user myself. Never really got into the other flavors (you stick with what you know :))

UPDATE: Oh, it seems that Centos 8 isn't yet officially supported by Vesta. You may want to look into Ubuntu 18.04 which I'm using on my servers now (I was on 16.04, but recently updated and its bloody awesome and fast!)

Cheers

Andy
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password