migrate from print/sys.exit to stdout/CommandError. Get database path programmatically. Configure permissions for apache in apache config script.