I get many of these errors each day in my apache error log:
[error] [client 127.0.0.1] script '/var/www/html/wp-cron.php' not found or unable to stat
and I'm wondering if it has something to with my httpd.conf, because my DocumentRoot is set as "/var/www/html" but my WordPress site(s) are in a top directory called httpdocs, not html. wp-cron.php exists, but it's in httpdocs, not html, and there is no html directory. There are multiple WordPress sites and domains on the VPS and at the IP.
There are no other errors like that in the logs, and WordPress seems to run fine. But I want to fix these errors, as it's a bit of an extra load on the server.
Is there a way to add a redirect or alias in httpd.conf so wp-cron.php can be found? Or this a different matter with a different solution?
Edit: Found the answer; problem was hosts file entries: Hosts file entries for multiple domains on VPS?
The
DocumentRoot
in httpd.conf is likely to be the default for any hosts not handled by a virtual host. For example, requests on the IP address.You could set the
DocumentRoot
to be the same as the default site (if that's what you want for requests to the IP address), or you use aRewriteRule
to rewrite the request back to the main site either in the httpd.conf or in the.htaccess
file:Without knowing what the script is, or if it exists elsewhere, it's not easy to advise. A symlink could also fix it, but permissions might get in your way.
Found the answer; problem was hosts entries: Hosts file entries for multiple domains on VPS?