mydomain is the main domain (in Plesk, Media Temple MT VPS), and under that are several Wordpress sites, like mysite1.com, mysite2.com, etc.

Problem is that I get lots of these errors in httpd's error_log:

[error] [client 127.0.0.1] script '/var/www/html/wp-cron.php' not found or unable to stat

wp-cron.php does exist at the html root in all the Wordpress installs.

I've found hints elsewhere that these errors may have something to do with my /etc/hosts file. This is the hosts file:

127.0.0.1 mydomain.com mydomain localhost localhost.localdomain

Question: do I need to add mysite1.com, mysite2.com, etc., to the hosts file so they resolve and can find the wp-cron.php file?

Edit: found the answer after much Googling. Seems that there are two issues: the hosts file and the fact that MT VPS overwrite the hosts file on each reboot. So the hosts file should look like this for multiple domains on one server:

127.0.0.1 localhost localhost.localdomain
xxx.xxx.xxx.xxx  yourdomain1.com yourdomain1 yourdomain2.com yourdomain2

And those lines must have a few blank lines above the in the hosts file, or they will get overwritten each reboot. See http://bradt.ca/archives/fix-wordpress-missed-schedule-error-on-media-temple-dv-plesk/

link|improve this question

feedback

2 Answers

How do you have the script set up under Plesk? If you are trying to do a wget or such, you don't want the /var/www/html. If you are running the script as a user in a shell, does the script have appropriate permissions to run as that user?

link|improve this answer
feedback
up vote 0 down vote accepted

Found the answer after much Googling. See edit above.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.