add setup.py functionality for local or apache deployment

some changes to setup.py that allow it to be run from a cronjob on the server