Improvements to apache scripts, so I can set up cron