Drupal cron.php restriction
I recently made my first cron contrib module for Drupal, DB Maintenance. Since the DB Maintenance OPTIMIZE TABLE query locks the database tables it queries, I don't want just anyone to access cron.php anymore. The restriction I added was for the Apache .htaccess file that manages the clean URL rewrite rule.
<Files cron.php> Order deny,allow Allow from 207.7.108.211 127.0.0.1 Deny from all</Files>
207.7.108.211 is the current IP address of deekayen.net, which is needed instead of 127.0.0.1 when you run cron.php with lynx or wget as the documentation strongly suggests, which means 127.0.0.1 isn't the remote IP when Apache receives the request. I only put in 127.0.0.1 so in the future, if I need to access from localhost for some reason, I can.


Post new comment