InMotion Hosting Support Center

cron job blocked by Mod Security

Category: Databases

SergeyGorbachov
Asked:
2013-11-05 11:03 am EST

Hits: 1,018
I wont run my script test2.php from cite booksonline.com.ua.
And get message:
<html><head><title>Error 406 - Not Acceptable</title><head><body><h1>Error 406 - Not Acceptable</h1><p>Generally a 406 error is caused because a request has been blocked by Mod Security. If you believe that your request has been blocked by mistake please contact the web site owner.</p></body></html>

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

JeffMa
11,186 Points
2013-11-05 11:47 am EST
While we would be unable to provide you with the exact rule that is blocking it via this public forum, I can help you resolve it. This can be resolved by simply turning off mod_security on your domain. The following article will assist you in doing so:
<a href="http://www.inmotionhosting.com/support/website/modsecurity/disable-mod-security-via-modsec-manager">Disable mod_security via cPanel Modsec Manager</a>

You must login before you can post a comment about this answer.

I turn off in Modsec Manager my sites. But I again have same error.
My command in cron job is : curl http://www.booksonline.com.ua/test2.php
SergeyGorbachov
73 Points
2013-11-05 12:24 pm EST
<div style="background-color: #FFF; padding-left: 10px;">Hello SergeyGorbachov,

When you're running a cron job with the <strong>curl</strong> command, you'll want to be sure to specify a <strong>User-Agent</strong> string along with your URL to avoid any problems.

This is covered in our guide on <a href="http://www.inmotionhosting.com/support/edu/cpanel/301-run-cron-job#user-agent-string" target="_blank">running a cron job with curl</a>. Basically your cron job command would need to look something like:

<pre class="code_block" style="width: 500px; white-space: normal; margin-bottom: 15px;">/usr/bin/curl <strong style="color: red;">--user-agent cPanel-Cron</strong> http://example.com/cron.php</pre>

Please let us know if you still encounter any issues at all.

- Jacob</div>
JacobIMH
9,968 Points
2013-11-05 12:59 pm EST
Like this Question?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!