Magento – Google Sitemap generates errors

magento-1.9sitemaps

When I manually Generate sitmap.xml from admin's Catalog>Google Sitemap, it throws the following error in the browser:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@TheDomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache error_log

[Fri Dec 25 10:15:12 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 10:26:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/  
[Fri Dec 25 10:31:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/  
[Fri Dec 25 10:41:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/  
[Fri Dec 25 10:46:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/  
[Fri Dec 25 10:47:40 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 10:47:52 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml  
[Fri Dec 25 11:13:04 2015] [notice] SIGUSR1 received.  Doing graceful restart    
[Fri Dec 25 11:13:05 2015] [notice] Digest: generating secret for digest authentication ...  
[Fri Dec 25 11:13:05 2015] [notice] Digest: done  
[Fri Dec 25 11:13:06 2015] [warn] RSA server certificate CommonName (CN) `www.DOMAIN.com' does NOT match server name!?  
[Fri Dec 25 11:13:06 2015] [notice] Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4 configured -- resuming normal operations

This could be a browser time out issue!

Can this command be executed from shell ssh?

Best Answer

Ok, seems to be a timeout problem, but could be a write permissions problem too, so just to be sure:

  1. Try to switch to webserver user ie: $ su www-data
  2. Then try to write a file in magento root folder (as same level as index.php) ie: $ touch [magento_root]/test-file

If these validation steps are ok, try to change the php timeouts (you can change these values just for admin request) here you will find a guide about changing php timeouts and other limitations.

However you would be able to perform sitemap.xml generation automatically if you have a system cronjob configured and pointed to magento cron.php/sh file, and properly configured in backend:

enter image description here

Related Topic