Support

Admin Tools

#42795 How to make .htaccess allow triggering Joomla native scheduled tasks from hosting cron jobs

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.4.3
PHP version
8.2.28
Admin Tools version
n/a

jorlan

Hi,

On our site the user action logs table is growing quickly, so we set up a Joomla native scheduled task of the type "Delete ActionLogs". However, we felt that the lazy scheduler trigger was, indeed, a bit lazy so we wanted to trigger the task with a cron job from the hosting environment to ensure that it will run on time. The cron command as copied from the Joomla options for the scheduled tasks looks like this:

wget 'https://ourdomain.com/component/ajax/?plugin=RunSchedulerWebcron&group=system&format=json&hash=...'

Then we noticed that this command is blocked by our .htaccess file which was made using AdminTools > .htaccess Maker, resulting in the message: ERROR 403: Forbidden.

When reverting to the Joomla default .htaccess the cron is not blocked.

Would it be safe to grant access to the path /component/ajax in our .htaccess, e.g. under "Allow direct access, including .php files, to these directories" in .htaccess Maker? Or do we need to take additional measures in order to keep it as safe as possible? 

Kind regards

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!