MoodleCron.exe authentication?

MoodleCron.exe authentication?

by Richard Kassissieh -
Number of replies: 2
MoodleCron.exe is returning a 404 error on our server. Our Windows web server requires directory authentication to view the Moodle site. Could this be the problem? Is there any way to pass authentication parameters through MoodleCron?  I tried the format http://user:pass@localhost/moodle/admin/cron.php without success. Thank you for letting me know.

Richard
Average of ratings: -
In reply to Richard Kassissieh

Re: MoodleCron.exe authentication?

by Richard Kassissieh -
I figured out a workaround. If you have directory security enabled on your IIS Moodle installation, don't use MoodleCron. Instead create a Windows Scheduled Task on your server. This passes credentials and executes the cron.php script from the command line, getting around nasty browser authentication issues.
  1. Open Control Panel --> Scheduled Tasks on your server
  2. Open Add Scheduled Task. Select Next.
  3. When asked to select an application, Browse to your PHP installation and select PHP.exe. Select Next.
  4. Create a name for the task (I called mine "Moodle cron")
  5. Perform this task "daily." Select Next.
  6. Perform this task "every day" (leave the other items on defaults). Select Next.
  7. Enter the name and password of a user who has directory privileges on your /moodle/admin folder. Select Next.
  8. Select "Open advanced properties for this task when I click Finish." Select Finish.
  9. Under the Task tab, append the location of cron.php to the Run field, e.g. c:\php\php.exe d:\webroot\moodle\admin\cron.php
  10. Under the Schedule tab, click Advanced and then select Repeat Task in order to make the task run more often than once per day. I set mine to run every ten minutes. Select Apply.
  11. Select OK. You're done! Check the Event log later to ensure that the script is not returning errors.