Advertisement
hjysy

cronjob error 403

Sep 14th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.86 KB | None | 0 0
  1. cronjob error 403
  2. I have a problem to configure my cronjob.
  3. ++++++++++++++
  4. If You want to buy cheap web hosting then visit http://Listfreetop.pw and select the cheapest hosting. it can be suitable for all your needs.
  5.  
  6. Top 200 best traffic exchange sites http://Listfreetop.pw/surf
  7.  
  8. list of top gpt sites
  9. list of top ptc sites
  10. list of top ptp sites
  11. list of top crypto currency Wallets sites
  12. Listfreetop.pw
  13. Listfreetop.pw
  14. Listfreetop.pw
  15. +++++++++++++++
  16.  
  17. I have an error 403 result. I can not access the file despite giving permission: 644, 711, 755 to the file PHP
  18. I can not afford to give the 777 permission to the file PHP. It's too dangerous.
  19. I called my provider and asked the software producer.
  20. The only way to configure the cron is by php access.
  21. I can not get the usual cronjob codes.
  22. Thanks a lot for your help.
  23. Hi,
  24.  
  25. So did setting 777 work? Not clear from your question.
  26.  
  27. Try checking error logs.
  28.  
  29. This may be an owner issue, this may trigger 403s.
  30. HostInsider - web in simple words
  31.  
  32. A 403 is a http error code, so are you running the cron as: wget / curl http://example.com/file.php? Permissions would come in to play here but 644 for example should be enough. If you are doing: php path_to_file, then permissions of the file and folder will dictate access but if you are running the cron as the user and files are owned by that user then again standard permissions should work.
  33.  
  34. If you are doing a wget / curl method, make sure mod security or other filter isn't filtering the user agent for wget / curl and if it is you will have to change the user agent via --user-agent=agent-string for wget or --user-agent "agent" for curl.
  35.  
  36. Beyond that, we would need an error log entry to help further.
  37. -Steven | u2-web@Cooini, LLC - Business Shared Hosting | Isolate sites with Webspaces | Site Builder | PHP-FPM | MariaDB
  38. WHMCS Modules: Staff Knowledgebase | Custom Modules and Hooks
  39. "It is the mark of an educated mind to be able to entertain a thought without accepting it" -Aristotle
  40.  
  41. Hello, thank you for your answer. it helps me a lot.
  42. I am a little desperate.
  43. I'm not sure where that comes from. I asked cloudflare and they say the problem is the provider. The provider says it comes from cloudflare.
  44. Last edited by Aldebaron; 12-29-2018 at 05:09 PM.
  45.  
  46. Hi,
  47.  
  48. So did setting 777 work? Not clear from your question.
  49.  
  50. Try checking error logs.
  51.  
  52. This may be an owner issue, this may trigger 403s.
  53. i'm going test 777 next time.
  54. But it's dangerous?
  55. Thanks
  56.  
  57. A 403 is a http error code, so are you running the cron as: wget / curl http://example.com/file.php? Permissions would come in to play here but 644 for example should be enough. If you are doing: php path_to_file, then permissions of the file and folder will dictate access but if you are running the cron as the user and files are owned by that user then again standard permissions should work.
  58.  
  59. If you are doing a wget / curl method, make sure mod security or other filter isn't filtering the user agent for wget / curl and if it is you will have to change the user agent via --user-agent=agent-string for wget or --user-agent "agent" for curl.
  60.  
  61. Beyond that, we would need an error log entry to help further.
  62. Hello, thank you for your answer. it helps me a lot. Yes I think the mistake must be http. As for the configuration. I am at a provider who has a custom panel. So I can not know if it's by wget or crul ...
  63. I can only give the address of the file and the timing.
  64. I called the provider and they are used to problems like wordpress and drupal. So they do not know how to help me
  65. I forgot to prescise. I have a cdn that is install. Cloudflare style.
  66. Maybe cloudflare, maybe permission, maybe http/https?
  67. how's know?
  68.  
  69. i'm going test 777 next time.
  70. But it's dangerous?
  71. Thanks
  72. Nothing will happen if you set it temporary for testing purposes. Just don't leave 777.
  73. HostInsider - web in simple words
  74.  
  75. I am at a provider who has a custom panel. So I can not know if it's by wget or crul ...
  76. I can only give the address of the file and the timing.
  77. Can you show the interface (screen capture) where you're adding this? Generally for PHP files you need to define what to use, like PERL or PHP at the start of the command, like: php /home/location/file.php
  78. If it was cURL or wget (both are generally external calls) it would need to say that.
  79. Move over, coffee, this is a job for alcohol!
  80.  
  81. Can you show the interface (screen capture) where you're adding this? Generally for PHP files you need to define what to use, like PERL or PHP at the start of the command, like: php /home/location/file.php
  82. If it was cURL or wget (both are generally external calls) it would need to say that.
  83. Commentaire from provider faq:
  84. "Cron jobs do not know the absolute path. Calling up PHP without specifying the full paths to the executable therefore makes it impossible to execute the job"
  85.  
  86. Yes, I understand. It may want something like /usr/bin/php, but since I don't know your environment, I didn't specify. Did you do that; specify the full path to both the executable and the file you asked it to run?
  87. Move over, coffee, this is a job for alcohol!
  88.  
  89. Yes, I understand. It may want something like /usr/bin/php, but since I don't know your environment, I didn't specify. Did you do that; specify the full path to both the executable and the file you asked it to run?
  90. thank for your answer.
  91. No i can't use this instructions.
  92. That star only with "https/https: mywebsite/path/file"
  93. and i select the frequence.(time).
  94. Best regards
  95.  
  96. Here is a copy of the htaccess file that protects the file
  97. "<IfModule authz_core_module>
  98. Require all denied
  99. </IfModule>
  100. <IfModule !authz_core_module>
  101. Deny from all
  102. </IfModule>"
  103.  
  104.  
  105. Is there a way to give permission to a single file?
  106.  
  107. Well, there's the problem.
  108. https://httpd.apache.org/docs/2.4/mo...uthz_core.html
  109. Require all denied
  110. Access is denied unconditionally.
  111. Move over, coffee, this is a job for alcohol!
  112.  
  113. Well, there's the problem.
  114. https://httpd.apache.org/docs/2.4/mo...uthz_core.html
  115. Thanks for the answer, finally a track for a solution.
  116. Is it possible to solve the problem by authorizing a specific file.
  117. Could I add a line of code to access file authorization only?
  118. mywebsite.com/path/cronfile
  119. In order to keep the folder protect and allow the file only?
  120. Thank you
  121.  
  122. Hello,
  123. I have a problem to configure my cronjob.
  124. I have an error 403 result. I can not access the file despite giving permission: 644, 711, 755 to the file PHP
  125. I can not afford to give the 777 permission to the file PHP. It's too dangerous.
  126. I called my provider and asked the software producer.
  127. The only way to configure the cron is by php access.
  128. I can not get the usual cronjob codes.
  129. Thanks a lot for your help.
  130. Certainly there is a ".htaccess" file under the same folder where you cron file runs from. No need to setup 777 on the file. Just ensure you exclude your cron file in .htaccess file. Just search for it an you will fine the "allow, deny" entry in .htaccess file that can help you out.
  131.  
  132. <Files CRONFILE.php>
  133. Order Allow,Deny
  134. Allow from all
  135. </Files>
  136.  
  137. Or simply rename your .htaccess file for testing.
  138.  
  139. That should to the trick. If nothing works, like almost everyone said, checking the logs is the ultimate way to investigate further.
  140.  
  141. Just a thought..
  142. Warm regards
  143. L3Web Hosting - Web hosting services at your fingertips
  144. L3Tech Support - Support round the clock
  145.  
  146. Certainly there is a ".htaccess" file under the same folder where you cron file runs from. No need to setup 777 on the file. Just ensure you exclude your cron file in .htaccess file. Just search for it an you will fine the "allow, deny" entry in .htaccess file that can help you out.
  147.  
  148. <Files CRONFILE.php>
  149. Order Allow,Deny
  150. Allow from all
  151. </Files>
  152.  
  153. Or simply rename your .htaccess file for testing.
  154.  
  155. That should to the trick. If nothing works, like almost everyone said, checking the logs is the ultimate way to investigate further.
  156.  
  157. Just a thought..
  158. Thanks a lot for your help. It's really great. I will test your solutions as soon as possible.
  159. This is the best answer I have had for the moment.
  160. thank you so much.
  161. To understand well.
  162. I have to write how the code, there must be no space?
  163. I have to write before or after the code, it's good sintax?:
  164.  
  165. <IfModule authz_core_module>
  166. Require all denied
  167. </IfModule>
  168. <IfModule !authz_core_module>
  169. Deny from all
  170. </IfModule>
  171. <Files CRONFILE.php>
  172. Order Allow,Deny
  173. Allow from all
  174. </Files>
  175.  
  176. I was also sent another code tonight. What do you think about?
  177.  
  178. # BEGIN Allow CRON
  179. <Files "wp-cron.php">
  180. Allow from All
  181. Satisfy Any
  182. </Files>
  183. # END Allow CRON
  184.  
  185. thank you so much
  186.  
  187. Thanks a lot for your help. It's really great. I will test your solutions as soon as possible.
  188. This is the best answer I have had for the moment.
  189. thank you so much.
  190. To understand well.
  191. I have to write how the code, there must be no space?
  192. I have to write before or after the code, it's good sintax?:
  193.  
  194. <IfModule authz_core_module>
  195. Require all denied
  196. </IfModule>
  197. <IfModule !authz_core_module>
  198. Deny from all
  199. </IfModule>
  200. <Files CRONFILE.php>
  201. Order Allow,Deny
  202. Allow from all
  203. </Files>
  204.  
  205. I was also sent another code tonight. What do you think about?
  206.  
  207. # BEGIN Allow CRON
  208. <Files "wp-cron.php">
  209. Allow from All
  210. Satisfy Any
  211. </Files>
  212. # END Allow CRON
  213.  
  214. thank you so much
  215. Yes, all good but just remember to add the CRONFILE.php code above all other codes.
  216.  
  217. That should help.
  218. Warm regards
  219. L3Web Hosting - Web hosting services at your fingertips
  220. L3Tech Support - Support round the clock
  221. Reply With Quote Reply With Quote 0 Not allowed!
  222. Quick Navigation Web Hosting Top
  223. ? Previous Thread | Next Thread ?
  224. Similar Threads
  225. Error 403 on some virtual hosts and not on others
  226. By talismanp4 in forum Hosting Security and Technology
  227.  
  228. cba hosting forum
  229. hitmart.com
  230. secure.buxinside.com
  231. 4 domains of learning
  232. gta v make money
  233. m&b warband make money
  234. aiopsplashbuilder.com
  235. hosting kit
  236. free hosting and domain
  237. pokemon x make money
  238. genxwhosting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement